jwanative.pas 762 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258
  1. {******************************************************************************}
  2. { }
  3. { Interface unit for the Windows NT Native API }
  4. { Copyright (C) 1999, 2000, 2005 Marcel van Brakel (brakelm) }
  5. { Copyright (C) 2000-2001, 2005 Oliver Schneider (assarbad) }
  6. { }
  7. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  8. { }
  9. { You may retrieve the latest version of this file at the Project JEDI }
  10. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  11. { }
  12. { The contents of this file are used with permission, subject to the Mozilla }
  13. { Public License Version 1.1 (the "License"); you may not use this file except }
  14. { in compliance with the License. You may obtain a copy of the License at }
  15. { http://www.mozilla.org/MPL/MPL-1.1.html }
  16. { }
  17. { Software distributed under the License is distributed on an "AS IS" basis, }
  18. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  19. { the specific language governing rights and limitations under the License. }
  20. { }
  21. { Alternatively, the contents of this file may be used under the terms of the }
  22. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  23. { provisions of the LGPL License are applicable instead of those above. }
  24. { If you wish to allow use of your version of this file only under the terms }
  25. { of the LGPL License and not to allow others to use your version of this file }
  26. { under the MPL, indicate your decision by deleting the provisions above and }
  27. { replace them with the notice and other provisions required by the LGPL }
  28. { License. If you do not delete the provisions above, a recipient may use }
  29. { your version of this file under either the MPL or the LGPL License. }
  30. { }
  31. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  32. { }
  33. {******************************************************************************}
  34. // $Id: JwaNative.pas,v 1.24 2007/09/14 06:48:46 marquardt Exp $
  35. {******************************************************************************}
  36. {** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING **}
  37. {******************************************************************************}
  38. {** **}
  39. {** The prototypes, declarations and information in this file has been **}
  40. {** compiled from various sources as well as through reverse engineering **}
  41. {** techniques. We make no guarantee as to the correctness of the contents. **}
  42. {** Caution is recommended, USE AT YOUR OWN RISK. **}
  43. {** **}
  44. {******************************************************************************}
  45. {** About the Native API ** }
  46. {******************************************************************************}
  47. {** **}
  48. {** The functions herein are usually referred to as the NT Native API. **}
  49. {** The Native API is subdivided into several functional categories, which **}
  50. {** you can distinguish by the function name prefix: **}
  51. {** **}
  52. {** Cc = Cache Controller **}
  53. {** Cm = Configuration Manager **}
  54. {** Csr = Client Server support functions (LPC; related: CSRSS.EXE) **}
  55. {** Dbg = Debugger support functions **}
  56. {** Etw = Event Tracing for Windows **}
  57. {** Ex = Executive **}
  58. {** Fs = File system support functions **}
  59. {** Hal = Hardware abstraction layer functions **}
  60. {** Inbv = Something like: _In_itial _B_oot _V_ideo functions **}
  61. {** Io = I/O manager support functions **}
  62. {** Kd = Kernel debugger support functions **}
  63. {** Ke = General Kernel **}
  64. {** Ki = Kernel internal support functions (???) **}
  65. {** Ldr = PE image loader support functions **}
  66. {** Lpc = LPC support functions **}
  67. {** Lsa = Local security authority support functions **}
  68. {** Mm = Memory manager support functions **}
  69. {** Nls = National Language Support **}
  70. {** Nt = Generic Native APIs **}
  71. {** Ob = Object manager functions **}
  72. {** Pfx = Name prefix support functions (???) **}
  73. {** Po = Power management support functions **}
  74. {** Ps = Process management support functions **}
  75. {** Rtl = Runtime library functions **}
  76. {** Rtlp = Private runtime library functions 1) **}
  77. {** Se = Security support functions **}
  78. {** Wmi = Windows management instrumentation support functions **}
  79. {** Vf = Driver Verifier **}
  80. {** Zw = Nt* counterparts. Zw == "Zero Warranty"??? **}
  81. {** 1) "p" after the prefix means "private" **}
  82. {** **}
  83. {** The Native API is split into a user mode component (mainly NTDLL.DLL) **}
  84. {** and a kernel mode component (mainly NTOSKRNL.EXE). While a large part of **}
  85. {** the Native API is available both from usermode and kernelmode, some **}
  86. {** functions are exclusive to either mode. This unit only deals with **}
  87. {** functions that are available to usermode code. **}
  88. {** **}
  89. {** Note that the functions prefixed with "Nt" and "Zw" usually appear in **}
  90. {** pairs, though not always! For details see http://native.assarbad.net **}
  91. {** **}
  92. {** Most of the Native API is undocumented. However, Microsoft recently **}
  93. {** started to document a subset of the API in "winternl.h" in the Platform **}
  94. {** SDK. A small part of the Native API functions, specifically those useful **}
  95. {** for kernel mode development (device drivers) are documented in the DDK. **}
  96. {** **}
  97. {******************************************************************************}
  98. {** Special notes **}
  99. {******************************************************************************}
  100. {** **}
  101. {** Some functions herein have been implemented instead of being imported. **}
  102. {** That's due to the fact, that the FASTCALL calling convention is not **}
  103. {** available in Delphi. These functions include: **}
  104. {** - RtlUshortByteSwap() **}
  105. {** - RtlUlongByteSwap() **}
  106. {** - RtlUlonglongByteSwap() **}
  107. {** **}
  108. {** Other functions are implemented and also imported, but have been made **}
  109. {** available for OS versions not actually supporting them. These are: **}
  110. {** - RtlGetLastWin32Error() **}
  111. {** - RtlSetLastWin32Error() **}
  112. {** **}
  113. {** Starting with Windows XP, the Kernel32!GetLastError() and counterpart **}
  114. {** Kernel32!SetLastError() have been moved into NTDLL and are only function **}
  115. {** forwarders to the NTDLL functions with the names above. **}
  116. {** By importing them directly from Kernel32.dll via their old names we **}
  117. {** enable you to use these functions transparently without regard to the OS **}
  118. {** version. **}
  119. {** **}
  120. {** RtlCopyMemory() had to be implemented via Delphi means because it's only **}
  121. {** a macro (pointing to memcpy) in the C-world. **}
  122. {** **}
  123. {** Last but not least we've implemented our own versions of some of the **}
  124. {** functions available through NTDLL [declared private Ntp*, Rtlp*]: **}
  125. {** - NtpGetProcessHeap() **}
  126. {** - NtpCurrentTeb() **}
  127. {** - RtlpGetCurrentPeb() **}
  128. {** **}
  129. {** Plus a function that is available starting from Windows XP, but could be **}
  130. {** useful on earlier versions as well [declared private Rtlp*]: **}
  131. {** - RtlpValidateUnicodeString() **}
  132. {** **}
  133. {** And our own flavor of it, omitting the first (currently unused) **}
  134. {** parameter: **}
  135. {** - RtlpValidateUnicodeString2() **}
  136. {** **}
  137. {******************************************************************************}
  138. {** References, Tools, Docs **}
  139. {******************************************************************************}
  140. {** **}
  141. {** - Windows NT/2000 Native API References (Gary Nebbett) **}
  142. {** ISBN 1-57870-199-6 **}
  143. {** - Undocumented Windows 2000 Secrets (Sven B. Schreiber) **}
  144. {** ISBN 0-201-72187-2 **}
  145. {** - Undocumented Windows NT (Prasad Dabak, Sandeep Phadke, Milind Borate) **}
  146. {** ISBN 0-7645-4569-8 **}
  147. {** - Platform SDK for Windows 2003 Server (or later version) **}
  148. {** http://www.microsoft.com/msdownload/platformsdk/sdkupdate/ **}
  149. {** - Windows 2003 DDK (or similar DDK version **}
  150. {** http://www.microsoft.com/whdc/ddk/ **}
  151. {** - WinDbg - a debugger that is usually badly underestimated! **}
  152. {** http://www.microsoft.com/whdc/devtools/debugging **}
  153. {** - IDA Pro Standard 4.7 (or later) - world's best disassembler **}
  154. {** http://www.datarescue.com/idabase/ **}
  155. {** - NTDEV, NTFSD, WINDBG mailing lists and more ... **}
  156. {** http://www.osronline.com/ **}
  157. {** - Sysinternals tools and documentation of some "Windows secrets" **}
  158. {** http://www.sysinternals.com/ **}
  159. {** - A nicely done online compilation of NT Native APIs **}
  160. {** http://undocumented.ntinternals.net/ **}
  161. {** - ReactOS (to cross-check own assumptions with those of other smart guys)**}
  162. {** http://www.reactos.com/ **}
  163. {** **}
  164. {******************************************************************************}
  165. {$IFNDEF JWA_OMIT_SECTIONS}
  166. unit JwaNative;
  167. interface
  168. {$INCLUDE jediapilib.inc}
  169. uses
  170. JwaWinType, JwaWinNT, JwaWinBase, JwaNtStatus;
  171. {$WEAKPACKAGEUNIT}
  172. // For native APIs we consider RTDL the better method of importing
  173. {.$DEFINE RTDL}
  174. {$IFDEF RTDL}{$DEFINE DYNAMIC_LINK}{$ENDIF}
  175. const
  176. ntdll = 'ntdll.dll';
  177. //------------------------------------------------------------------------------
  178. {$ENDIF JWA_OMIT_SECTIONS}
  179. {$IFNDEF JWA_IMPLEMENTATIONSECTION}
  180. type
  181. _CLIENT_ID = record
  182. UniqueProcess: HANDLE;
  183. UniqueThread: HANDLE;
  184. end;
  185. CLIENT_ID = _CLIENT_ID;
  186. PCLIENT_ID = ^CLIENT_ID;
  187. TClientID = CLIENT_ID;
  188. PClientID = ^TClientID;
  189. KPRIORITY = LONG;
  190. _KWAIT_REASON = (
  191. Executive,
  192. FreePage,
  193. PageIn,
  194. PoolAllocation,
  195. DelayExecution,
  196. Suspended,
  197. UserRequest,
  198. WrExecutive,
  199. WrFreePage,
  200. WrPageIn,
  201. WrPoolAllocation,
  202. WrDelayExecution,
  203. WrSuspended,
  204. WrUserRequest,
  205. WrEventPair,
  206. WrQueue,
  207. WrLpcReceive,
  208. WrLpcReply,
  209. WrVirtualMemory,
  210. WrPageOut,
  211. WrRendezvous,
  212. Spare2,
  213. Spare3,
  214. Spare4,
  215. Spare5,
  216. Spare6,
  217. WrKernel,
  218. MaximumWaitReason);
  219. KWAIT_REASON = _KWAIT_REASON;
  220. TKWaitReason = KWAIT_REASON;
  221. _VM_COUNTERS = record
  222. PeakVirtualSize: SIZE_T;
  223. VirtualSize: SIZE_T;
  224. PageFaultCount: ULONG;
  225. PeakWorkingSetSize: SIZE_T;
  226. WorkingSetSize: SIZE_T;
  227. QuotaPeakPagedPoolUsage: SIZE_T;
  228. QuotaPagedPoolUsage: SIZE_T;
  229. QuotaPeakNonPagedPoolUsage: SIZE_T;
  230. QuotaNonPagedPoolUsage: SIZE_T;
  231. PagefileUsage: SIZE_T;
  232. PeakPagefileUsage: SIZE_T;
  233. end;
  234. VM_COUNTERS = _VM_COUNTERS;
  235. PVM_COUNTERS = ^VM_COUNTERS;
  236. TVmCounters = VM_COUNTERS;
  237. PVmCounters = ^TVmCounters;
  238. const
  239. NonPagedPool = 0;
  240. PagedPool = 1;
  241. NonPagedPoolMustSucceed = 2;
  242. DontUseThisType = 3;
  243. NonPagedPoolCacheAligned = 4;
  244. PagedPoolCacheAligned = 5;
  245. NonPagedPoolCacheAlignedMustS = 6;
  246. MaxPoolType = 7;
  247. NonPagedPoolSession = 32;
  248. PagedPoolSession = NonPagedPoolSession + 1;
  249. NonPagedPoolMustSucceedSession = PagedPoolSession + 1;
  250. DontUseThisTypeSession = NonPagedPoolMustSucceedSession + 1;
  251. NonPagedPoolCacheAlignedSession = DontUseThisTypeSession + 1;
  252. PagedPoolCacheAlignedSession = NonPagedPoolCacheAlignedSession + 1;
  253. NonPagedPoolCacheAlignedMustSSession = PagedPoolCacheAlignedSession + 1;
  254. type
  255. POOL_TYPE = NonPagedPool..NonPagedPoolCacheAlignedMustSSession;
  256. _IO_STATUS_BLOCK = record
  257. //union {
  258. Status: NTSTATUS;
  259. // PVOID Pointer;
  260. //}
  261. Information: ULONG_PTR;
  262. end;
  263. IO_STATUS_BLOCK = _IO_STATUS_BLOCK;
  264. PIO_STATUS_BLOCK = ^IO_STATUS_BLOCK;
  265. TIoStatusBlock = IO_STATUS_BLOCK;
  266. PIoStatusBlock = ^TIoStatusBlock;
  267. const
  268. ViewShare = 1;
  269. ViewUnmap = 2;
  270. type
  271. SECTION_INHERIT = ViewShare..ViewUnmap;
  272. {.$IFNDEF JWA_INCLUDEMODE}
  273. _THREADINFOCLASS = (
  274. ThreadBasicInformation,
  275. ThreadTimes,
  276. ThreadPriority,
  277. ThreadBasePriority,
  278. ThreadAffinityMask,
  279. ThreadImpersonationToken,
  280. ThreadDescriptorTableEntry,
  281. ThreadEnableAlignmentFaultFixup,
  282. ThreadEventPair_Reusable,
  283. ThreadQuerySetWin32StartAddress,
  284. ThreadZeroTlsCell,
  285. ThreadPerformanceCount,
  286. ThreadAmILastThread,
  287. ThreadIdealProcessor,
  288. ThreadPriorityBoost,
  289. ThreadSetTlsArrayAddress,
  290. ThreadIsIoPending,
  291. ThreadHideFromDebugger,
  292. ThreadBreakOnTermination, // was added in XP - used by RtlSetThreadIsCritical()
  293. MaxThreadInfoClass);
  294. THREADINFOCLASS = _THREADINFOCLASS;
  295. {.$ENDIF JWA_INCLUDEMODE}
  296. THREAD_INFORMATION_CLASS = THREADINFOCLASS;
  297. TThreadInfoClass = THREADINFOCLASS;
  298. {$IFNDEF JWA_INCLUDEMODE}
  299. KAFFINITY = ULONG;
  300. PKAFFINITY = ^KAFFINITY;
  301. {$ENDIF JWA_INCLUDEMODE}
  302. PKNORMAL_ROUTINE = procedure(NormalContext, SystemArgument1, SystemArgument2: PVOID); stdcall;
  303. _PROCESSINFOCLASS = (
  304. ProcessBasicInformation,
  305. ProcessQuotaLimits,
  306. ProcessIoCounters,
  307. ProcessVmCounters,
  308. ProcessTimes,
  309. ProcessBasePriority,
  310. ProcessRaisePriority,
  311. ProcessDebugPort,
  312. ProcessExceptionPort,
  313. ProcessAccessToken,
  314. ProcessLdtInformation,
  315. ProcessLdtSize,
  316. ProcessDefaultHardErrorMode,
  317. ProcessIoPortHandlers, // Note: this is kernel mode only
  318. ProcessPooledUsageAndLimits,
  319. ProcessWorkingSetWatch,
  320. ProcessUserModeIOPL,
  321. ProcessEnableAlignmentFaultFixup,
  322. ProcessPriorityClass,
  323. ProcessWx86Information,
  324. ProcessHandleCount,
  325. ProcessAffinityMask,
  326. ProcessPriorityBoost,
  327. ProcessDeviceMap,
  328. ProcessSessionInformation,
  329. ProcessForegroundInformation,
  330. ProcessWow64Information, // = 26
  331. ProcessImageFileName, // added after W2K
  332. ProcessLUIDDeviceMapsEnabled,
  333. ProcessBreakOnTermination, // used by RtlSetProcessIsCritical()
  334. ProcessDebugObjectHandle,
  335. ProcessDebugFlags,
  336. ProcessHandleTracing,
  337. MaxProcessInfoClass);
  338. PROCESSINFOCLASS = _PROCESSINFOCLASS;
  339. PROCESS_INFORMATION_CLASS = PROCESSINFOCLASS;
  340. TProcessInfoClass = PROCESSINFOCLASS;
  341. _KPROFILE_SOURCE = (
  342. ProfileTime,
  343. ProfileAlignmentFixup,
  344. ProfileTotalIssues,
  345. ProfilePipelineDry,
  346. ProfileLoadInstructions,
  347. ProfilePipelineFrozen,
  348. ProfileBranchInstructions,
  349. ProfileTotalNonissues,
  350. ProfileDcacheMisses,
  351. ProfileIcacheMisses,
  352. ProfileCacheMisses,
  353. ProfileBranchMispredictions,
  354. ProfileStoreInstructions,
  355. ProfileFpInstructions,
  356. ProfileIntegerInstructions,
  357. Profile2Issue,
  358. Profile3Issue,
  359. Profile4Issue,
  360. ProfileSpecialInstructions,
  361. ProfileTotalCycles,
  362. ProfileIcacheIssues,
  363. ProfileDcacheAccesses,
  364. ProfileMemoryBarrierCycles,
  365. ProfileLoadLinkedIssues,
  366. ProfileMaximum);
  367. KPROFILE_SOURCE = _KPROFILE_SOURCE;
  368. TKProfileSource = KPROFILE_SOURCE;
  369. PIO_APC_ROUTINE = procedure(ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; Reserved: ULONG); stdcall;
  370. _FILE_FULL_EA_INFORMATION = record
  371. NextEntryOffset: ULONG;
  372. Flags: UCHAR;
  373. EaNameLength: UCHAR;
  374. EaValueLength: USHORT;
  375. EaName: array[0..0] of CHAR;
  376. end;
  377. FILE_FULL_EA_INFORMATION = _FILE_FULL_EA_INFORMATION;
  378. PFILE_FULL_EA_INFORMATION = ^FILE_FULL_EA_INFORMATION;
  379. TFileFullEaInformation = FILE_FULL_EA_INFORMATION;
  380. PFileFullEaInformation = ^TFileFullEaInformation;
  381. _FSINFOCLASS = (
  382. FileFsFiller0,
  383. FileFsVolumeInformation, // 1
  384. FileFsLabelInformation, // 2
  385. FileFsSizeInformation, // 3
  386. FileFsDeviceInformation, // 4
  387. FileFsAttributeInformation, // 5
  388. FileFsControlInformation, // 6
  389. FileFsFullSizeInformation, // 7
  390. FileFsObjectIdInformation, // 8
  391. FileFsMaximumInformation);
  392. FS_INFORMATION_CLASS = _FSINFOCLASS;
  393. PFS_INFORMATION_CLASS = ^FS_INFORMATION_CLASS;
  394. TFsInformationClass = FS_INFORMATION_CLASS;
  395. PFsInformationClass = ^TFsInformationClass;
  396. {$IFNDEF JWA_INCLUDEMODE} //defined in jwaWindows.pas
  397. UUID = GUID;
  398. {$ENDIF JWA_INCLUDEMODE}
  399. _FILE_BASIC_INFORMATION = record
  400. CreationTime: LARGE_INTEGER;
  401. LastAccessTime: LARGE_INTEGER;
  402. LastWriteTime: LARGE_INTEGER;
  403. ChangeTime: LARGE_INTEGER;
  404. FileAttributes: ULONG;
  405. end;
  406. FILE_BASIC_INFORMATION = _FILE_BASIC_INFORMATION;
  407. PFILE_BASIC_INFORMATION = ^FILE_BASIC_INFORMATION;
  408. TFileBasicInformation = FILE_BASIC_INFORMATION;
  409. PFileBasicInformation = ^TFileBasicInformation;
  410. _FILE_NETWORK_OPEN_INFORMATION = record
  411. CreationTime: LARGE_INTEGER;
  412. LastAccessTime: LARGE_INTEGER;
  413. LastWriteTime: LARGE_INTEGER;
  414. ChangeTime: LARGE_INTEGER;
  415. AllocationSize: LARGE_INTEGER;
  416. EndOfFile: LARGE_INTEGER;
  417. FileAttributes: ULONG;
  418. end;
  419. FILE_NETWORK_OPEN_INFORMATION = _FILE_NETWORK_OPEN_INFORMATION;
  420. PFILE_NETWORK_OPEN_INFORMATION = ^FILE_NETWORK_OPEN_INFORMATION;
  421. TFileNetworkOpenInformation = FILE_NETWORK_OPEN_INFORMATION;
  422. PFileNetworkOpenInformation = ^TFileNetworkOpenInformation;
  423. _FILE_INFORMATION_CLASS = (
  424. FileFiller0,
  425. FileDirectoryInformation, // 1
  426. FileFullDirectoryInformation, // 2
  427. FileBothDirectoryInformation, // 3
  428. FileBasicInformation, // 4 wdm
  429. FileStandardInformation, // 5 wdm
  430. FileInternalInformation, // 6
  431. FileEaInformation, // 7
  432. FileAccessInformation, // 8
  433. FileNameInformation, // 9
  434. FileRenameInformation, // 10
  435. FileLinkInformation, // 11
  436. FileNamesInformation, // 12
  437. FileDispositionInformation, // 13
  438. FilePositionInformation, // 14 wdm
  439. FileFullEaInformation, // 15
  440. FileModeInformation, // 16
  441. FileAlignmentInformation, // 17
  442. FileAllInformation, // 18
  443. FileAllocationInformation, // 19
  444. FileEndOfFileInformation, // 20 wdm
  445. FileAlternateNameInformation, // 21
  446. FileStreamInformation, // 22
  447. FilePipeInformation, // 23
  448. FilePipeLocalInformation, // 24
  449. FilePipeRemoteInformation, // 25
  450. FileMailslotQueryInformation, // 26
  451. FileMailslotSetInformation, // 27
  452. FileCompressionInformation, // 28
  453. FileObjectIdInformation, // 29
  454. FileCompletionInformation, // 30
  455. FileMoveClusterInformation, // 31
  456. FileQuotaInformation, // 32
  457. FileReparsePointInformation, // 33
  458. FileNetworkOpenInformation, // 34
  459. FileAttributeTagInformation, // 35
  460. FileTrackingInformation, // 36
  461. FileMaximumInformation);
  462. FILE_INFORMATION_CLASS = _FILE_INFORMATION_CLASS;
  463. PFILE_INFORMATION_CLASS = ^FILE_INFORMATION_CLASS;
  464. TFileInformationClass = FILE_INFORMATION_CLASS;
  465. PFileInformationClass = ^TFileInformationClass;
  466. _FILE_STANDARD_INFORMATION = record
  467. AllocationSize: LARGE_INTEGER;
  468. EndOfFile: LARGE_INTEGER;
  469. NumberOfLinks: ULONG;
  470. DeletePending: ByteBool;
  471. Directory: ByteBool;
  472. end;
  473. FILE_STANDARD_INFORMATION = _FILE_STANDARD_INFORMATION;
  474. PFILE_STANDARD_INFORMATION = ^FILE_STANDARD_INFORMATION;
  475. TFileStandardInformation = FILE_STANDARD_INFORMATION;
  476. PFileStandardInformation = ^TFileStandardInformation;
  477. _FILE_POSITION_INFORMATION = record
  478. CurrentByteOffset: LARGE_INTEGER;
  479. end;
  480. FILE_POSITION_INFORMATION = _FILE_POSITION_INFORMATION;
  481. PFILE_POSITION_INFORMATION = ^FILE_POSITION_INFORMATION;
  482. TFilePositionInformation = FILE_POSITION_INFORMATION;
  483. PFilePositionInformation = ^TFilePositionInformation;
  484. _FILE_ALIGNMENT_INFORMATION = record
  485. AlignmentRequirement: ULONG;
  486. end;
  487. FILE_ALIGNMENT_INFORMATION = _FILE_ALIGNMENT_INFORMATION;
  488. PFILE_ALIGNMENT_INFORMATION = ^FILE_ALIGNMENT_INFORMATION;
  489. TFileAlignmentInformation = FILE_ALIGNMENT_INFORMATION;
  490. PFileAlignmentInformation = ^TFileAlignmentInformation;
  491. _KEY_SET_INFORMATION_CLASS = (KeyWriteTimeInformation);
  492. KEY_SET_INFORMATION_CLASS = _KEY_SET_INFORMATION_CLASS;
  493. _KEY_INFORMATION_CLASS = (
  494. KeyBasicInformation,
  495. KeyNodeInformation,
  496. KeyFullInformation,
  497. KeyNameInformation);
  498. KEY_INFORMATION_CLASS = _KEY_INFORMATION_CLASS;
  499. TKeyInformationClass = KEY_INFORMATION_CLASS;
  500. _KEY_VALUE_INFORMATION_CLASS = (
  501. KeyValueBasicInformation,
  502. KeyValueFullInformation,
  503. KeyValuePartialInformation,
  504. KeyValueFullInformationAlign64,
  505. KeyValuePartialInformationAlign64);
  506. KEY_VALUE_INFORMATION_CLASS = _KEY_VALUE_INFORMATION_CLASS;
  507. TKeyValueInformationClass = KEY_VALUE_INFORMATION_CLASS;
  508. _KEY_VALUE_ENTRY = record
  509. ValueName: PUNICODE_STRING;
  510. DataLength: ULONG;
  511. DataOffset: ULONG;
  512. Type_: ULONG;
  513. end;
  514. KEY_VALUE_ENTRY = _KEY_VALUE_ENTRY;
  515. PKEY_VALUE_ENTRY = ^KEY_VALUE_ENTRY;
  516. TKeyValueEntry = KEY_VALUE_ENTRY;
  517. PKeyValueEntry = ^TKeyValueEntry;
  518. {$IFNDEF JWA_INCLUDEMODE}
  519. _DEVICE_POWER_STATE = (
  520. PowerDeviceUnspecified,
  521. PowerDeviceD0,
  522. PowerDeviceD1,
  523. PowerDeviceD2,
  524. PowerDeviceD3,
  525. PowerDeviceMaximum);
  526. DEVICE_POWER_STATE = _DEVICE_POWER_STATE;
  527. PDEVICE_POWER_STATE = ^DEVICE_POWER_STATE;
  528. TDevicePowerState = DEVICE_POWER_STATE;
  529. POWER_ACTION = (
  530. PowerActionNone,
  531. PowerActionReserved,
  532. PowerActionSleep,
  533. PowerActionHibernate,
  534. PowerActionShutdown,
  535. PowerActionShutdownReset,
  536. PowerActionShutdownOff,
  537. PowerActionWarmEject);
  538. PPOWER_ACTION = ^POWER_ACTION;
  539. TPowerAction = POWER_ACTION;
  540. _SYSTEM_POWER_STATE = (
  541. PowerSystemUnspecified,
  542. PowerSystemWorking,
  543. PowerSystemSleeping1,
  544. PowerSystemSleeping2,
  545. PowerSystemSleeping3,
  546. PowerSystemHibernate,
  547. PowerSystemShutdown,
  548. PowerSystemMaximum);
  549. SYSTEM_POWER_STATE = _SYSTEM_POWER_STATE;
  550. PSYSTEM_POWER_STATE = ^SYSTEM_POWER_STATE;
  551. TSystemPowerState = SYSTEM_POWER_STATE;
  552. POWER_INFORMATION_LEVEL = (
  553. SystemPowerPolicyAc,
  554. SystemPowerPolicyDc,
  555. VerifySystemPolicyAc,
  556. VerifySystemPolicyDc,
  557. SystemPowerCapabilities,
  558. SystemBatteryState,
  559. SystemPowerStateHandler,
  560. ProcessorStateHandler,
  561. SystemPowerPolicyCurrent,
  562. AdministratorPowerPolicy,
  563. SystemReserveHiberFile,
  564. ProcessorInformation,
  565. SystemPowerInformation);
  566. TPowerInformationLevel = POWER_INFORMATION_LEVEL;
  567. {$ENDIF JWA_INCLUDEMODE}
  568. _RTL_RANGE = record
  569. // The start of the range
  570. Start: ULONGLONG; // Read only
  571. // The end of the range
  572. End_: ULONGLONG; // Read only
  573. // Data the user passed in when they created the range
  574. UserData: PVOID; // Read/Write
  575. // The owner of the range
  576. Owner: PVOID; // Read/Write
  577. // User defined flags the user specified when they created the range
  578. Attributes: UCHAR; // Read/Write
  579. // Flags (RTL_RANGE_*)
  580. Flags: UCHAR; // Read only
  581. end;
  582. RTL_RANGE = _RTL_RANGE;
  583. PRTL_RANGE = ^RTL_RANGE;
  584. TRtlRange = RTL_RANGE;
  585. PRtlRange = ^TRtlRange;
  586. const
  587. RTL_RANGE_SHARED = $01;
  588. RTL_RANGE_CONFLICT = $02;
  589. type
  590. _RTL_RANGE_LIST = record
  591. // The list of ranges
  592. ListHead: LIST_ENTRY;
  593. // These always come in useful
  594. Flags: ULONG; // use RANGE_LIST_FLAG_*
  595. // The number of entries in the list
  596. Count: ULONG;
  597. // Every time an add/delete operation is performed on the list this is
  598. // incremented. It is checked during iteration to ensure that the list
  599. // hasn't changed between GetFirst/GetNext or GetNext/GetNext calls
  600. Stamp: ULONG;
  601. end;
  602. RTL_RANGE_LIST = _RTL_RANGE_LIST;
  603. PRTL_RANGE_LIST = ^RTL_RANGE_LIST;
  604. TRtlRangeList = RTL_RANGE_LIST;
  605. PRtlRangeList = ^TRtlRangeList;
  606. _RANGE_LIST_ITERATOR = record
  607. RangeListHead: PLIST_ENTRY;
  608. MergedHead: PLIST_ENTRY;
  609. Current: PVOID;
  610. Stamp: ULONG;
  611. end;
  612. RTL_RANGE_LIST_ITERATOR = _RANGE_LIST_ITERATOR;
  613. PRTL_RANGE_LIST_ITERATOR = ^RTL_RANGE_LIST_ITERATOR;
  614. TRtlRangeListIterator = RTL_RANGE_LIST_ITERATOR;
  615. PRtlRangeListIterator = ^TRtlRangeListIterator;
  616. // End of NTDDK.H
  617. //==============================================================================
  618. // NT System Services
  619. //==============================================================================
  620. type
  621. _SYSTEM_INFORMATION_CLASS = (
  622. SystemBasicInformation,
  623. SystemProcessorInformation,
  624. SystemPerformanceInformation,
  625. SystemTimeOfDayInformation,
  626. SystemNotImplemented1,
  627. SystemProcessesAndThreadsInformation,
  628. SystemCallCounts,
  629. SystemConfigurationInformation,
  630. SystemProcessorTimes,
  631. SystemGlobalFlag,
  632. SystemNotImplemented2,
  633. SystemModuleInformation,
  634. SystemLockInformation,
  635. SystemNotImplemented3,
  636. SystemNotImplemented4,
  637. SystemNotImplemented5,
  638. SystemHandleInformation,
  639. SystemObjectInformation,
  640. SystemPagefileInformation,
  641. SystemInstructionEmulationCounts,
  642. SystemInvalidInfoClass1,
  643. SystemCacheInformation,
  644. SystemPoolTagInformation,
  645. SystemProcessorStatistics,
  646. SystemDpcInformation,
  647. SystemNotImplemented6,
  648. SystemLoadImage,
  649. SystemUnloadImage,
  650. SystemTimeAdjustment,
  651. SystemNotImplemented7,
  652. SystemNotImplemented8,
  653. SystemNotImplemented9,
  654. SystemCrashDumpInformation,
  655. SystemExceptionInformation,
  656. SystemCrashDumpStateInformation,
  657. SystemKernelDebuggerInformation,
  658. SystemContextSwitchInformation,
  659. SystemRegistryQuotaInformation,
  660. SystemLoadAndCallImage,
  661. SystemPrioritySeparation,
  662. SystemNotImplemented10,
  663. SystemNotImplemented11,
  664. SystemInvalidInfoClass2,
  665. SystemInvalidInfoClass3,
  666. SystemTimeZoneInformation,
  667. SystemLookasideInformation,
  668. SystemSetTimeSlipEvent,
  669. SystemCreateSession,
  670. SystemDeleteSession,
  671. SystemInvalidInfoClass4,
  672. SystemRangeStartInformation,
  673. SystemVerifierInformation,
  674. SystemAddVerifier,
  675. SystemSessionProcessesInformation);
  676. SYSTEM_INFORMATION_CLASS = _SYSTEM_INFORMATION_CLASS;
  677. TSystemInformationClass = SYSTEM_INFORMATION_CLASS;
  678. type
  679. {$IFNDEF JWA_INCLUDEMODE}
  680. _SYSTEM_BASIC_INFORMATION = record // Information Class 0
  681. Unknown: ULONG;
  682. MaximumIncrement: ULONG;
  683. PhysicalPageSize: ULONG;
  684. NumberOfPhysicalPages: ULONG;
  685. LowestPhysicalPage: ULONG;
  686. HighestPhysicalPage: ULONG;
  687. AllocationGranularity: ULONG;
  688. LowestUserAddress: ULONG;
  689. HighestUserAddress: ULONG;
  690. ActiveProcessors: ULONG;
  691. NumberProcessors: UCHAR;
  692. end;
  693. SYSTEM_BASIC_INFORMATION = _SYSTEM_BASIC_INFORMATION;
  694. PSYSTEM_BASIC_INFORMATION = ^SYSTEM_BASIC_INFORMATION;
  695. TSystemBasicInformation = SYSTEM_BASIC_INFORMATION;
  696. PSystemBasicInformation = ^TSystemBasicInformation;
  697. {$ENDIF JWA_INCLUDEMODE}
  698. _SYSTEM_PROCESSOR_INFORMATION = record // Information Class 1
  699. ProcessorArchitecture: USHORT;
  700. ProcessorLevel: USHORT;
  701. ProcessorRevision: USHORT;
  702. Unknown: USHORT;
  703. FeatureBits: ULONG;
  704. end;
  705. SYSTEM_PROCESSOR_INFORMATION = _SYSTEM_PROCESSOR_INFORMATION;
  706. PSYSTEM_PROCESSOR_INFORMATION = ^SYSTEM_PROCESSOR_INFORMATION;
  707. {$IFNDEF JWA_INCLUDEMODE}
  708. TSystemProcessorInformation = SYSTEM_PROCESSOR_INFORMATION;
  709. PSystemProcessorInformation = ^TSystemProcessorInformation;
  710. _SYSTEM_PERFORMANCE_INFORMATION = record // Information Class 2
  711. IdleTime: LARGE_INTEGER;
  712. ReadTransferCount: LARGE_INTEGER;
  713. WriteTransferCount: LARGE_INTEGER;
  714. OtherTransferCount: LARGE_INTEGER;
  715. ReadOperationCount: ULONG;
  716. WriteOperationCount: ULONG;
  717. OtherOperationCount: ULONG;
  718. AvailablePages: ULONG;
  719. TotalCommittedPages: ULONG;
  720. TotalCommitLimit: ULONG;
  721. PeakCommitment: ULONG;
  722. PageFaults: ULONG;
  723. WriteCopyFaults: ULONG;
  724. TransistionFaults: ULONG;
  725. Reserved1: ULONG;
  726. DemandZeroFaults: ULONG;
  727. PagesRead: ULONG;
  728. PageReadIos: ULONG;
  729. Reserved2: array[0..1] of ULONG;
  730. PagefilePagesWritten: ULONG;
  731. PagefilePageWriteIos: ULONG;
  732. MappedFilePagesWritten: ULONG;
  733. MappedFilePageWriteIos: ULONG;
  734. PagedPoolUsage: ULONG;
  735. NonPagedPoolUsage: ULONG;
  736. PagedPoolAllocs: ULONG;
  737. PagedPoolFrees: ULONG;
  738. NonPagedPoolAllocs: ULONG;
  739. NonPagedPoolFrees: ULONG;
  740. TotalFreeSystemPtes: ULONG;
  741. SystemCodePage: ULONG;
  742. TotalSystemDriverPages: ULONG;
  743. TotalSystemCodePages: ULONG;
  744. SmallNonPagedLookasideListAllocateHits: ULONG;
  745. SmallPagedLookasideListAllocateHits: ULONG;
  746. Reserved3: ULONG;
  747. MmSystemCachePage: ULONG;
  748. PagedPoolPage: ULONG;
  749. SystemDriverPage: ULONG;
  750. FastReadNoWait: ULONG;
  751. FastReadWait: ULONG;
  752. FastReadResourceMiss: ULONG;
  753. FastReadNotPossible: ULONG;
  754. FastMdlReadNoWait: ULONG;
  755. FastMdlReadWait: ULONG;
  756. FastMdlReadResourceMiss: ULONG;
  757. FastMdlReadNotPossible: ULONG;
  758. MapDataNoWait: ULONG;
  759. MapDataWait: ULONG;
  760. MapDataNoWaitMiss: ULONG;
  761. MapDataWaitMiss: ULONG;
  762. PinMappedDataCount: ULONG;
  763. PinReadNoWait: ULONG;
  764. PinReadWait: ULONG;
  765. PinReadNoWaitMiss: ULONG;
  766. PinReadWaitMiss: ULONG;
  767. CopyReadNoWait: ULONG;
  768. CopyReadWait: ULONG;
  769. CopyReadNoWaitMiss: ULONG;
  770. CopyReadWaitMiss: ULONG;
  771. MdlReadNoWait: ULONG;
  772. MdlReadWait: ULONG;
  773. MdlReadNoWaitMiss: ULONG;
  774. MdlReadWaitMiss: ULONG;
  775. ReadAheadIos: ULONG;
  776. LazyWriteIos: ULONG;
  777. LazyWritePages: ULONG;
  778. DataFlushes: ULONG;
  779. DataPages: ULONG;
  780. ContextSwitches: ULONG;
  781. FirstLevelTbFills: ULONG;
  782. SecondLevelTbFills: ULONG;
  783. SystemCalls: ULONG;
  784. end;
  785. SYSTEM_PERFORMANCE_INFORMATION = _SYSTEM_PERFORMANCE_INFORMATION;
  786. PSYSTEM_PERFORMANCE_INFORMATION = ^SYSTEM_PERFORMANCE_INFORMATION;
  787. TSystemPerformanceInformation = SYSTEM_PERFORMANCE_INFORMATION;
  788. PSystemPerformanceInformation = ^TSystemPerformanceInformation;
  789. {$ENDIF JWA_INCLUDEMODE}
  790. _SYSTEM_TIME_OF_DAY_INFORMATION = record // Information Class 3
  791. BootTime: LARGE_INTEGER;
  792. CurrentTime: LARGE_INTEGER;
  793. TimeZoneBias: LARGE_INTEGER;
  794. CurrentTimeZoneId: ULONG;
  795. end;
  796. SYSTEM_TIME_OF_DAY_INFORMATION = _SYSTEM_TIME_OF_DAY_INFORMATION;
  797. PSYSTEM_TIME_OF_DAY_INFORMATION = ^SYSTEM_TIME_OF_DAY_INFORMATION;
  798. {$IFNDEF JWA_INCLUDEMODE}
  799. TSystemTimeOfDayInformation = SYSTEM_TIME_OF_DAY_INFORMATION;
  800. PSystemTimeOfDayInformation = ^TSystemTimeOfDayInformation;
  801. {$ENDIF JWA_INCLUDEMODE}
  802. _IO_COUNTERSEX = record
  803. ReadOperationCount: LARGE_INTEGER;
  804. WriteOperationCount: LARGE_INTEGER;
  805. OtherOperationCount: LARGE_INTEGER;
  806. ReadTransferCount: LARGE_INTEGER;
  807. WriteTransferCount: LARGE_INTEGER;
  808. OtherTransferCount: LARGE_INTEGER;
  809. end;
  810. IO_COUNTERSEX = _IO_COUNTERSEX;
  811. PIO_COUNTERSEX = ^IO_COUNTERSEX;
  812. TIoCountersEx = IO_COUNTERSEX;
  813. PIoCountersEx = ^TIoCountersEx;
  814. THREAD_STATE = (
  815. StateInitialized,
  816. StateReady,
  817. StateRunning,
  818. StateStandby,
  819. StateTerminated,
  820. StateWait,
  821. StateTransition,
  822. StateUnknown);
  823. TThreadState = THREAD_STATE;
  824. _SYSTEM_THREADS = record
  825. KernelTime: LARGE_INTEGER;
  826. UserTime: LARGE_INTEGER;
  827. CreateTime: LARGE_INTEGER;
  828. WaitTime: ULONG;
  829. StartAddress: PVOID;
  830. ClientId: CLIENT_ID;
  831. Priority: KPRIORITY;
  832. BasePriority: KPRIORITY;
  833. ContextSwitchCount: ULONG;
  834. State: THREAD_STATE;
  835. WaitReason: KWAIT_REASON;
  836. end;
  837. SYSTEM_THREADS = _SYSTEM_THREADS;
  838. PSYSTEM_THREADS = ^SYSTEM_THREADS;
  839. TSystemThreads = SYSTEM_THREADS;
  840. PSystemThreads = PSYSTEM_THREADS;
  841. _SYSTEM_PROCESSES = record // Information Class 5
  842. NextEntryDelta: ULONG;
  843. ThreadCount: ULONG;
  844. Reserved1: array[0..5] of ULONG;
  845. CreateTime: LARGE_INTEGER;
  846. UserTime: LARGE_INTEGER;
  847. KernelTime: LARGE_INTEGER;
  848. ProcessName: UNICODE_STRING;
  849. BasePriority: KPRIORITY;
  850. ProcessId: ULONG;
  851. InheritedFromProcessId: ULONG;
  852. HandleCount: ULONG;
  853. // next two were Reserved2: array [0..1] of ULONG; thanks to Nico Bendlin
  854. SessionId: ULONG;
  855. Reserved2: ULONG;
  856. VmCounters: VM_COUNTERS;
  857. PrivatePageCount: ULONG;
  858. IoCounters: IO_COUNTERSEX; // Windows 2000 only
  859. Threads: array[0..0] of SYSTEM_THREADS;
  860. end;
  861. SYSTEM_PROCESSES = _SYSTEM_PROCESSES;
  862. PSYSTEM_PROCESSES = ^SYSTEM_PROCESSES;
  863. TSystemProcesses = SYSTEM_PROCESSES;
  864. PSystemProcesses = PSYSTEM_PROCESSES;
  865. _SYSTEM_CALLS_INFORMATION = record // Information Class 6
  866. Size: ULONG;
  867. NumberOfDescriptorTables: ULONG;
  868. NumberOfRoutinesInTable: array[0..0] of ULONG;
  869. // ULONG CallCounts[];
  870. end;
  871. SYSTEM_CALLS_INFORMATION = _SYSTEM_CALLS_INFORMATION;
  872. PSYSTEM_CALLS_INFORMATION = ^SYSTEM_CALLS_INFORMATION;
  873. TSystemCallsInformation = SYSTEM_CALLS_INFORMATION;
  874. PSystemCallsInformation = ^TSystemCallsInformation;
  875. _SYSTEM_CONFIGURATION_INFORMATION = record // Information Class 7
  876. DiskCount: ULONG;
  877. FloppyCount: ULONG;
  878. CdRomCount: ULONG;
  879. TapeCount: ULONG;
  880. SerialCount: ULONG;
  881. ParallelCount: ULONG;
  882. end;
  883. SYSTEM_CONFIGURATION_INFORMATION = _SYSTEM_CONFIGURATION_INFORMATION;
  884. PSYSTEM_CONFIGURATION_INFORMATION = ^SYSTEM_CONFIGURATION_INFORMATION;
  885. TSystemConfigurationInformation = SYSTEM_CONFIGURATION_INFORMATION;
  886. PSystemConfigurationInformation = ^TSystemConfigurationInformation;
  887. _SYSTEM_PROCESSOR_TIMES = record // Information Class 8
  888. IdleTime: LARGE_INTEGER;
  889. KernelTime: LARGE_INTEGER;
  890. UserTime: LARGE_INTEGER;
  891. DpcTime: LARGE_INTEGER;
  892. InterruptTime: LARGE_INTEGER;
  893. InterruptCount: ULONG;
  894. end;
  895. SYSTEM_PROCESSOR_TIMES = _SYSTEM_PROCESSOR_TIMES;
  896. PSYSTEM_PROCESSOR_TIMES = ^SYSTEM_PROCESSOR_TIMES;
  897. TSystemProcessorTimes = SYSTEM_PROCESSOR_TIMES;
  898. PSystemProcessorTimes = ^TSystemProcessorTimes;
  899. _SYSTEM_GLOBAL_FLAG = record // Information Class 9
  900. GlobalFlag: ULONG;
  901. end;
  902. SYSTEM_GLOBAL_FLAG = _SYSTEM_GLOBAL_FLAG;
  903. PSYSTEM_GLOBAL_FLAG = ^SYSTEM_GLOBAL_FLAG;
  904. TSystemGlobalFlag = SYSTEM_GLOBAL_FLAG;
  905. PSystemGlobalFlag = ^TSystemGlobalFlag;
  906. _SYSTEM_MODULE_INFORMATION = record // Information Class 11
  907. Reserved: array[0..1] of ULONG;
  908. Base: PVOID;
  909. Size: ULONG;
  910. Flags: ULONG;
  911. Index: USHORT;
  912. Unknown: USHORT;
  913. LoadCount: USHORT;
  914. ModuleNameOffset: USHORT;
  915. ImageName: array[0..255] of CHAR;
  916. end;
  917. SYSTEM_MODULE_INFORMATION = _SYSTEM_MODULE_INFORMATION;
  918. PSYSTEM_MODULE_INFORMATION = ^SYSTEM_MODULE_INFORMATION;
  919. TSystemModuleInformation = SYSTEM_MODULE_INFORMATION;
  920. PSystemModuleInformation = PSYSTEM_MODULE_INFORMATION;
  921. _SYSTEM_LOCK_INFORMATION = record // Information Class 12
  922. Address: PVOID;
  923. Type_: USHORT;
  924. Reserved1: USHORT;
  925. ExclusiveOwnerThreadId: ULONG;
  926. ActiveCount: ULONG;
  927. ContentionCount: ULONG;
  928. Reserved2: array[0..1] of ULONG;
  929. NumberOfSharedWaiters: ULONG;
  930. NumberOfExclusiveWaiters: ULONG;
  931. end;
  932. SYSTEM_LOCK_INFORMATION = _SYSTEM_LOCK_INFORMATION;
  933. PSYSTEM_LOCK_INFORMATION = ^SYSTEM_LOCK_INFORMATION;
  934. TSystemLockInformation = SYSTEM_LOCK_INFORMATION;
  935. PSystemLockInformation = ^TSystemLockInformation;
  936. _SYSTEM_HANDLE_INFORMATION = record // Information Class 16
  937. ProcessId: ULONG;
  938. ObjectTypeNumber: UCHAR;
  939. Flags: UCHAR; // 0x01 = PROTECT_FROM_CLOSE, 0x02 = INHERIT
  940. Handle: USHORT;
  941. Object_: PVOID;
  942. GrantedAccess: ACCESS_MASK;
  943. end;
  944. SYSTEM_HANDLE_INFORMATION = _SYSTEM_HANDLE_INFORMATION;
  945. PSYSTEM_HANDLE_INFORMATION = ^SYSTEM_HANDLE_INFORMATION;
  946. TSystemHandleInformation = SYSTEM_HANDLE_INFORMATION;
  947. PSystemHandleInformation = ^TSystemHandleInformation;
  948. _SYSTEM_OBJECT_TYPE_INFORMATION = record // Information Class 17
  949. NextEntryOffset: ULONG;
  950. ObjectCount: ULONG;
  951. HandleCount: ULONG;
  952. TypeNumber: ULONG;
  953. InvalidAttributes: ULONG;
  954. GenericMapping: GENERIC_MAPPING;
  955. ValidAccessMask: ACCESS_MASK;
  956. PoolType: POOL_TYPE;
  957. Unknown: UCHAR;
  958. Name: UNICODE_STRING;
  959. end;
  960. SYSTEM_OBJECT_TYPE_INFORMATION = _SYSTEM_OBJECT_TYPE_INFORMATION;
  961. PSYSTEM_OBJECT_TYPE_INFORMATION = ^SYSTEM_OBJECT_TYPE_INFORMATION;
  962. TSystemObjectTypeInformation = SYSTEM_OBJECT_TYPE_INFORMATION;
  963. PSystemObjectTypeInformation = ^TSystemObjectTypeInformation;
  964. _SYSTEM_OBJECT_INFORMATION = record
  965. NextEntryOffset: ULONG;
  966. Object_: PVOID;
  967. CreatorProcessId: ULONG;
  968. Unknown: USHORT;
  969. Flags: USHORT;
  970. PointerCount: ULONG;
  971. HandleCount: ULONG;
  972. PagedPoolUsage: ULONG;
  973. NonPagedPoolUsage: ULONG;
  974. ExclusiveProcessId: ULONG;
  975. SecurityDescriptor: PSECURITY_DESCRIPTOR;
  976. Name: UNICODE_STRING;
  977. end;
  978. SYSTEM_OBJECT_INFORMATION = _SYSTEM_OBJECT_INFORMATION;
  979. PSYSTEM_OBJECT_INFORMATION = ^SYSTEM_OBJECT_INFORMATION;
  980. TSystemObjectInformation = SYSTEM_OBJECT_INFORMATION;
  981. PSystemObjectInformation = ^TSystemObjectInformation;
  982. _SYSTEM_PAGEFILE_INFORMATION = record // Information Class 18
  983. NextEntryOffset: ULONG;
  984. CurrentSize: ULONG;
  985. TotalUsed: ULONG;
  986. PeakUsed: ULONG;
  987. FileName: UNICODE_STRING;
  988. end;
  989. SYSTEM_PAGEFILE_INFORMATION = _SYSTEM_PAGEFILE_INFORMATION;
  990. PSYSTEM_PAGEFILE_INFORMATION = ^SYSTEM_PAGEFILE_INFORMATION;
  991. TSystemPageFileInformation = SYSTEM_PAGEFILE_INFORMATION;
  992. PSystemPageFileInformation = PSYSTEM_PAGEFILE_INFORMATION;
  993. _SYSTEM_INSTRUCTION_EMULATION_INFORMATION = record // Info Class 19
  994. GenericInvalidOpcode: ULONG;
  995. TwoByteOpcode: ULONG;
  996. ESprefix: ULONG;
  997. CSprefix: ULONG;
  998. SSprefix: ULONG;
  999. DSprefix: ULONG;
  1000. FSPrefix: ULONG;
  1001. GSprefix: ULONG;
  1002. OPER32prefix: ULONG;
  1003. ADDR32prefix: ULONG;
  1004. INSB: ULONG;
  1005. INSW: ULONG;
  1006. OUTSB: ULONG;
  1007. OUTSW: ULONG;
  1008. PUSHFD: ULONG;
  1009. POPFD: ULONG;
  1010. INTnn: ULONG;
  1011. INTO: ULONG;
  1012. IRETD: ULONG;
  1013. FloatingPointOpcode: ULONG;
  1014. INBimm: ULONG;
  1015. INWimm: ULONG;
  1016. OUTBimm: ULONG;
  1017. OUTWimm: ULONG;
  1018. INB: ULONG;
  1019. INW: ULONG;
  1020. OUTB: ULONG;
  1021. OUTW: ULONG;
  1022. LOCKprefix: ULONG;
  1023. REPNEprefix: ULONG;
  1024. REPprefix: ULONG;
  1025. CLI: ULONG;
  1026. STI: ULONG;
  1027. HLT: ULONG;
  1028. end;
  1029. SYSTEM_INSTRUCTION_EMULATION_INFORMATION = _SYSTEM_INSTRUCTION_EMULATION_INFORMATION;
  1030. PSYSTEM_INSTRUCTION_EMULATION_INFORMATION = ^SYSTEM_INSTRUCTION_EMULATION_INFORMATION;
  1031. TSystemInstructionEmulationInformation = SYSTEM_INSTRUCTION_EMULATION_INFORMATION;
  1032. PSystemInstructionEmulationInformation = ^TSystemInstructionEmulationInformation;
  1033. _SYSTEM_CACHE_INFORMATION = record // Information Class 21
  1034. SystemCacheWsSize: ULONG;
  1035. SystemCacheWsPeakSize: ULONG;
  1036. SystemCacheWsFaults: ULONG;
  1037. SystemCacheWsMinimum: ULONG;
  1038. SystemCacheWsMaximum: ULONG;
  1039. TransitionSharedPages: ULONG;
  1040. TransitionSharedPagesPeak: ULONG;
  1041. Reserved: array[0..1] of ULONG;
  1042. end;
  1043. SYSTEM_CACHE_INFORMATION = _SYSTEM_CACHE_INFORMATION;
  1044. PSYSTEM_CACHE_INFORMATION = ^SYSTEM_CACHE_INFORMATION;
  1045. TSystemCacheInformation = SYSTEM_CACHE_INFORMATION;
  1046. PSystemCacheInformation = ^TSystemCacheInformation;
  1047. _SYSTEM_POOL_TAG_INFORMATION = record // Information Class 22
  1048. Tag: array[0..3] of CHAR;
  1049. PagedPoolAllocs: ULONG;
  1050. PagedPoolFrees: ULONG;
  1051. PagedPoolUsage: ULONG;
  1052. NonPagedPoolAllocs: ULONG;
  1053. NonPagedPoolFrees: ULONG;
  1054. NonPagedPoolUsage: ULONG;
  1055. end;
  1056. SYSTEM_POOL_TAG_INFORMATION = _SYSTEM_POOL_TAG_INFORMATION;
  1057. PSYSTEM_POOL_TAG_INFORMATION = ^SYSTEM_POOL_TAG_INFORMATION;
  1058. TSystemPoolTagInformation = SYSTEM_POOL_TAG_INFORMATION;
  1059. PSystemPoolTagInformation = ^TSystemPoolTagInformation;
  1060. _SYSTEM_PROCESSOR_STATISTICS = record // Information Class 23
  1061. ContextSwitches: ULONG;
  1062. DpcCount: ULONG;
  1063. DpcRequestRate: ULONG;
  1064. TimeIncrement: ULONG;
  1065. DpcBypassCount: ULONG;
  1066. ApcBypassCount: ULONG;
  1067. end;
  1068. SYSTEM_PROCESSOR_STATISTICS = _SYSTEM_PROCESSOR_STATISTICS;
  1069. PSYSTEM_PROCESSOR_STATISTICS = ^SYSTEM_PROCESSOR_STATISTICS;
  1070. TSystemProcessorStatistics = SYSTEM_PROCESSOR_STATISTICS;
  1071. PSystemProcessorStatistics = ^TSystemProcessorStatistics;
  1072. _SYSTEM_DPC_INFORMATION = record // Information Class 24
  1073. Reserved: ULONG;
  1074. MaximumDpcQueueDepth: ULONG;
  1075. MinimumDpcRate: ULONG;
  1076. AdjustDpcThreshold: ULONG;
  1077. IdealDpcRate: ULONG;
  1078. end;
  1079. SYSTEM_DPC_INFORMATION = _SYSTEM_DPC_INFORMATION;
  1080. PSYSTEM_DPC_INFORMATION = ^SYSTEM_DPC_INFORMATION;
  1081. TSystemDpcInformation = SYSTEM_DPC_INFORMATION;
  1082. PSystemDpcInformation = ^TSystemDpcInformation;
  1083. _SYSTEM_LOAD_IMAGE = record // Information Class 26
  1084. ModuleName: UNICODE_STRING;
  1085. ModuleBase: PVOID;
  1086. Unknown: PVOID;
  1087. EntryPoint: PVOID;
  1088. ExportDirectory: PVOID;
  1089. end;
  1090. SYSTEM_LOAD_IMAGE = _SYSTEM_LOAD_IMAGE;
  1091. PSYSTEM_LOAD_IMAGE = ^SYSTEM_LOAD_IMAGE;
  1092. TSystemLoadImage = SYSTEM_LOAD_IMAGE;
  1093. PSystemLoadImage = ^TSystemLoadImage;
  1094. _SYSTEM_UNLOAD_IMAGE = record // Information Class 27
  1095. ModuleBase: PVOID;
  1096. end;
  1097. SYSTEM_UNLOAD_IMAGE = _SYSTEM_UNLOAD_IMAGE;
  1098. PSYSTEM_UNLOAD_IMAGE = ^SYSTEM_UNLOAD_IMAGE;
  1099. TSystemUnloadImage = SYSTEM_UNLOAD_IMAGE;
  1100. PSystemUnloadImage = ^TSystemUnloadImage;
  1101. _SYSTEM_QUERY_TIME_ADJUSTMENT = record // Information Class 28
  1102. TimeAdjustment: ULONG;
  1103. MaximumIncrement: ULONG;
  1104. TimeSynchronization: ByteBool;
  1105. end;
  1106. SYSTEM_QUERY_TIME_ADJUSTMENT = _SYSTEM_QUERY_TIME_ADJUSTMENT;
  1107. PSYSTEM_QUERY_TIME_ADJUSTMENT = ^SYSTEM_QUERY_TIME_ADJUSTMENT;
  1108. TSystemQueryTimeAdjustment = SYSTEM_QUERY_TIME_ADJUSTMENT;
  1109. PSystemQueryTimeAdjustment = ^TSystemQueryTimeAdjustment;
  1110. _SYSTEM_SET_TIME_ADJUSTMENT = record // Information Class 28
  1111. TimeAdjustment: ULONG;
  1112. TimeSynchronization: ByteBool;
  1113. end;
  1114. SYSTEM_SET_TIME_ADJUSTMENT = _SYSTEM_SET_TIME_ADJUSTMENT;
  1115. PSYSTEM_SET_TIME_ADJUSTMENT = ^SYSTEM_SET_TIME_ADJUSTMENT;
  1116. TSystemSetTimeAdjustment = SYSTEM_SET_TIME_ADJUSTMENT;
  1117. PSystemSetTimeAdjustment = ^TSystemSetTimeAdjustment;
  1118. _SYSTEM_CRASH_DUMP_INFORMATION = record // Information Class 32
  1119. CrashDumpSectionHandle: HANDLE;
  1120. Unknown: HANDLE; // Windows 2000 only
  1121. end;
  1122. SYSTEM_CRASH_DUMP_INFORMATION = _SYSTEM_CRASH_DUMP_INFORMATION;
  1123. PSYSTEM_CRASH_DUMP_INFORMATION = ^SYSTEM_CRASH_DUMP_INFORMATION;
  1124. TSystemCrashDumpInformation = SYSTEM_CRASH_DUMP_INFORMATION;
  1125. PSystemCrashDumpInformation = ^TSystemCrashDumpInformation;
  1126. {$IFNDEF JWA_INCLUDEMODE}
  1127. _SYSTEM_EXCEPTION_INFORMATION = record // Information Class 33
  1128. AlignmentFixupCount: ULONG;
  1129. ExceptionDispatchCount: ULONG;
  1130. FloatingEmulationCount: ULONG;
  1131. Reserved: ULONG;
  1132. end;
  1133. SYSTEM_EXCEPTION_INFORMATION = _SYSTEM_EXCEPTION_INFORMATION;
  1134. PSYSTEM_EXCEPTION_INFORMATION = ^SYSTEM_EXCEPTION_INFORMATION;
  1135. TSystemExceptionInformation = SYSTEM_EXCEPTION_INFORMATION;
  1136. PSystemExceptionInformation = ^TSystemExceptionInformation;
  1137. {$ENDIF JWA_INCLUDEMODE}
  1138. _SYSTEM_CRASH_STATE_INFORMATION = record // Information Class 34
  1139. ValidCrashDump: ULONG;
  1140. Unknown: ULONG; // Windows 2000 only
  1141. end;
  1142. SYSTEM_CRASH_STATE_INFORMATION = _SYSTEM_CRASH_STATE_INFORMATION;
  1143. PSYSTEM_CRASH_STATE_INFORMATION = ^SYSTEM_CRASH_STATE_INFORMATION;
  1144. TSystemCrashStateInformation = SYSTEM_CRASH_STATE_INFORMATION;
  1145. PSystemCrashStateInformation = ^TSystemCrashStateInformation;
  1146. _SYSTEM_KERNEL_DEBUGGER_INFORMATION = record // Information Class 35
  1147. DebuggerEnabled: ByteBool;
  1148. DebuggerNotPresent: ByteBool;
  1149. end;
  1150. SYSTEM_KERNEL_DEBUGGER_INFORMATION = _SYSTEM_KERNEL_DEBUGGER_INFORMATION;
  1151. PSYSTEM_KERNEL_DEBUGGER_INFORMATION = ^SYSTEM_KERNEL_DEBUGGER_INFORMATION;
  1152. TSystemKernelDebuggerInformation = SYSTEM_KERNEL_DEBUGGER_INFORMATION;
  1153. PSystemKernelDebuggerInformation = ^TSystemKernelDebuggerInformation;
  1154. _SYSTEM_CONTEXT_SWITCH_INFORMATION = record // Information Class 36
  1155. ContextSwitches: ULONG;
  1156. ContextSwitchCounters: array[0..10] of ULONG;
  1157. end;
  1158. SYSTEM_CONTEXT_SWITCH_INFORMATION = _SYSTEM_CONTEXT_SWITCH_INFORMATION;
  1159. PSYSTEM_CONTEXT_SWITCH_INFORMATION = ^SYSTEM_CONTEXT_SWITCH_INFORMATION;
  1160. TSystemContextSwitchInformation = SYSTEM_CONTEXT_SWITCH_INFORMATION;
  1161. PSystemContextSwitchInformation = ^TSystemContextSwitchInformation;
  1162. {$IFNDEF JWA_INCLUDEMODE}
  1163. _SYSTEM_REGISTRY_QUOTA_INFORMATION = record // Information Class 37
  1164. RegistryQuota: ULONG;
  1165. RegistryQuotaInUse: ULONG;
  1166. PagedPoolSize: ULONG;
  1167. end;
  1168. SYSTEM_REGISTRY_QUOTA_INFORMATION = _SYSTEM_REGISTRY_QUOTA_INFORMATION;
  1169. PSYSTEM_REGISTRY_QUOTA_INFORMATION = ^SYSTEM_REGISTRY_QUOTA_INFORMATION;
  1170. TSystemRegistryQuotaInformation = SYSTEM_REGISTRY_QUOTA_INFORMATION;
  1171. PSystemRegistryQuotaInformation = ^TSystemRegistryQuotaInformation;
  1172. {$ENDIF JWA_INCLUDEMODE}
  1173. _SYSTEM_LOAD_AND_CALL_IMAGE = record // Information Class 38
  1174. ModuleName: UNICODE_STRING;
  1175. end;
  1176. SYSTEM_LOAD_AND_CALL_IMAGE = _SYSTEM_LOAD_AND_CALL_IMAGE;
  1177. PSYSTEM_LOAD_AND_CALL_IMAGE = ^SYSTEM_LOAD_AND_CALL_IMAGE;
  1178. TSystemLoadAndCallImage = SYSTEM_LOAD_AND_CALL_IMAGE;
  1179. PSystemLoadAndCallImage = ^TSystemLoadAndCallImage;
  1180. _SYSTEM_PRIORITY_SEPARATION = record // Information Class 39
  1181. PrioritySeparation: ULONG;
  1182. end;
  1183. SYSTEM_PRIORITY_SEPARATION = _SYSTEM_PRIORITY_SEPARATION;
  1184. PSYSTEM_PRIORITY_SEPARATION = ^SYSTEM_PRIORITY_SEPARATION;
  1185. TSystemPrioritySeparation = SYSTEM_PRIORITY_SEPARATION;
  1186. PSystemPrioritySeparation = ^TSystemPrioritySeparation;
  1187. _SYSTEM_TIME_ZONE_INFORMATION = record // Information Class 44
  1188. Bias: LONG;
  1189. StandardName: array[0..31] of WCHAR;
  1190. StandardDate: SYSTEMTIME;
  1191. StandardBias: LONG;
  1192. DaylightName: array[0..31] of WCHAR;
  1193. DaylightDate: SYSTEMTIME;
  1194. DaylightBias: LONG;
  1195. end;
  1196. SYSTEM_TIME_ZONE_INFORMATION = _SYSTEM_TIME_ZONE_INFORMATION;
  1197. PSYSTEM_TIME_ZONE_INFORMATION = ^SYSTEM_TIME_ZONE_INFORMATION;
  1198. TSystemTimeZoneInformation = SYSTEM_TIME_ZONE_INFORMATION;
  1199. PSystemTimeZoneInformation = ^TSystemTimeZoneInformation;
  1200. {$IFNDEF JWA_INCLUDEMODE}
  1201. _SYSTEM_LOOKASIDE_INFORMATION = record // Information Class 45
  1202. Depth: USHORT;
  1203. MaximumDepth: USHORT;
  1204. TotalAllocates: ULONG;
  1205. AllocateMisses: ULONG;
  1206. TotalFrees: ULONG;
  1207. FreeMisses: ULONG;
  1208. Type_: POOL_TYPE;
  1209. Tag: ULONG;
  1210. Size: ULONG;
  1211. end;
  1212. SYSTEM_LOOKASIDE_INFORMATION = _SYSTEM_LOOKASIDE_INFORMATION;
  1213. PSYSTEM_LOOKASIDE_INFORMATION = ^SYSTEM_LOOKASIDE_INFORMATION;
  1214. TSystemLookAsideInformation = SYSTEM_LOOKASIDE_INFORMATION;
  1215. PSystemLookAsideInformation = ^TSystemLookAsideInformation;
  1216. {$ENDIF JWA_INCLUDEMODE}
  1217. _SYSTEM_SET_TIME_SLIP_EVENT = record // Information Class 46
  1218. TimeSlipEvent: HANDLE;
  1219. end;
  1220. SYSTEM_SET_TIME_SLIP_EVENT = _SYSTEM_SET_TIME_SLIP_EVENT;
  1221. PSYSTEM_SET_TIME_SLIP_EVENT = ^SYSTEM_SET_TIME_SLIP_EVENT;
  1222. TSystemSetTimeSlipEvent = SYSTEM_SET_TIME_SLIP_EVENT;
  1223. PSystemSetTimeSlipEvent = ^TSystemSetTimeSlipEvent;
  1224. _SYSTEM_CREATE_SESSION = record // Information Class 47
  1225. Session: ULONG;
  1226. end;
  1227. SYSTEM_CREATE_SESSION = _SYSTEM_CREATE_SESSION;
  1228. PSYSTEM_CREATE_SESSION = ^SYSTEM_CREATE_SESSION;
  1229. TSystemCreateSession = SYSTEM_CREATE_SESSION;
  1230. PSystemCreateSession = ^TSystemCreateSession;
  1231. _SYSTEM_DELETE_SESSION = record // Information Class 48
  1232. Session: ULONG;
  1233. end;
  1234. SYSTEM_DELETE_SESSION = _SYSTEM_DELETE_SESSION;
  1235. PSYSTEM_DELETE_SESSION = ^SYSTEM_DELETE_SESSION;
  1236. TSystemDeleteSession = SYSTEM_DELETE_SESSION;
  1237. PSystemDeleteSession = ^TSystemDeleteSession;
  1238. _SYSTEM_RANGE_START_INFORMATION = record // Information Class 50
  1239. SystemRangeStart: PVOID;
  1240. end;
  1241. SYSTEM_RANGE_START_INFORMATION = _SYSTEM_RANGE_START_INFORMATION;
  1242. PSYSTEM_RANGE_START_INFORMATION = ^SYSTEM_RANGE_START_INFORMATION;
  1243. TSystemRangeStartInformation = SYSTEM_RANGE_START_INFORMATION;
  1244. PSystemRangeStartInformation = ^TSystemRangeStartInformation;
  1245. _SYSTEM_POOL_BLOCK = record
  1246. Allocated: ByteBool;
  1247. Unknown: USHORT;
  1248. Size: ULONG;
  1249. Tag: array[0..3] of CHAR;
  1250. end;
  1251. SYSTEM_POOL_BLOCK = _SYSTEM_POOL_BLOCK;
  1252. PSYSTEM_POOL_BLOCK = ^SYSTEM_POOL_BLOCK;
  1253. TSystemPoolBlock = SYSTEM_POOL_BLOCK;
  1254. PSystemPoolBlock = ^TSystemPoolBlock;
  1255. _SYSTEM_POOL_BLOCKS_INFORMATION = record // Info Classes 14 and 15
  1256. PoolSize: ULONG;
  1257. PoolBase: PVOID;
  1258. Unknown: USHORT;
  1259. NumberOfBlocks: ULONG;
  1260. PoolBlocks: array[0..0] of SYSTEM_POOL_BLOCK;
  1261. end;
  1262. SYSTEM_POOL_BLOCKS_INFORMATION = _SYSTEM_POOL_BLOCKS_INFORMATION;
  1263. PSYSTEM_POOL_BLOCKS_INFORMATION = ^SYSTEM_POOL_BLOCKS_INFORMATION;
  1264. TSystemPoolBlocksInformation = SYSTEM_POOL_BLOCKS_INFORMATION;
  1265. PSystemPoolBlocksInformation = ^TSystemPoolBlocksInformation;
  1266. _SYSTEM_MEMORY_USAGE = record
  1267. Name: PVOID;
  1268. Valid: USHORT;
  1269. Standby: USHORT;
  1270. Modified: USHORT;
  1271. PageTables: USHORT;
  1272. end;
  1273. SYSTEM_MEMORY_USAGE = _SYSTEM_MEMORY_USAGE;
  1274. PSYSTEM_MEMORY_USAGE = ^SYSTEM_MEMORY_USAGE;
  1275. TSystemMemoryUsage = SYSTEM_MEMORY_USAGE;
  1276. PSystemMemoryUsage = ^TSystemMemoryUsage;
  1277. _SYSTEM_MEMORY_USAGE_INFORMATION = record // Info Classes 25 and 29
  1278. Reserved: ULONG;
  1279. EndOfData: PVOID;
  1280. MemoryUsage: array[0..0] of SYSTEM_MEMORY_USAGE;
  1281. end;
  1282. SYSTEM_MEMORY_USAGE_INFORMATION = _SYSTEM_MEMORY_USAGE_INFORMATION;
  1283. PSYSTEM_MEMORY_USAGE_INFORMATION = ^SYSTEM_MEMORY_USAGE_INFORMATION;
  1284. TSystemMemoryUsageInformation = SYSTEM_MEMORY_USAGE_INFORMATION;
  1285. PSystemMemoryUsageInformation = ^TSystemMemoryUsageInformation;
  1286. type
  1287. _SHUTDOWN_ACTION = (
  1288. ShutdownNoReboot,
  1289. ShutdownReboot,
  1290. ShutdownPowerOff);
  1291. SHUTDOWN_ACTION = _SHUTDOWN_ACTION;
  1292. TShutdownAction = SHUTDOWN_ACTION;
  1293. type
  1294. _DEBUG_CONTROL_CODE = (
  1295. DebugFiller0,
  1296. DebugGetTraceInformation,
  1297. DebugSetInternalBreakpoint,
  1298. DebugSetSpecialCall,
  1299. DebugClearSpecialCalls,
  1300. DebugQuerySpecialCalls,
  1301. DebugDbgBreakPoint);
  1302. DEBUG_CONTROL_CODE = _DEBUG_CONTROL_CODE;
  1303. TDebugControlCode = DEBUG_CONTROL_CODE;
  1304. type
  1305. _OBJECT_INFORMATION_CLASS = (
  1306. ObjectBasicInformation,
  1307. ObjectNameInformation,
  1308. ObjectTypeInformation,
  1309. ObjectAllTypesInformation,
  1310. ObjectHandleInformation);
  1311. OBJECT_INFORMATION_CLASS = _OBJECT_INFORMATION_CLASS;
  1312. TObjectInformationClass = OBJECT_INFORMATION_CLASS;
  1313. type
  1314. _OBJECT_BASIC_INFORMATION = record // Information Class 0
  1315. Attributes: ULONG;
  1316. GrantedAccess: ACCESS_MASK;
  1317. HandleCount: ULONG;
  1318. PointerCount: ULONG;
  1319. PagedPoolUsage: ULONG;
  1320. NonPagedPoolUsage: ULONG;
  1321. Reserved: array[0..2] of ULONG;
  1322. NameInformationLength: ULONG;
  1323. TypeInformationLength: ULONG;
  1324. SecurityDescriptorLength: ULONG;
  1325. CreateTime: LARGE_INTEGER;
  1326. end;
  1327. OBJECT_BASIC_INFORMATION = _OBJECT_BASIC_INFORMATION;
  1328. POBJECT_BASIC_INFORMATION = ^OBJECT_BASIC_INFORMATION;
  1329. TObjectBasicInformation = OBJECT_BASIC_INFORMATION;
  1330. PObjectBasicInformation = ^TObjectBasicInformation;
  1331. _OBJECT_TYPE_INFORMATION = record // Information Class 2
  1332. Name: UNICODE_STRING;
  1333. ObjectCount: ULONG;
  1334. HandleCount: ULONG;
  1335. Reserved1: array[0..3] of ULONG;
  1336. PeakObjectCount: ULONG;
  1337. PeakHandleCount: ULONG;
  1338. Reserved2: array[0..3] of ULONG;
  1339. InvalidAttributes: ULONG;
  1340. GenericMapping: GENERIC_MAPPING;
  1341. ValidAccess: ULONG;
  1342. Unknown: UCHAR;
  1343. MaintainHandleDatabase: ByteBool;
  1344. Reserved3: array[0..1] of UCHAR;
  1345. PoolType: POOL_TYPE;
  1346. PagedPoolUsage: ULONG;
  1347. NonPagedPoolUsage: ULONG;
  1348. end;
  1349. OBJECT_TYPE_INFORMATION = _OBJECT_TYPE_INFORMATION;
  1350. POBJECT_TYPE_INFORMATION = ^OBJECT_TYPE_INFORMATION;
  1351. TObjectTypeInformation = OBJECT_TYPE_INFORMATION;
  1352. PObjectTypeInformation = ^TObjectTypeInformation;
  1353. _OBJECT_ALL_TYPES_INFORMATION = record // Information Class 3
  1354. NumberOfTypes: ULONG;
  1355. TypeInformation: OBJECT_TYPE_INFORMATION;
  1356. end;
  1357. OBJECT_ALL_TYPES_INFORMATION = _OBJECT_ALL_TYPES_INFORMATION;
  1358. POBJECT_ALL_TYPES_INFORMATION = ^OBJECT_ALL_TYPES_INFORMATION;
  1359. TObjectAllTypesInformation = OBJECT_ALL_TYPES_INFORMATION;
  1360. PObjectAllTypesInformation = ^TObjectAllTypesInformation;
  1361. _OBJECT_HANDLE_ATTRIBUTE_INFORMATION = record // Information Class 4
  1362. Inherit: ByteBool;
  1363. ProtectFromClose: ByteBool;
  1364. end;
  1365. OBJECT_HANDLE_ATTRIBUTE_INFORMATION = _OBJECT_HANDLE_ATTRIBUTE_INFORMATION;
  1366. POBJECT_HANDLE_ATTRIBUTE_INFORMATION = ^OBJECT_HANDLE_ATTRIBUTE_INFORMATION;
  1367. TObjectHandleAttributeInformation = OBJECT_HANDLE_ATTRIBUTE_INFORMATION;
  1368. PObjectHandleAttributeInformation = ^TObjectHandleAttributeInformation;
  1369. type
  1370. _DIRECTORY_BASIC_INFORMATION = record
  1371. ObjectName: UNICODE_STRING;
  1372. ObjectTypeName: UNICODE_STRING;
  1373. end;
  1374. DIRECTORY_BASIC_INFORMATION = _DIRECTORY_BASIC_INFORMATION;
  1375. PDIRECTORY_BASIC_INFORMATION = ^DIRECTORY_BASIC_INFORMATION;
  1376. TDirectoryBasicInformation = DIRECTORY_BASIC_INFORMATION;
  1377. PDirectoryBasicInformation = ^TDirectoryBasicInformation;
  1378. type
  1379. _MEMORY_INFORMATION_CLASS = (
  1380. MemoryBasicInformation,
  1381. MemoryWorkingSetList,
  1382. MemorySectionName,
  1383. MemoryBasicVlmInformation);
  1384. MEMORY_INFORMATION_CLASS = _MEMORY_INFORMATION_CLASS;
  1385. TMemoryInformationClass = MEMORY_INFORMATION_CLASS;
  1386. PMemoryInformationClass = ^TMemoryInformationClass;
  1387. type
  1388. {$IFNDEF JWA_INCLUDEMODE}
  1389. _MEMORY_BASIC_INFORMATION = record // Information Class 0
  1390. BaseAddress: PVOID;
  1391. AllocationBase: PVOID;
  1392. AllocationProtect: ULONG;
  1393. RegionSize: ULONG;
  1394. State: ULONG;
  1395. Protect: ULONG;
  1396. Type_: ULONG;
  1397. end;
  1398. MEMORY_BASIC_INFORMATION = _MEMORY_BASIC_INFORMATION;
  1399. PMEMORY_BASIC_INFORMATION = ^MEMORY_BASIC_INFORMATION;
  1400. TMemoryBasicInformation = MEMORY_BASIC_INFORMATION;
  1401. PMemoryBasicInformation = ^TMemoryBasicInformation;
  1402. {$ENDIF JWA_INCLUDEMODE}
  1403. _MEMORY_WORKING_SET_LIST = record // Information Class 1
  1404. NumberOfPages: ULONG;
  1405. WorkingSetList: array[0..0] of ULONG;
  1406. end;
  1407. MEMORY_WORKING_SET_LIST = _MEMORY_WORKING_SET_LIST;
  1408. PMEMORY_WORKING_SET_LIST = ^MEMORY_WORKING_SET_LIST;
  1409. TMemoryWorkingSetList = MEMORY_WORKING_SET_LIST;
  1410. PMemoryWorkingSetList = ^TMemoryWorkingSetList;
  1411. _MEMORY_SECTION_NAME = record // Information Class 2
  1412. SectionFileName: UNICODE_STRING;
  1413. end;
  1414. MEMORY_SECTION_NAME = _MEMORY_SECTION_NAME;
  1415. PMEMORY_SECTION_NAME = ^MEMORY_SECTION_NAME;
  1416. TMemorySectionName = MEMORY_SECTION_NAME;
  1417. PMemorySectionName = ^TMemorySectionName;
  1418. type
  1419. _SECTION_INFORMATION_CLASS = (
  1420. SectionBasicInformation,
  1421. SectionImageInformation);
  1422. SECTION_INFORMATION_CLASS = _SECTION_INFORMATION_CLASS;
  1423. TSectionInformationClass = SECTION_INFORMATION_CLASS;
  1424. type
  1425. _SECTION_BASIC_INFORMATION = record // Information Class 0
  1426. BaseAddress: PVOID;
  1427. Attributes: ULONG;
  1428. Size: LARGE_INTEGER;
  1429. end;
  1430. SECTION_BASIC_INFORMATION = _SECTION_BASIC_INFORMATION;
  1431. PSECTION_BASIC_INFORMATION = ^SECTION_BASIC_INFORMATION;
  1432. TSectionBasicInformation = SECTION_BASIC_INFORMATION;
  1433. PSectionBasicInformation = ^TSectionBasicInformation;
  1434. _SECTION_IMAGE_INFORMATION = record // Information Class 1
  1435. EntryPoint: PVOID;
  1436. Unknown1: ULONG;
  1437. StackReserve: ULONG;
  1438. StackCommit: ULONG;
  1439. Subsystem: ULONG;
  1440. MinorSubsystemVersion: USHORT;
  1441. MajorSubsystemVersion: USHORT;
  1442. Unknown2: ULONG;
  1443. Characteristics: ULONG;
  1444. ImageNumber: USHORT;
  1445. Executable: ByteBool;
  1446. Unknown3: UCHAR;
  1447. Unknown4: array[0..2] of ULONG;
  1448. end;
  1449. SECTION_IMAGE_INFORMATION = _SECTION_IMAGE_INFORMATION;
  1450. PSECTION_IMAGE_INFORMATION = ^SECTION_IMAGE_INFORMATION;
  1451. TSectionImageInformation = SECTION_IMAGE_INFORMATION;
  1452. PSectionImageInformation = TSectionImageInformation;
  1453. type
  1454. _USER_STACK = record
  1455. FixedStackBase: PVOID;
  1456. FixedStackLimit: PVOID;
  1457. ExpandableStackBase: PVOID;
  1458. ExpandableStackLimit: PVOID;
  1459. ExpandableStackBottom: PVOID;
  1460. end;
  1461. USER_STACK = _USER_STACK;
  1462. PUSER_STACK = ^USER_STACK;
  1463. TUserStack = USER_STACK;
  1464. PUserStack = ^TUserStack;
  1465. type
  1466. _THREAD_BASIC_INFORMATION = record // Information Class 0
  1467. ExitStatus: NTSTATUS;
  1468. TebBaseAddress: PNT_TIB;
  1469. ClientId: CLIENT_ID;
  1470. AffinityMask: KAFFINITY;
  1471. Priority: KPRIORITY;
  1472. BasePriority: KPRIORITY;
  1473. end;
  1474. THREAD_BASIC_INFORMATION = _THREAD_BASIC_INFORMATION;
  1475. PTHREAD_BASIC_INFORMATION = ^THREAD_BASIC_INFORMATION;
  1476. TThreadBasicInformation = THREAD_BASIC_INFORMATION;
  1477. PThreadBasicInformation = ^TThreadBasicInformation;
  1478. type
  1479. _PROCESS_PRIORITY_CLASS = record // Information Class 18
  1480. Foreground: ByteBool;
  1481. PriorityClass: UCHAR;
  1482. end;
  1483. PROCESS_PRIORITY_CLASS = _PROCESS_PRIORITY_CLASS;
  1484. PPROCESS_PRIORITY_CLASS = ^PROCESS_PRIORITY_CLASS;
  1485. TProcessPriorityClass = PROCESS_PRIORITY_CLASS;
  1486. PProcessPriorityClass = ^TProcessPriorityClass;
  1487. _RTL_PROCESS_INFORMATION = record
  1488. Size: ULONG;
  1489. hProcess: HANDLE;
  1490. hThread: HANDLE;
  1491. ClientId: CLIENT_ID;
  1492. ImageInfo: SECTION_IMAGE_INFORMATION;
  1493. end;
  1494. RTL_PROCESS_INFORMATION = _RTL_PROCESS_INFORMATION;
  1495. PRTL_PROCESS_INFORMATION = ^RTL_PROCESS_INFORMATION;
  1496. TRtlProcessInformation = RTL_PROCESS_INFORMATION;
  1497. PRtlProcessInformation = ^RTL_PROCESS_INFORMATION;
  1498. type
  1499. _DEBUG_BUFFER = record
  1500. SectionHandle: HANDLE;
  1501. SectionBase: PVOID;
  1502. RemoteSectionBase: PVOID;
  1503. SectionBaseDelta: ULONG;
  1504. EventPairHandle: HANDLE;
  1505. Unknown: array[0..1] of ULONG;
  1506. RemoteThreadHandle: HANDLE;
  1507. InfoClassMask: ULONG;
  1508. SizeOfInfo: ULONG;
  1509. AllocatedSize: ULONG;
  1510. SectionSize: ULONG;
  1511. ModuleInformation: PVOID;
  1512. BackTraceInformation: PVOID;
  1513. HeapInformation: PVOID;
  1514. LockInformation: PVOID;
  1515. Reserved: array[0..7] of PVOID;
  1516. end;
  1517. DEBUG_BUFFER = _DEBUG_BUFFER;
  1518. PDEBUG_BUFFER = ^DEBUG_BUFFER;
  1519. TDebugBuffer = DEBUG_BUFFER;
  1520. PDebugBuffer = ^TDebugBuffer;
  1521. const
  1522. PDI_MODULES = $01;
  1523. PDI_BACKTRACE = $02;
  1524. PDI_HEAPS = $04;
  1525. PDI_HEAP_TAGS = $08;
  1526. PDI_HEAP_BLOCKS = $10;
  1527. PDI_LOCKS = $20;
  1528. type
  1529. _DEBUG_MODULE_INFORMATION = record // c.f. SYSTEM_MODULE_INFORMATION
  1530. Reserved: array[0..1] of ULONG;
  1531. Base: ULONG;
  1532. Size: ULONG;
  1533. Flags: ULONG;
  1534. Index: USHORT;
  1535. Unknown: USHORT;
  1536. LoadCount: USHORT;
  1537. ModuleNameOffset: USHORT;
  1538. ImageName: array[0..255] of CHAR;
  1539. end;
  1540. DEBUG_MODULE_INFORMATION = _DEBUG_MODULE_INFORMATION;
  1541. PDEBUG_MODULE_INFORMATION = ^DEBUG_MODULE_INFORMATION;
  1542. TDebugModuleInformation = DEBUG_MODULE_INFORMATION;
  1543. PDebugModuleInformation = ^TDebugModuleInformation;
  1544. _DEBUG_HEAP_INFORMATION = record
  1545. Base: ULONG;
  1546. Flags: ULONG;
  1547. Granularity: USHORT;
  1548. Unknown: USHORT;
  1549. Allocated: ULONG;
  1550. Committed: ULONG;
  1551. TagCount: ULONG;
  1552. BlockCount: ULONG;
  1553. Reserved: array[0..6] of ULONG;
  1554. Tags: PVOID;
  1555. Blocks: PVOID;
  1556. end;
  1557. DEBUG_HEAP_INFORMATION = _DEBUG_HEAP_INFORMATION;
  1558. PDEBUG_HEAP_INFORMATION = ^DEBUG_HEAP_INFORMATION;
  1559. TDebugHeapInformation = DEBUG_HEAP_INFORMATION;
  1560. PDebugHeapInformation = ^TDebugHeapInformation;
  1561. _DEBUG_LOCK_INFORMATION = record // c.f. SYSTEM_LOCK_INFORMATION
  1562. Address: PVOID;
  1563. Type_: USHORT;
  1564. CreatorBackTraceIndex: USHORT;
  1565. OwnerThreadId: ULONG;
  1566. ActiveCount: ULONG;
  1567. ContentionCount: ULONG;
  1568. EntryCount: ULONG;
  1569. RecursionCount: ULONG;
  1570. NumberOfSharedWaiters: ULONG;
  1571. NumberOfExclusiveWaiters: ULONG;
  1572. end;
  1573. DEBUG_LOCK_INFORMATION = _DEBUG_LOCK_INFORMATION;
  1574. PDEBUG_LOCK_INFORMATION = ^DEBUG_LOCK_INFORMATION;
  1575. TDebugLockInformation = DEBUG_LOCK_INFORMATION;
  1576. PDebugLockInformation = ^TDebugLockInformation;
  1577. type
  1578. PTIMER_APC_ROUTINE = procedure(TimerContext: PVOID; TimerLowValue: ULONG; TimerHighValue: LONG); stdcall;
  1579. type
  1580. _TIMER_INFORMATION_CLASS = (TimerBasicInformation);
  1581. TIMER_INFORMATION_CLASS = _TIMER_INFORMATION_CLASS;
  1582. TTimerInformationClass = TIMER_INFORMATION_CLASS;
  1583. type
  1584. _TIMER_BASIC_INFORMATION = record
  1585. TimeRemaining: LARGE_INTEGER;
  1586. SignalState: ByteBool;
  1587. end;
  1588. TIMER_BASIC_INFORMATION = _TIMER_BASIC_INFORMATION;
  1589. PTIMER_BASIC_INFORMATION = ^TIMER_BASIC_INFORMATION;
  1590. TTimerBasicInformation = TIMER_BASIC_INFORMATION;
  1591. PTimerBasicInformation = ^TTimerBasicInformation;
  1592. type
  1593. _EVENT_INFORMATION_CLASS = (EventBasicInformation);
  1594. EVENT_INFORMATION_CLASS = _EVENT_INFORMATION_CLASS;
  1595. TEventInformationClass = EVENT_INFORMATION_CLASS;
  1596. type
  1597. _EVENT_BASIC_INFORMATION = record
  1598. EventType: EVENT_TYPE;
  1599. SignalState: LONG;
  1600. end;
  1601. EVENT_BASIC_INFORMATION = _EVENT_BASIC_INFORMATION;
  1602. PEVENT_BASIC_INFORMATION = ^EVENT_BASIC_INFORMATION;
  1603. TEventBasicInformation = EVENT_BASIC_INFORMATION;
  1604. PEventBasicInformation = ^TEventBasicInformation;
  1605. type
  1606. _SEMAPHORE_INFORMATION_CLASS = (SemaphoreBasicInformation);
  1607. SEMAPHORE_INFORMATION_CLASS = _SEMAPHORE_INFORMATION_CLASS;
  1608. TSemaphoreInformationClass = SEMAPHORE_INFORMATION_CLASS;
  1609. type
  1610. _SEMAPHORE_BASIC_INFORMATION = record
  1611. CurrentCount: LONG;
  1612. MaximumCount: LONG;
  1613. end;
  1614. SEMAPHORE_BASIC_INFORMATION = _SEMAPHORE_BASIC_INFORMATION;
  1615. PSEMAPHORE_BASIC_INFORMATION = ^SEMAPHORE_BASIC_INFORMATION;
  1616. TSemaphoreBasicInformation = SEMAPHORE_BASIC_INFORMATION;
  1617. type
  1618. _MUTANT_INFORMATION_CLASS = (MutantBasicInformation);
  1619. MUTANT_INFORMATION_CLASS = _MUTANT_INFORMATION_CLASS;
  1620. TMutantInformationClass = MUTANT_INFORMATION_CLASS;
  1621. type
  1622. _MUTANT_BASIC_INFORMATION = record
  1623. SignalState: LONG;
  1624. Owned: ByteBool;
  1625. Abandoned: ByteBool;
  1626. end;
  1627. MUTANT_BASIC_INFORMATION = _MUTANT_BASIC_INFORMATION;
  1628. PMUTANT_BASIC_INFORMATION = ^MUTANT_BASIC_INFORMATION;
  1629. TMutantBasicInformation = MUTANT_BASIC_INFORMATION;
  1630. PMutantBasicInformation = ^TMutantBasicInformation;
  1631. type
  1632. _IO_COMPLETION_INFORMATION_CLASS = (IoCompletionBasicInformation);
  1633. IO_COMPLETION_INFORMATION_CLASS = _IO_COMPLETION_INFORMATION_CLASS;
  1634. TIoCompletionInformationClass = IO_COMPLETION_INFORMATION_CLASS;
  1635. type
  1636. _IO_COMPLETION_BASIC_INFORMATION = record
  1637. SignalState: LONG;
  1638. end;
  1639. IO_COMPLETION_BASIC_INFORMATION = _IO_COMPLETION_BASIC_INFORMATION;
  1640. PIO_COMPLETION_BASIC_INFORMATION = ^IO_COMPLETION_BASIC_INFORMATION;
  1641. TIoCompletionBasicInformation = IO_COMPLETION_BASIC_INFORMATION;
  1642. PIoCompletionBasicInformation = ^TIoCompletionBasicInformation;
  1643. type
  1644. _PORT_MESSAGE = record
  1645. DataSize: USHORT;
  1646. MessageSize: USHORT;
  1647. MessageType: USHORT;
  1648. VirtualRangesOffset: USHORT;
  1649. ClientId: CLIENT_ID;
  1650. MessageId: ULONG;
  1651. SectionSize: ULONG;
  1652. // UCHAR Data[];
  1653. end;
  1654. PORT_MESSAGE = _PORT_MESSAGE;
  1655. PPORT_MESSAGE = ^PORT_MESSAGE;
  1656. TPortMessage = PORT_MESSAGE;
  1657. PPortMessage = ^TPortMessage;
  1658. _LPC_TYPE = (
  1659. LPC_NEW_MESSAGE, // A new message
  1660. LPC_REQUEST, // A request message
  1661. LPC_REPLY, // A reply to a request message
  1662. LPC_DATAGRAM, //
  1663. LPC_LOST_REPLY, //
  1664. LPC_PORT_CLOSED, // Sent when port is deleted
  1665. LPC_CLIENT_DIED, // Messages to thread termination ports
  1666. LPC_EXCEPTION, // Messages to thread exception port
  1667. LPC_DEBUG_EVENT, // Messages to thread debug port
  1668. LPC_ERROR_EVENT, // Used by ZwRaiseHardError
  1669. LPC_CONNECTION_REQUEST); // Used by ZwConnectPort
  1670. LPC_TYPE = _LPC_TYPE;
  1671. TLpcType = LPC_TYPE;
  1672. _PORT_SECTION_WRITE = record
  1673. Length: ULONG;
  1674. SectionHandle: HANDLE;
  1675. SectionOffset: ULONG;
  1676. ViewSize: ULONG;
  1677. ViewBase: PVOID;
  1678. TargetViewBase: PVOID;
  1679. end;
  1680. PORT_SECTION_WRITE = _PORT_SECTION_WRITE;
  1681. PPORT_SECTION_WRITE = ^PORT_SECTION_WRITE;
  1682. TPortSectionWrite = PORT_SECTION_WRITE;
  1683. PPortSectionWrite = ^TPortSectionWrite;
  1684. _PORT_SECTION_READ = record
  1685. Length: ULONG;
  1686. ViewSize: ULONG;
  1687. ViewBase: ULONG;
  1688. end;
  1689. PORT_SECTION_READ = _PORT_SECTION_READ;
  1690. PPORT_SECTION_READ = ^PORT_SECTION_READ;
  1691. TPortSectionRead = PORT_SECTION_READ;
  1692. PPortSectionRead = ^TPortSectionRead;
  1693. type
  1694. _PORT_INFORMATION_CLASS = (PortBasicInformation);
  1695. PORT_INFORMATION_CLASS = _PORT_INFORMATION_CLASS;
  1696. TPortInformationClass = PORT_INFORMATION_CLASS;
  1697. type
  1698. _PORT_BASIC_INFORMATION = record
  1699. end;
  1700. PORT_BASIC_INFORMATION = _PORT_BASIC_INFORMATION;
  1701. PPORT_BASIC_INFORMATION = ^PORT_BASIC_INFORMATION;
  1702. TPortBasicInformation = PORT_BASIC_INFORMATION;
  1703. PPortBasicInformation = ^TPortBasicInformation;
  1704. type
  1705. _FILE_GET_EA_INFORMATION = record
  1706. NextEntryOffset: ULONG;
  1707. EaNameLength: UCHAR;
  1708. EaName: array[0..0] of CHAR;
  1709. end;
  1710. FILE_GET_EA_INFORMATION = _FILE_GET_EA_INFORMATION;
  1711. PFILE_GET_EA_INFORMATION = ^FILE_GET_EA_INFORMATION;
  1712. TFileGetEaInformation = FILE_GET_EA_INFORMATION;
  1713. PFileGetEaInformation = ^TFileGetEaInformation;
  1714. type
  1715. _FILE_FS_VOLUME_INFORMATION = record
  1716. VolumeCreationTime: LARGE_INTEGER;
  1717. VolumeSerialNumber: ULONG;
  1718. VolumeLabelLength: ULONG;
  1719. Unknown: UCHAR;
  1720. VolumeLabel: array[0..0] of WCHAR;
  1721. end;
  1722. FILE_FS_VOLUME_INFORMATION = _FILE_FS_VOLUME_INFORMATION;
  1723. PFILE_FS_VOLUME_INFORMATION = ^FILE_FS_VOLUME_INFORMATION;
  1724. TFileFsVolumeInformation = FILE_FS_VOLUME_INFORMATION;
  1725. PFileFsVolumeInformation = ^TFileFsVolumeInformation;
  1726. _FILE_FS_LABEL_INFORMATION = record
  1727. VolumeLabelLength: ULONG;
  1728. VolumeLabel: WCHAR;
  1729. end;
  1730. FILE_FS_LABEL_INFORMATION = _FILE_FS_LABEL_INFORMATION;
  1731. PFILE_FS_LABEL_INFORMATION = ^FILE_FS_LABEL_INFORMATION;
  1732. TFileFsLabelInformation = FILE_FS_LABEL_INFORMATION;
  1733. PFileFsLabelInformation = ^TFileFsLabelInformation;
  1734. _FILE_FS_SIZE_INFORMATION = record
  1735. TotalAllocationUnits: LARGE_INTEGER;
  1736. AvailableAllocationUnits: LARGE_INTEGER;
  1737. SectorsPerAllocationUnit: ULONG;
  1738. BytesPerSector: ULONG;
  1739. end;
  1740. FILE_FS_SIZE_INFORMATION = _FILE_FS_SIZE_INFORMATION;
  1741. PFILE_FS_SIZE_INFORMATION = ^FILE_FS_SIZE_INFORMATION;
  1742. TFileFsSizeInformation = FILE_FS_SIZE_INFORMATION;
  1743. PFileFsSizeInformation = ^TFileFsSizeInformation;
  1744. _FILE_FS_ATTRIBUTE_INFORMATION = record
  1745. FileSystemFlags: ULONG;
  1746. MaximumComponentNameLength: ULONG;
  1747. FileSystemNameLength: ULONG;
  1748. FileSystemName: array[0..0] of WCHAR;
  1749. end;
  1750. FILE_FS_ATTRIBUTE_INFORMATION = _FILE_FS_ATTRIBUTE_INFORMATION;
  1751. PFILE_FS_ATTRIBUTE_INFORMATION = ^FILE_FS_ATTRIBUTE_INFORMATION;
  1752. TFileFsAttributeInformation = FILE_FS_ATTRIBUTE_INFORMATION;
  1753. PFileFsAttributeInformation = ^TFileFsAttributeInformation;
  1754. _FILE_FS_CONTROL_INFORMATION = record
  1755. Reserved: array[0..2] of LARGE_INTEGER;
  1756. DefaultQuotaThreshold: LARGE_INTEGER;
  1757. DefaultQuotaLimit: LARGE_INTEGER;
  1758. QuotaFlags: ULONG;
  1759. end;
  1760. FILE_FS_CONTROL_INFORMATION = _FILE_FS_CONTROL_INFORMATION;
  1761. PFILE_FS_CONTROL_INFORMATION = ^FILE_FS_CONTROL_INFORMATION;
  1762. TFileFsControlInformation = FILE_FS_CONTROL_INFORMATION;
  1763. PFileFsControlInformation = ^TFileFsControlInformation;
  1764. _FILE_FS_FULL_SIZE_INFORMATION = record
  1765. TotalQuotaAllocationUnits: LARGE_INTEGER;
  1766. AvailableQuotaAllocationUnits: LARGE_INTEGER;
  1767. AvailableAllocationUnits: LARGE_INTEGER;
  1768. SectorsPerAllocationUnit: ULONG;
  1769. BytesPerSector: ULONG;
  1770. end;
  1771. FILE_FS_FULL_SIZE_INFORMATION = _FILE_FS_FULL_SIZE_INFORMATION;
  1772. PFILE_FS_FULL_SIZE_INFORMATION = ^FILE_FS_FULL_SIZE_INFORMATION;
  1773. TFileFsFullSizeInformation = FILE_FS_FULL_SIZE_INFORMATION;
  1774. PFileFsFullSizeInformation = ^TFileFsFullSizeInformation;
  1775. _FILE_FS_OBJECT_ID_INFORMATION = record
  1776. VolumeObjectId: UUID;
  1777. VolumeObjectIdExtendedInfo: array[0..11] of ULONG;
  1778. end;
  1779. FILE_FS_OBJECT_ID_INFORMATION = _FILE_FS_OBJECT_ID_INFORMATION;
  1780. PFILE_FS_OBJECT_ID_INFORMATION = ^FILE_FS_OBJECT_ID_INFORMATION;
  1781. TFileFsObjectIdInformation = FILE_FS_OBJECT_ID_INFORMATION;
  1782. PFileFsObjectIdInformation = ^TFileFsObjectIdInformation;
  1783. _FILE_USER_QUOTA_INFORMATION = record
  1784. NextEntryOffset: ULONG;
  1785. SidLength: ULONG;
  1786. ChangeTime: LARGE_INTEGER;
  1787. QuotaUsed: LARGE_INTEGER;
  1788. QuotaThreshold: LARGE_INTEGER;
  1789. QuotaLimit: LARGE_INTEGER;
  1790. Sid: array[0..0] of SID;
  1791. end;
  1792. FILE_USER_QUOTA_INFORMATION = _FILE_USER_QUOTA_INFORMATION;
  1793. PFILE_USER_QUOTA_INFORMATION = ^FILE_USER_QUOTA_INFORMATION;
  1794. TFileUserQuotaInformation = FILE_USER_QUOTA_INFORMATION;
  1795. PFileUserQuotaInformation = ^TFileUserQuotaInformation;
  1796. _FILE_QUOTA_LIST_INFORMATION = record
  1797. NextEntryOffset: ULONG;
  1798. SidLength: ULONG;
  1799. Sid: array[0..0] of SID;
  1800. end;
  1801. FILE_QUOTA_LIST_INFORMATION = _FILE_QUOTA_LIST_INFORMATION;
  1802. PFILE_QUOTA_LIST_INFORMATION = ^FILE_QUOTA_LIST_INFORMATION;
  1803. TFileQuotaListInformation = FILE_QUOTA_LIST_INFORMATION;
  1804. PFileQuotaListInformation = ^TFileQuotaListInformation;
  1805. type
  1806. _FILE_DIRECTORY_INFORMATION = record // Information Class 1
  1807. NextEntryOffset: ULONG;
  1808. Unknown: ULONG;
  1809. CreationTime: LARGE_INTEGER;
  1810. LastAccessTime: LARGE_INTEGER;
  1811. LastWriteTime: LARGE_INTEGER;
  1812. ChangeTime: LARGE_INTEGER;
  1813. EndOfFile: LARGE_INTEGER;
  1814. AllocationSize: LARGE_INTEGER;
  1815. FileAttributes: ULONG;
  1816. FileNameLength: ULONG;
  1817. FileName: array[0..0] of WCHAR;
  1818. end;
  1819. FILE_DIRECTORY_INFORMATION = _FILE_DIRECTORY_INFORMATION;
  1820. PFILE_DIRECTORY_INFORMATION = ^FILE_DIRECTORY_INFORMATION;
  1821. TFileDirectoryInformation = FILE_DIRECTORY_INFORMATION;
  1822. PFileDirectoryInformation = ^TFileDirectoryInformation;
  1823. _FILE_FULL_DIRECTORY_INFORMATION = record // Information Class 2
  1824. NextEntryOffset: ULONG;
  1825. Unknown: ULONG;
  1826. CreationTime: LARGE_INTEGER;
  1827. LastAccessTime: LARGE_INTEGER;
  1828. LastWriteTime: LARGE_INTEGER;
  1829. ChangeTime: LARGE_INTEGER;
  1830. EndOfFile: LARGE_INTEGER;
  1831. AllocationSize: LARGE_INTEGER;
  1832. FileAttributes: ULONG;
  1833. FileNameLength: ULONG;
  1834. EaInformationLength: ULONG;
  1835. FileName: array[0..0] of WCHAR;
  1836. end;
  1837. FILE_FULL_DIRECTORY_INFORMATION = _FILE_FULL_DIRECTORY_INFORMATION;
  1838. PFILE_FULL_DIRECTORY_INFORMATION = ^FILE_FULL_DIRECTORY_INFORMATION;
  1839. TFileFullDirectoryInformation = FILE_FULL_DIRECTORY_INFORMATION;
  1840. PFileFullDirectoryInformation = ^TFileFullDirectoryInformation;
  1841. _FILE_BOTH_DIRECTORY_INFORMATION = record // Information Class 3
  1842. NextEntryOffset: ULONG;
  1843. Unknown: ULONG;
  1844. CreationTime: LARGE_INTEGER;
  1845. LastAccessTime: LARGE_INTEGER;
  1846. LastWriteTime: LARGE_INTEGER;
  1847. ChangeTime: LARGE_INTEGER;
  1848. EndOfFile: LARGE_INTEGER;
  1849. AllocationSize: LARGE_INTEGER;
  1850. FileAttributes: ULONG;
  1851. FileNameLength: ULONG;
  1852. EaInformationLength: ULONG;
  1853. AlternateNameLength: UCHAR;
  1854. AlternateName: array[0..11] of WCHAR;
  1855. FileName: array[0..0] of WCHAR;
  1856. end;
  1857. FILE_BOTH_DIRECTORY_INFORMATION = _FILE_BOTH_DIRECTORY_INFORMATION;
  1858. PFILE_BOTH_DIRECTORY_INFORMATION = ^FILE_BOTH_DIRECTORY_INFORMATION;
  1859. TFileBothDirectoryInformation = FILE_BOTH_DIRECTORY_INFORMATION;
  1860. PFileBothDirectoryInformation = ^TFileBothDirectoryInformation;
  1861. _FILE_INTERNAL_INFORMATION = record // Information Class 6
  1862. FileId: LARGE_INTEGER;
  1863. end;
  1864. FILE_INTERNAL_INFORMATION = _FILE_INTERNAL_INFORMATION;
  1865. PFILE_INTERNAL_INFORMATION = ^FILE_INTERNAL_INFORMATION;
  1866. TFileInternalInformation = FILE_INTERNAL_INFORMATION;
  1867. PFileInternalInformation = ^TFileInternalInformation;
  1868. _FILE_EA_INFORMATION = record // Information Class 7
  1869. EaInformationLength: ULONG;
  1870. end;
  1871. FILE_EA_INFORMATION = _FILE_EA_INFORMATION;
  1872. PFILE_EA_INFORMATION = ^FILE_EA_INFORMATION;
  1873. TFileEaInformation = FILE_EA_INFORMATION;
  1874. PFileEaInformation = ^TFileEaInformation;
  1875. _FILE_ACCESS_INFORMATION = record // Information Class 8
  1876. GrantedAccess: ACCESS_MASK;
  1877. end;
  1878. FILE_ACCESS_INFORMATION = _FILE_ACCESS_INFORMATION;
  1879. PFILE_ACCESS_INFORMATION = ^FILE_ACCESS_INFORMATION;
  1880. TFileAccessInformation = FILE_ACCESS_INFORMATION;
  1881. PFileAccessInformation = ^TFileAccessInformation;
  1882. _FILE_NAME_INFORMATION = record // Information Classes 9 and 21
  1883. FileNameLength: ULONG;
  1884. FileName: array[0..0] of WCHAR;
  1885. end;
  1886. FILE_NAME_INFORMATION = _FILE_NAME_INFORMATION;
  1887. PFILE_NAME_INFORMATION = ^FILE_NAME_INFORMATION;
  1888. FILE_ALTERNATE_NAME_INFORMATION = _FILE_NAME_INFORMATION;
  1889. PFILE_ALTERNATE_NAME_INFORMATION = ^FILE_ALTERNATE_NAME_INFORMATION;
  1890. TFileNameInformation = FILE_NAME_INFORMATION;
  1891. PFileNameInformation = ^TFileNameInformation;
  1892. _FILE_LINK_RENAME_INFORMATION = record // Info Classes 10 and 11
  1893. ReplaceIfExists: ByteBool;
  1894. RootDirectory: HANDLE;
  1895. FileNameLength: ULONG;
  1896. FileName: array[0..0] of WCHAR;
  1897. end;
  1898. FILE_LINK_INFORMATION = _FILE_LINK_RENAME_INFORMATION;
  1899. PFILE_LINK_INFORMATION = ^FILE_LINK_INFORMATION;
  1900. FILE_RENAME_INFORMATION = _FILE_LINK_RENAME_INFORMATION;
  1901. PFILE_RENAME_INFORMATION = ^FILE_RENAME_INFORMATION;
  1902. TFileLinkInformation = FILE_LINK_INFORMATION;
  1903. PFileLinkInformation = ^TFileLinkInformation;
  1904. _FILE_NAMES_INFORMATION = record // Information Class 12
  1905. NextEntryOffset: ULONG;
  1906. Unknown: ULONG;
  1907. FileNameLength: ULONG;
  1908. FileName: array[0..0] of WCHAR;
  1909. end;
  1910. FILE_NAMES_INFORMATION = _FILE_NAMES_INFORMATION;
  1911. PFILE_NAMES_INFORMATION = ^FILE_NAMES_INFORMATION;
  1912. TFileNamesInformation = FILE_NAMES_INFORMATION;
  1913. PFileNamesInformation = ^TFileNamesInformation;
  1914. _FILE_MODE_INFORMATION = record // Information Class 16
  1915. Mode: ULONG;
  1916. end;
  1917. FILE_MODE_INFORMATION = _FILE_MODE_INFORMATION;
  1918. PFILE_MODE_INFORMATION = ^FILE_MODE_INFORMATION;
  1919. TFileModeInformation = FILE_MODE_INFORMATION;
  1920. PFileModeInformation = ^TFileModeInformation;
  1921. _FILE_ALL_INFORMATION = record // Information Class 18
  1922. BasicInformation: FILE_BASIC_INFORMATION;
  1923. StandardInformation: FILE_STANDARD_INFORMATION;
  1924. InternalInformation: FILE_INTERNAL_INFORMATION;
  1925. EaInformation: FILE_EA_INFORMATION;
  1926. AccessInformation: FILE_ACCESS_INFORMATION;
  1927. PositionInformation: FILE_POSITION_INFORMATION;
  1928. ModeInformation: FILE_MODE_INFORMATION;
  1929. AlignmentInformation: FILE_ALIGNMENT_INFORMATION;
  1930. NameInformation: FILE_NAME_INFORMATION;
  1931. end;
  1932. FILE_ALL_INFORMATION = _FILE_ALL_INFORMATION;
  1933. PFILE_ALL_INFORMATION = ^FILE_ALL_INFORMATION;
  1934. TFileAllInformation = FILE_ALL_INFORMATION;
  1935. PFileAllInformation = ^TFileAllInformation;
  1936. _FILE_ALLOCATION_INFORMATION = record // Information Class 19
  1937. AllocationSize: LARGE_INTEGER;
  1938. end;
  1939. FILE_ALLOCATION_INFORMATION = _FILE_ALLOCATION_INFORMATION;
  1940. PFILE_ALLOCATION_INFORMATION = ^FILE_ALLOCATION_INFORMATION;
  1941. TFileAllocationInformation = FILE_ALLOCATION_INFORMATION;
  1942. PFileAllocationInformation = ^TFileAllocationInformation;
  1943. _FILE_STREAM_INFORMATION = record // Information Class 22
  1944. NextEntryOffset: ULONG;
  1945. StreamNameLength: ULONG;
  1946. EndOfStream: LARGE_INTEGER;
  1947. AllocationSize: LARGE_INTEGER;
  1948. StreamName: array[0..0] of WCHAR;
  1949. end;
  1950. FILE_STREAM_INFORMATION = _FILE_STREAM_INFORMATION;
  1951. PFILE_STREAM_INFORMATION = ^FILE_STREAM_INFORMATION;
  1952. TFileStreamInformation = FILE_STREAM_INFORMATION;
  1953. PFileStreamInformation = ^TFileStreamInformation;
  1954. _FILE_PIPE_INFORMATION = record // Information Class 23
  1955. ReadModeMessage: ULONG;
  1956. WaitModeBlocking: ULONG;
  1957. end;
  1958. FILE_PIPE_INFORMATION = _FILE_PIPE_INFORMATION;
  1959. PFILE_PIPE_INFORMATION = ^FILE_PIPE_INFORMATION;
  1960. TFilePipeInformation = FILE_PIPE_INFORMATION;
  1961. PFilePipeInformation = ^TFilePipeInformation;
  1962. _FILE_PIPE_LOCAL_INFORMATION = record // Information Class 24
  1963. MessageType: ULONG;
  1964. Unknown1: ULONG;
  1965. MaxInstances: ULONG;
  1966. CurInstances: ULONG;
  1967. InBufferSize: ULONG;
  1968. Unknown2: ULONG;
  1969. OutBufferSize: ULONG;
  1970. Unknown3: array[0..1] of ULONG;
  1971. ServerEnd: ULONG;
  1972. end;
  1973. FILE_PIPE_LOCAL_INFORMATION = _FILE_PIPE_LOCAL_INFORMATION;
  1974. PFILE_PIPE_LOCAL_INFORMATION = ^FILE_PIPE_LOCAL_INFORMATION;
  1975. TFilePipeLocalInformation = FILE_PIPE_LOCAL_INFORMATION;
  1976. PFilePipeLocalInformation = ^TFilePipeLocalInformation;
  1977. _FILE_PIPE_REMOTE_INFORMATION = record // Information Class 25
  1978. CollectDataTimeout: LARGE_INTEGER;
  1979. MaxCollectionCount: ULONG;
  1980. end;
  1981. FILE_PIPE_REMOTE_INFORMATION = _FILE_PIPE_REMOTE_INFORMATION;
  1982. PFILE_PIPE_REMOTE_INFORMATION = ^FILE_PIPE_REMOTE_INFORMATION;
  1983. TFilePipeRemoteInformation = FILE_PIPE_REMOTE_INFORMATION;
  1984. PFilePipeRemoteInformation = ^TFilePipeRemoteInformation;
  1985. _FILE_MAILSLOT_QUERY_INFORMATION = record // Information Class 26
  1986. MaxMessageSize: ULONG;
  1987. Unknown: ULONG;
  1988. NextSize: ULONG;
  1989. MessageCount: ULONG;
  1990. ReadTimeout: LARGE_INTEGER;
  1991. end;
  1992. FILE_MAILSLOT_QUERY_INFORMATION = _FILE_MAILSLOT_QUERY_INFORMATION;
  1993. PFILE_MAILSLOT_QUERY_INFORMATION = ^FILE_MAILSLOT_QUERY_INFORMATION;
  1994. TFileMailslotQueryInformation = FILE_MAILSLOT_QUERY_INFORMATION;
  1995. PFileMailslotQueryInformation = ^TFileMailslotQueryInformation;
  1996. _FILE_MAILSLOT_SET_INFORMATION = record // Information Class 27
  1997. ReadTimeout: LARGE_INTEGER;
  1998. end;
  1999. FILE_MAILSLOT_SET_INFORMATION = _FILE_MAILSLOT_SET_INFORMATION;
  2000. PFILE_MAILSLOT_SET_INFORMATION = ^FILE_MAILSLOT_SET_INFORMATION;
  2001. TFileMailslotSetInformation = FILE_MAILSLOT_SET_INFORMATION;
  2002. PFileMailslotSetInformation = ^TFileMailslotSetInformation;
  2003. _FILE_COMPRESSION_INFORMATION = record // Information Class 28
  2004. CompressedSize: LARGE_INTEGER;
  2005. CompressionFormat: USHORT;
  2006. CompressionUnitShift: UCHAR;
  2007. Unknown: UCHAR;
  2008. ClusterSizeShift: UCHAR;
  2009. end;
  2010. FILE_COMPRESSION_INFORMATION = _FILE_COMPRESSION_INFORMATION;
  2011. PFILE_COMPRESSION_INFORMATION = ^FILE_COMPRESSION_INFORMATION;
  2012. TFileCompressionInformation = FILE_COMPRESSION_INFORMATION;
  2013. PFileCompressionInformation = ^TFileCompressionInformation;
  2014. _FILE_COMPLETION_INFORMATION = record // Information Class 30
  2015. IoCompletionHandle: HANDLE;
  2016. CompletionKey: ULONG;
  2017. end;
  2018. FILE_COMPLETION_INFORMATION = _FILE_COMPLETION_INFORMATION;
  2019. PFILE_COMPLETION_INFORMATION = ^FILE_COMPLETION_INFORMATION;
  2020. TFileCompletionInformation = FILE_COMPLETION_INFORMATION;
  2021. PFileCompletionInformation = ^TFileCompletionInformation;
  2022. type
  2023. PEXECUTION_STATE = ^EXECUTION_STATE;
  2024. PExecutionState = PEXECUTION_STATE;
  2025. {$IFNDEF JWA_INCLUDEMODE}
  2026. type
  2027. PLANGID = ^LANGID;
  2028. {$ENDIF JWA_INCLUDEMODE}
  2029. type
  2030. _ATOM_INFORMATION_CLASS = (AtomBasicInformation, AtomListInformation);
  2031. ATOM_INFORMATION_CLASS = _ATOM_INFORMATION_CLASS;
  2032. TAtomInformationClass = ATOM_INFORMATION_CLASS;
  2033. type
  2034. _ATOM_BASIC_INFORMATION = record
  2035. ReferenceCount: USHORT;
  2036. Pinned: USHORT;
  2037. NameLength: USHORT;
  2038. Name: array[0..0] of WCHAR;
  2039. end;
  2040. ATOM_BASIC_INFORMATION = _ATOM_BASIC_INFORMATION;
  2041. PATOM_BASIC_INFORMATION = ^ATOM_BASIC_INFORMATION;
  2042. TAtomBasicInformation = ATOM_BASIC_INFORMATION;
  2043. PAtomBasicInformation = ^TAtomBasicInformation;
  2044. _ATOM_LIST_INFORMATION = record
  2045. NumberOfAtoms: ULONG;
  2046. Atoms: array[0..0] of ATOM;
  2047. end;
  2048. ATOM_LIST_INFORMATION = _ATOM_LIST_INFORMATION;
  2049. PATOM_LIST_INFORMATION = ^ATOM_LIST_INFORMATION;
  2050. TAtomListInformation = ATOM_LIST_INFORMATION;
  2051. PAtomListInformation = ^TAtomListInformation;
  2052. //==============================================================================
  2053. // NTFS on disk structure structures
  2054. //==============================================================================
  2055. type
  2056. _NTFS_RECORD_HEADER = record
  2057. Type_: ULONG;
  2058. UsaOffset: USHORT;
  2059. UsaCount: USHORT;
  2060. Usn: USN;
  2061. end;
  2062. NTFS_RECORD_HEADER = _NTFS_RECORD_HEADER;
  2063. PNTFS_RECORD_HEADER = ^NTFS_RECORD_HEADER;
  2064. TNtfsRecordHeader = NTFS_RECORD_HEADER;
  2065. PNtfsRecordHeader = ^TNtfsRecordHeader;
  2066. _FILE_RECORD_HEADER = record
  2067. Ntfs: NTFS_RECORD_HEADER;
  2068. SequenceNumber: USHORT;
  2069. LinkCount: USHORT;
  2070. AttributesOffset: USHORT;
  2071. Flags: USHORT; // 0x0001 = InUse, 0x0002 = Directory
  2072. BytesInUse: ULONG;
  2073. BytesAllocated: ULONG;
  2074. BaseFileRecord: ULONGLONG;
  2075. NextAttributeNumber: USHORT;
  2076. end;
  2077. FILE_RECORD_HEADER = _FILE_RECORD_HEADER;
  2078. PFILE_RECORD_HEADER = ^FILE_RECORD_HEADER;
  2079. TFileRecordHeader = FILE_RECORD_HEADER;
  2080. PFileRecordHeader = ^TFileRecordHeader;
  2081. const
  2082. AttributeStandardInformation = $10;
  2083. AttributeAttributeList = $20;
  2084. AttributeFileName = $30;
  2085. AttributeObjectId = $40;
  2086. AttributeSecurityDescriptor = $50;
  2087. AttributeVolumeName = $60;
  2088. AttributeVolumeInformation = $70;
  2089. AttributeData = $80;
  2090. AttributeIndexRoot = $90;
  2091. AttributeIndexAllocation = $A0;
  2092. AttributeBitmap = $B0;
  2093. AttributeReparsePoint = $C0;
  2094. AttributeEAInformation = $D0;
  2095. AttributeEA = $E0;
  2096. AttributePropertySet = $F0;
  2097. AttributeLoggedUtilityStream = $100;
  2098. type
  2099. ATTRIBUTE_TYPE = AttributeStandardInformation..AttributeLoggedUtilityStream;
  2100. PATTRIBUTE_TYPE = ^ATTRIBUTE_TYPE;
  2101. TAttributeType = ATTRIBUTE_TYPE;
  2102. _ATTRIBUTE = record
  2103. AttributeType: ATTRIBUTE_TYPE;
  2104. Length: ULONG;
  2105. Nonresident: ByteBool;
  2106. NameLength: UCHAR;
  2107. NameOffset: USHORT;
  2108. Flags: USHORT; // 0x0001 = Compressed
  2109. AttributeNumber: USHORT;
  2110. end;
  2111. ATTRIBUTE = _ATTRIBUTE;
  2112. PATTRIBUTE = ^ATTRIBUTE;
  2113. TAttribute = ATTRIBUTE;
  2114. _RESIDENT_ATTRIBUTE = record
  2115. Attribute: ATTRIBUTE;
  2116. ValueLength: ULONG;
  2117. ValueOffset: USHORT;
  2118. Flags: USHORT; // 0x0001 = Indexed
  2119. end;
  2120. RESIDENT_ATTRIBUTE = _RESIDENT_ATTRIBUTE;
  2121. PRESIDENT_ATTRIBUTE = ^RESIDENT_ATTRIBUTE;
  2122. TResidentAttribute = RESIDENT_ATTRIBUTE;
  2123. PResidentAttribute = ^TResidentAttribute;
  2124. _NONRESIDENT_ATTRIBUTE = record
  2125. Attribute: ATTRIBUTE;
  2126. LowVcn: ULONGLONG;
  2127. HighVcn: ULONGLONG;
  2128. RunArrayOffset: USHORT;
  2129. CompressionUnit: UCHAR;
  2130. AlignmentOrReserved: array[0..4] of UCHAR;
  2131. AllocatedSize: ULONGLONG;
  2132. DataSize: ULONGLONG;
  2133. InitializedSize: ULONGLONG;
  2134. CompressedSize: ULONGLONG; // Only when compressed
  2135. end;
  2136. NONRESIDENT_ATTRIBUTE = _NONRESIDENT_ATTRIBUTE;
  2137. PNONRESIDENT_ATTRIBUTE = ^NONRESIDENT_ATTRIBUTE;
  2138. TNonResidentAttribute = NONRESIDENT_ATTRIBUTE;
  2139. PNonResidentAttribute = ^TNonResidentAttribute;
  2140. _STANDARD_INFORMATION = record
  2141. CreationTime: ULONGLONG;
  2142. ChangeTime: ULONGLONG;
  2143. LastWriteTime: ULONGLONG;
  2144. LastAccessTime: ULONGLONG;
  2145. FileAttributes: ULONG;
  2146. AlignmentOrReservedOrUnknown: array[0..2] of ULONG;
  2147. QuotaId: ULONG; // NTFS 3.0 only
  2148. SecurityId: ULONG; // NTFS 3.0 only
  2149. QuotaCharge: ULONGLONG; // NTFS 3.0 only
  2150. Usn: USN; // NTFS 3.0 only
  2151. end;
  2152. STANDARD_INFORMATION = _STANDARD_INFORMATION;
  2153. PSTANDARD_INFORMATION = ^STANDARD_INFORMATION;
  2154. TStandardInformation = STANDARD_INFORMATION;
  2155. PStandardInformation = ^TStandardInformation;
  2156. _ATTRIBUTE_LIST = record
  2157. AttributeType: ATTRIBUTE_TYPE;
  2158. Length: USHORT;
  2159. NameLength: UCHAR;
  2160. NameOffset: UCHAR;
  2161. LowVcn: ULONGLONG;
  2162. FileReferenceNumber: ULONGLONG;
  2163. AttributeNumber: USHORT;
  2164. AlignmentOrReserved: array[0..2] of USHORT;
  2165. end;
  2166. ATTRIBUTE_LIST = _ATTRIBUTE_LIST;
  2167. PATTRIBUTE_LIST = ^ATTRIBUTE_LIST;
  2168. TAttributeList = ATTRIBUTE_LIST;
  2169. PAttributeList = ^TAttributeList;
  2170. _FILENAME_ATTRIBUTE = record
  2171. DirectoryFileReferenceNumber: ULONGLONG;
  2172. CreationTime: ULONGLONG; // Saved when filename last changed
  2173. ChangeTime: ULONGLONG; // ditto
  2174. LastWriteTime: ULONGLONG; // ditto
  2175. LastAccessTime: ULONGLONG; // ditto
  2176. AllocatedSize: ULONGLONG; // ditto
  2177. DataSize: ULONGLONG; // ditto
  2178. FileAttributes: ULONG; // ditto
  2179. AlignmentOrReserved: ULONG;
  2180. NameLength: UCHAR;
  2181. NameType: UCHAR; // 0x01 = Long, 0x02 = Short
  2182. Name: array[0..0] of UCHAR;
  2183. end;
  2184. FILENAME_ATTRIBUTE = _FILENAME_ATTRIBUTE;
  2185. PFILENAME_ATTRIBUTE = ^FILENAME_ATTRIBUTE;
  2186. TFilenameAttribute = FILENAME_ATTRIBUTE;
  2187. PFilenameAttribute = ^TFilenameAttribute;
  2188. _OBJECTID_ATTRIBUTE = record
  2189. ObjectId: GUID;
  2190. case Integer of
  2191. 0: (
  2192. BirthVolumeId: GUID;
  2193. BirthObjectId: GUID;
  2194. DomainId: GUID);
  2195. 1: (
  2196. ExtendedInfo: array[0..47] of UCHAR
  2197. );
  2198. end;
  2199. OBJECTID_ATTRIBUTE = _OBJECTID_ATTRIBUTE;
  2200. POBJECTID_ATTRIBUTE = ^OBJECTID_ATTRIBUTE;
  2201. TObjectIdAttribute = OBJECTID_ATTRIBUTE;
  2202. PObjectIdAttribute = ^TObjectIdAttribute;
  2203. _VOLUME_INFORMATION = record
  2204. Unknown: array[0..1] of ULONG;
  2205. MajorVersion: UCHAR;
  2206. MinorVersion: UCHAR;
  2207. Flags: USHORT;
  2208. end;
  2209. VOLUME_INFORMATION = _VOLUME_INFORMATION;
  2210. PVOLUME_INFORMATION = ^VOLUME_INFORMATION;
  2211. TVolumeInformation = VOLUME_INFORMATION;
  2212. PVolumeInformation = ^TVolumeInformation;
  2213. _DIRECTORY_INDEX = record
  2214. EntriesOffset: ULONG;
  2215. IndexBlockLength: ULONG;
  2216. AllocatedSize: ULONG;
  2217. Flags: ULONG; // 0x00 = Small directory, 0x01 = Large directory
  2218. end;
  2219. DIRECTORY_INDEX = _DIRECTORY_INDEX;
  2220. PDIRECTORY_INDEX = ^DIRECTORY_INDEX;
  2221. TDirectoryIndex = DIRECTORY_INDEX;
  2222. PDirectoryIndex = ^TDirectoryIndex;
  2223. _DIRECTORY_ENTRY = record
  2224. FileReferenceNumber: ULONGLONG;
  2225. Length: USHORT;
  2226. AttributeLength: USHORT;
  2227. Flags: ULONG; // 0x01 = Has trailing VCN, 0x02 = Last entry
  2228. // FILENAME_ATTRIBUTE Name;
  2229. // ULONGLONG Vcn; // VCN in IndexAllocation of earlier entries
  2230. end;
  2231. DIRECTORY_ENTRY = _DIRECTORY_ENTRY;
  2232. PDIRECTORY_ENTRY = ^DIRECTORY_ENTRY;
  2233. TDirectoryEntry = DIRECTORY_ENTRY;
  2234. PDirectoryEntry = ^TDirectoryEntry;
  2235. _INDEX_ROOT = record
  2236. Type_: ATTRIBUTE_TYPE;
  2237. CollationRule: ULONG;
  2238. BytesPerIndexBlock: ULONG;
  2239. ClustersPerIndexBlock: ULONG;
  2240. DirectoryIndex: DIRECTORY_INDEX;
  2241. end;
  2242. INDEX_ROOT = _INDEX_ROOT;
  2243. PINDEX_ROOT = ^INDEX_ROOT;
  2244. TIndexRoot = INDEX_ROOT;
  2245. PIndexRoot = ^TIndexRoot;
  2246. _INDEX_BLOCK_HEADER = record
  2247. Ntfs: NTFS_RECORD_HEADER;
  2248. IndexBlockVcn: ULONGLONG;
  2249. DirectoryIndex: DIRECTORY_INDEX;
  2250. end;
  2251. INDEX_BLOCK_HEADER = _INDEX_BLOCK_HEADER;
  2252. PINDEX_BLOCK_HEADER = ^INDEX_BLOCK_HEADER;
  2253. TIndexBlockHeader = _INDEX_BLOCK_HEADER;
  2254. PIndexBlockHeader = ^TIndexBlockHeader;
  2255. _REPARSE_POINT = record
  2256. ReparseTag: ULONG;
  2257. ReparseDataLength: USHORT;
  2258. Reserved: USHORT;
  2259. ReparseData: array[0..0] of UCHAR;
  2260. end;
  2261. REPARSE_POINT = _REPARSE_POINT;
  2262. PREPARSE_POINT = ^REPARSE_POINT;
  2263. TReparsePoint = REPARSE_POINT;
  2264. PReparsePoint = ^TReparsePoint;
  2265. _EA_INFORMATION = record
  2266. EaLength: ULONG;
  2267. EaQueryLength: ULONG;
  2268. end;
  2269. EA_INFORMATION = _EA_INFORMATION;
  2270. PEA_INFORMATION = ^EA_INFORMATION;
  2271. TEaInformation = EA_INFORMATION;
  2272. PEaInformation = ^TEaInformation;
  2273. _EA_ATTRIBUTE = record
  2274. NextEntryOffset: ULONG;
  2275. Flags: UCHAR;
  2276. EaNameLength: UCHAR;
  2277. EaValueLength: USHORT;
  2278. EaName: array[0..0] of CHAR;
  2279. // UCHAR EaData[];
  2280. end;
  2281. EA_ATTRIBUTE = _EA_ATTRIBUTE;
  2282. PEA_ATTRIBUTE = ^EA_ATTRIBUTE;
  2283. TEaAttribute = EA_ATTRIBUTE;
  2284. PEaAttribute = ^TEaAttribute;
  2285. _ATTRIBUTE_DEFINITION = record
  2286. AttributeName: array[0..63] of WCHAR;
  2287. AttributeNumber: ULONG;
  2288. Unknown: array[0..1] of ULONG;
  2289. Flags: ULONG;
  2290. MinimumSize: ULONGLONG;
  2291. MaximumSize: ULONGLONG;
  2292. end;
  2293. ATTRIBUTE_DEFINITION = _ATTRIBUTE_DEFINITION;
  2294. PATTRIBUTE_DEFINITION = ^ATTRIBUTE_DEFINITION;
  2295. TAttributeDefinition = ATTRIBUTE_DEFINITION;
  2296. PAttributeDefinition = ^TAttributeDefinition;
  2297. _BOOT_BLOCK = record
  2298. Jump: array[0..2] of UCHAR;
  2299. Format: array[0..7] of UCHAR;
  2300. BytesPerSector: USHORT;
  2301. SectorsPerCluster: UCHAR;
  2302. BootSectors: USHORT;
  2303. Mbz1: UCHAR;
  2304. Mbz2: USHORT;
  2305. Reserved1: USHORT;
  2306. MediaType: UCHAR;
  2307. Mbz3: USHORT;
  2308. SectorsPerTrack: USHORT;
  2309. NumberOfHeads: USHORT;
  2310. PartitionOffset: ULONG;
  2311. Reserved2: array[0..1] of ULONG;
  2312. TotalSectors: ULONGLONG;
  2313. MftStartLcn: ULONGLONG;
  2314. Mft2StartLcn: ULONGLONG;
  2315. ClustersPerFileRecord: ULONG;
  2316. ClustersPerIndexBlock: ULONG;
  2317. VolumeSerialNumber: ULONGLONG;
  2318. Code: array[0..$1AD] of UCHAR;
  2319. BootSignature: USHORT;
  2320. end;
  2321. BOOT_BLOCK = _BOOT_BLOCK;
  2322. PBOOT_BLOCK = ^BOOT_BLOCK;
  2323. TBootBlock = BOOT_BLOCK;
  2324. PBootBlock = ^TBootBlock;
  2325. const
  2326. DBG_STATUS_CONTROL_C = 1;
  2327. DBG_STATUS_SYSRQ = 2;
  2328. DBG_STATUS_BUGCHECK_FIRST = 3;
  2329. DBG_STATUS_BUGCHECK_SECOND = 4;
  2330. DBG_STATUS_FATAL = 5;
  2331. DBG_STATUS_DEBUG_CONTROL = 6;
  2332. //function DbgPrint(Format: PCH; ...): ULONG; cdecl;
  2333. //function DbgPrintReturnControlC(Format: PCH; ...): ULONG; cdecl;
  2334. //==============================================================================
  2335. // Runtime Library
  2336. //==============================================================================
  2337. const
  2338. RTL_RANGE_LIST_ADD_IF_CONFLICT = $00000001;
  2339. RTL_RANGE_LIST_ADD_SHARED = $00000002;
  2340. const
  2341. RTL_RANGE_LIST_SHARED_OK = $00000001;
  2342. RTL_RANGE_LIST_NULL_CONFLICT_OK = $00000002;
  2343. type
  2344. PRTL_CONFLICT_RANGE_CALLBACK = function(Context: PVOID; Range: PRTL_RANGE): ByteBool; stdcall;
  2345. {$IFNDEF JWA_INCLUDEMODE}
  2346. type
  2347. _OSVERSIONINFOW = record
  2348. dwOSVersionInfoSize: ULONG;
  2349. dwMajorVersion: ULONG;
  2350. dwMinorVersion: ULONG;
  2351. dwBuildNumber: ULONG;
  2352. dwPlatformId: ULONG;
  2353. szCSDVersion: array[0..127] of WCHAR; // Maintenance string for PSS usage
  2354. end;
  2355. OSVERSIONINFOW = _OSVERSIONINFOW;
  2356. POSVERSIONINFOW = ^OSVERSIONINFOW;
  2357. LPOSVERSIONINFOW = ^OSVERSIONINFOW;
  2358. RTL_OSVERSIONINFOW = OSVERSIONINFOW;
  2359. {$ENDIF JWA_INCLUDEMODE}
  2360. PRTL_OSVERSIONINFOW = ^OSVERSIONINFOW;
  2361. {$IFNDEF JWA_INCLUDEMODE}
  2362. TOsVersionInfoW = OSVERSIONINFOW;
  2363. //POsVersionInfoW = ^TOsVersionInfoW;
  2364. OSVERSIONINFO = OSVERSIONINFOW;
  2365. POSVERSIONINFO = POSVERSIONINFOW;
  2366. LPOSVERSIONINFO = LPOSVERSIONINFOW;
  2367. {$ENDIF JWA_INCLUDEMODE}
  2368. {$IFNDEF JWA_INCLUDEMODE}
  2369. const
  2370. VER_PLATFORM_WIN32s = 0;
  2371. VER_PLATFORM_WIN32_WINDOWS = 1;
  2372. VER_PLATFORM_WIN32_NT = 2;
  2373. {$ENDIF JWA_INCLUDEMODE}
  2374. type
  2375. _RTL_BITMAP = record
  2376. SizeOfBitMap: ULONG; // Number of bits in bit map
  2377. Buffer: PULONG; // Pointer to the bit map itself
  2378. end;
  2379. RTL_BITMAP = _RTL_BITMAP;
  2380. PRTL_BITMAP = ^RTL_BITMAP;
  2381. TRtlBitmap = RTL_BITMAP;
  2382. PRtlBitmap = ^TRtlBitmap;
  2383. const
  2384. RTL_REGISTRY_ABSOLUTE = 0; // Path is a full path
  2385. RTL_REGISTRY_SERVICES = 1; // \Registry\Machine\System\CurrentControlSet\Services
  2386. RTL_REGISTRY_CONTROL = 2; // \Registry\Machine\System\CurrentControlSet\Control
  2387. RTL_REGISTRY_WINDOWS_NT = 3; // \Registry\Machine\Software\Microsoft\Windows NT\CurrentVersion
  2388. RTL_REGISTRY_DEVICEMAP = 4; // \Registry\Machine\Hardware\DeviceMap
  2389. RTL_REGISTRY_USER = 5; // \Registry\User\CurrentUser
  2390. RTL_REGISTRY_MAXIMUM = 6;
  2391. RTL_REGISTRY_HANDLE = $40000000; // Low order bits are registry handle
  2392. RTL_REGISTRY_OPTIONAL = $80000000; // Indicates the key node is optional
  2393. type
  2394. _TIME_FIELDS = record
  2395. Year: CSHORT; // range [1601...]
  2396. Month: CSHORT; // range [1..12]
  2397. Day: CSHORT; // range [1..31]
  2398. Hour: CSHORT; // range [0..23]
  2399. Minute: CSHORT; // range [0..59]
  2400. Second: CSHORT; // range [0..59]
  2401. Milliseconds: CSHORT; // range [0..999]
  2402. Weekday: CSHORT; // range [0..6] == [Sunday..Saturday]
  2403. end;
  2404. TIME_FIELDS = _TIME_FIELDS;
  2405. PTIME_FIELDS = ^TIME_FIELDS;
  2406. TTimeFields = TIME_FIELDS;
  2407. PTimeFields = ^TTimeFields;
  2408. {$IFNDEF JWA_INCLUDEMODE}
  2409. type
  2410. _OSVERSIONINFOEXW = record
  2411. dwOSVersionInfoSize: ULONG;
  2412. dwMajorVersion: ULONG;
  2413. dwMinorVersion: ULONG;
  2414. dwBuildNumber: ULONG;
  2415. dwPlatformId: ULONG;
  2416. szCSDVersion: array[0..127] of WCHAR; // Maintenance string for PSS usage
  2417. wServicePackMajor: USHORT;
  2418. wServicePackMinor: USHORT;
  2419. wSuiteMask: USHORT;
  2420. wProductType: UCHAR;
  2421. wReserved: UCHAR;
  2422. end;
  2423. OSVERSIONINFOEXW = _OSVERSIONINFOEXW;
  2424. POSVERSIONINFOEXW = ^OSVERSIONINFOEXW;
  2425. LPOSVERSIONINFOEXW = ^OSVERSIONINFOEXW;
  2426. RTL_OSVERSIONINFOEXW = OSVERSIONINFOEXW;
  2427. PRTL_OSVERSIONINFOEXW = ^OSVERSIONINFOEXW;
  2428. TOsVersionInfoExW = OSVERSIONINFOEXW;
  2429. //POsVersionInfoExW = ^TOsVersionInfoExW;
  2430. OSVERSIONINFOEX = OSVERSIONINFOEXW;
  2431. POSVERSIONINFOEX = POSVERSIONINFOEXW;
  2432. LPOSVERSIONINFOEX = LPOSVERSIONINFOEXW;
  2433. {$ENDIF JWA_INCLUDEMODE}
  2434. //
  2435. // RtlVerifyVersionInfo() conditions
  2436. //
  2437. const
  2438. {$IFNDEF JWA_INCLUDEMODE}
  2439. VER_EQUAL = 1;
  2440. VER_GREATER = 2;
  2441. VER_GREATER_EQUAL = 3;
  2442. VER_LESS = 4;
  2443. VER_LESS_EQUAL = 5;
  2444. VER_AND = 6;
  2445. VER_OR = 7;
  2446. VER_CONDITION_MASK = 7;
  2447. VER_NUM_BITS_PER_CONDITION_MASK = 3;
  2448. //
  2449. // RtlVerifyVersionInfo() type mask bits
  2450. //
  2451. VER_MINORVERSION = $0000001;
  2452. VER_MAJORVERSION = $0000002;
  2453. VER_BUILDNUMBER = $0000004;
  2454. VER_PLATFORMID = $0000008;
  2455. VER_SERVICEPACKMINOR = $0000010;
  2456. VER_SERVICEPACKMAJOR = $0000020;
  2457. VER_SUITENAME = $0000040;
  2458. VER_PRODUCT_TYPE = $0000080;
  2459. //
  2460. // RtlVerifyVersionInfo() os product type values
  2461. //
  2462. VER_NT_WORKSTATION = $0000001;
  2463. VER_NT_DOMAIN_CONTROLLER = $0000002;
  2464. VER_NT_SERVER = $0000003;
  2465. {$ENDIF JWA_INCLUDEMODE}
  2466. //
  2467. // Related constant(s) for RtlDetermineDosPathNameType_U()
  2468. //
  2469. INVALID_PATH = 0;
  2470. UNC_PATH = 1;
  2471. ABSOLUTE_DRIVE_PATH = 2;
  2472. RELATIVE_DRIVE_PATH = 3;
  2473. ABSOLUTE_PATH = 4;
  2474. RELATIVE_PATH = 5;
  2475. DEVICE_PATH = 6;
  2476. UNC_DOT_PATH = 7;
  2477. type
  2478. PRTL_QUERY_REGISTRY_ROUTINE = function(ValueName: PWSTR; ValueType: ULONG;
  2479. ValueData: PVOID; ValueLength: ULONG; Context, EntryContext: PVOID): NTSTATUS; stdcall;
  2480. _RTL_QUERY_REGISTRY_TABLE = record
  2481. QueryRoutine: PRTL_QUERY_REGISTRY_ROUTINE;
  2482. Flags: ULONG;
  2483. Name: PWSTR;
  2484. EntryContext: PVOID;
  2485. DefaultType: ULONG;
  2486. DefaultData: PVOID;
  2487. DefaultLength: ULONG;
  2488. end;
  2489. RTL_QUERY_REGISTRY_TABLE = _RTL_QUERY_REGISTRY_TABLE;
  2490. PRTL_QUERY_REGISTRY_TABLE = ^RTL_QUERY_REGISTRY_TABLE;
  2491. TRtlQueryRegistryTable = RTL_QUERY_REGISTRY_TABLE;
  2492. PRtlQueryRegistryTable = ^TRtlQueryRegistryTable;
  2493. REFGUID = ^GUID;
  2494. TRefGuid = REFGUID;
  2495. {$IFNDEF JWA_INCLUDEMODE}
  2496. const
  2497. // Should be defined, but isn't
  2498. HEAP_ZERO_MEMORY = $00000008;
  2499. {$ENDIF JWA_INCLUDEMODE}
  2500. type
  2501. // =================================================================
  2502. // PROCESS ENVIRONMENT BLOCK (PEB)
  2503. // =================================================================
  2504. // Verified in XP using WinDbg
  2505. _LDR_DATA_TABLE_ENTRY = record // not packed!
  2506. case Integer of
  2507. (* *)0: (
  2508. (*000*)InLoadOrderLinks: LIST_ENTRY
  2509. );
  2510. (* *)1: (
  2511. (*000*)InMemoryOrderLinks: LIST_ENTRY
  2512. );
  2513. (* *)2: (
  2514. (*000*)InInitializationOrderLinks: LIST_ENTRY;
  2515. (*008*)DllBase: PVOID;
  2516. (*00c*)EntryPoint: PVOID;
  2517. (*010*)SizeOfImage: ULONG;
  2518. (*014*)FullDllName: UNICODE_STRING;
  2519. (*01c*)BaseDllName: UNICODE_STRING;
  2520. (*024*)Flags: ULONG;
  2521. (*028*)LoadCount: USHORT;
  2522. (*02a*)TlsIndex: USHORT;
  2523. (*02c*)HashLinks: LIST_ENTRY;
  2524. (*034*)SectionPointer: PVOID;
  2525. (*038*)CheckSum: ULONG;
  2526. (*03C*)TimeDateStamp: ULONG;
  2527. (*040*)LoadedImports: PVOID;
  2528. (*044*)EntryPointActivationContext: PVOID; // PACTIVATION_CONTEXT
  2529. (*048*)PatchInformation: PVOID;
  2530. )
  2531. end;
  2532. LDR_DATA_TABLE_ENTRY = _LDR_DATA_TABLE_ENTRY;
  2533. PLDR_DATA_TABLE_ENTRY = ^_LDR_DATA_TABLE_ENTRY;
  2534. PPLDR_DATA_TABLE_ENTRY = ^PLDR_DATA_TABLE_ENTRY;
  2535. TLdrDataTableEntry = _LDR_DATA_TABLE_ENTRY;
  2536. PLdrDataTableEntry = ^_LDR_DATA_TABLE_ENTRY;
  2537. // Verified in XP using WinDbg
  2538. _PEB_LDR_DATA = record // not packed!
  2539. (*000*)Length: ULONG;
  2540. (*004*)Initialized: BOOLEAN;
  2541. (*008*)SsHandle: PVOID;
  2542. (*00c*)InLoadOrderModuleList: LIST_ENTRY;
  2543. (*014*)InMemoryOrderModuleList: LIST_ENTRY;
  2544. (*01c*)InInitializationOrderModuleList: LIST_ENTRY;
  2545. (*024*)EntryInProgress: PVOID;
  2546. end;
  2547. PEB_LDR_DATA = _PEB_LDR_DATA;
  2548. PPEB_LDR_DATA = ^_PEB_LDR_DATA;
  2549. PPPEB_LDR_DATA = ^PPEB_LDR_DATA;
  2550. TPebLdrData = _PEB_LDR_DATA;
  2551. PPebLdrData = ^_PEB_LDR_DATA;
  2552. // Verified in XP using WinDbg
  2553. _RTL_DRIVE_LETTER_CURDIR = record // not packed!
  2554. (*000*)Flags: USHORT;
  2555. (*002*)Length: USHORT;
  2556. (*004*)TimeStamp: ULONG;
  2557. (*008*)DosPath: _STRING;
  2558. end;
  2559. RTL_DRIVE_LETTER_CURDIR = _RTL_DRIVE_LETTER_CURDIR;
  2560. PRTL_DRIVE_LETTER_CURDIR = ^_RTL_DRIVE_LETTER_CURDIR;
  2561. PPRTL_DRIVE_LETTER_CURDIR = ^PRTL_DRIVE_LETTER_CURDIR;
  2562. TRtlDriveLetterCurdir = _RTL_DRIVE_LETTER_CURDIR;
  2563. PRtlDriveLetterCurdir = ^_RTL_DRIVE_LETTER_CURDIR;
  2564. _CURDIR = record // not packed!
  2565. (*000*)DosPath: UNICODE_STRING;
  2566. (*008*)Handle: HANDLE;
  2567. end;
  2568. CURDIR = _CURDIR;
  2569. PCURDIR = ^_CURDIR;
  2570. PPCURDIR = ^PCURDIR;
  2571. TCurdir = _CURDIR;
  2572. // PCurdir = ^_CURDIR; // <--- Pascal is case-insensitive
  2573. // Verified in XP using WinDbg
  2574. _RTL_USER_PROCESS_PARAMETERS = record // not packed!
  2575. (*000*)MaximumLength: ULONG;
  2576. (*004*)Length: ULONG;
  2577. (*008*)Flags: ULONG; // Bit 0: all pointers normalized
  2578. (*00c*)DebugFlags: ULONG;
  2579. (*010*)ConsoleHandle: HANDLE;
  2580. (*014*)ConsoleFlags: ULONG;
  2581. (*018*)StandardInput: HANDLE;
  2582. (*01c*)StandardOutput: HANDLE;
  2583. (*020*)StandardError: HANDLE;
  2584. (*024*)CurrentDirectory: CURDIR;
  2585. (*030*)DllPath: UNICODE_STRING;
  2586. (*038*)ImagePathName: UNICODE_STRING;
  2587. (*040*)CommandLine: UNICODE_STRING;
  2588. (*048*)Environment: PVOID;
  2589. (*04c*)StartingX: ULONG;
  2590. (*050*)StartingY: ULONG;
  2591. (*054*)CountX: ULONG;
  2592. (*058*)CountY: ULONG;
  2593. (*05c*)CountCharsX: ULONG;
  2594. (*060*)CountCharsY: ULONG;
  2595. (*064*)FillAttribute: ULONG;
  2596. (*068*)WindowFlags: ULONG;
  2597. (*06c*)ShowWindowFlags: ULONG;
  2598. (*070*)WindowTitle: UNICODE_STRING;
  2599. (*078*)DesktopInfo: UNICODE_STRING;
  2600. (*080*)ShellInfo: UNICODE_STRING;
  2601. (*088*)RuntimeData: UNICODE_STRING;
  2602. (*090*)CurrentDirectories: array[0..31] of RTL_DRIVE_LETTER_CURDIR;
  2603. end;
  2604. RTL_USER_PROCESS_PARAMETERS = _RTL_USER_PROCESS_PARAMETERS;
  2605. PRTL_USER_PROCESS_PARAMETERS = ^_RTL_USER_PROCESS_PARAMETERS;
  2606. PPRTL_USER_PROCESS_PARAMETERS = ^PRTL_USER_PROCESS_PARAMETERS;
  2607. TRtlUserProcessParameters = _RTL_USER_PROCESS_PARAMETERS;
  2608. PRtlUserProcessParameters = ^_RTL_USER_PROCESS_PARAMETERS;
  2609. TProcessParameters = _RTL_USER_PROCESS_PARAMETERS;
  2610. PProcessParameters = ^_RTL_USER_PROCESS_PARAMETERS;
  2611. _SYSTEM_STRINGS = record // not packed!
  2612. (*000*)SystemRoot: UNICODE_STRING; // %SystemRoot%
  2613. (*008*)System32Root: UNICODE_STRING; // %SystemRoot%\System32
  2614. (*010*)BaseNamedObjects: UNICODE_STRING; // \BaseNamedObjects
  2615. end;
  2616. SYSTEM_STRINGS = _SYSTEM_STRINGS;
  2617. PSYSTEM_STRINGS = ^_SYSTEM_STRINGS;
  2618. PPSYSTEM_STRINGS = ^PSYSTEM_STRINGS;
  2619. TSystemStrings = _SYSTEM_STRINGS;
  2620. PSystemStrings = ^_SYSTEM_STRINGS;
  2621. // Verified in XP using WinDbg
  2622. _TEXT_INFO = record // not packed!
  2623. (*000*)Reserved: PVOID;
  2624. (*004*)SystemStrings: PSYSTEM_STRINGS;
  2625. end;
  2626. TEXT_INFO = _TEXT_INFO;
  2627. PTEXT_INFO = ^_TEXT_INFO;
  2628. PPTEXT_INFO = ^PTEXT_INFO;
  2629. TTextInfo = _TEXT_INFO;
  2630. PTextInfo = ^_TEXT_INFO;
  2631. // Verified in XP using WinDbg
  2632. PPEB_FREE_BLOCK = ^_PEB_FREE_BLOCK;
  2633. _PEB_FREE_BLOCK = record // not packed!
  2634. (*000*)Next: PPEB_FREE_BLOCK;
  2635. (*004*)Size: ULONG;
  2636. end;
  2637. PEB_FREE_BLOCK = _PEB_FREE_BLOCK;
  2638. PPPEB_FREE_BLOCK = ^PPEB_FREE_BLOCK;
  2639. TPebFreeBlock = _PEB_FREE_BLOCK;
  2640. PPebFreeBlock = ^_PEB_FREE_BLOCK;
  2641. // Verified in W2K, WXP and W2K3 using WinDbg
  2642. _PEB_W2K = packed record // packed!
  2643. (*000*)InheritedAddressSpace: BOOLEAN;
  2644. (*001*)ReadImageFileExecOptions: BOOLEAN;
  2645. (*002*)BeingDebugged: BOOLEAN;
  2646. (*003*)SpareBool: BOOLEAN;
  2647. (*004*)Mutant: PVOID;
  2648. (*008*)ImageBaseAddress: PVOID;
  2649. (*00c*)Ldr: PPEB_LDR_DATA;
  2650. (*010*)ProcessParameters: PRTL_USER_PROCESS_PARAMETERS;
  2651. (*014*)SubSystemData: PVOID;
  2652. (*018*)ProcessHeap: PVOID;
  2653. (*01c*)FastPebLock: PRTL_CRITICAL_SECTION;
  2654. (*020*)FastPebLockRoutine: PVOID; // RtlEnterCriticalSection
  2655. (*024*)FastPebUnlockRoutine: PVOID; // RtlLeaveCriticalSection
  2656. (*028*)EnvironmentUpdateCount: ULONG;
  2657. (*02c*)KernelCallbackTable: PPVOID; // List of callback functions
  2658. (*030*)SystemReserved: array[0..0] of ULONG;
  2659. (*034*)d034: ULONG;
  2660. (*038*)FreeList: PPEB_FREE_BLOCK;
  2661. (*03c*)TlsExpansionCounter: ULONG;
  2662. (*040*)TlsBitmap: PVOID; // ntdll!TlsBitMap of type PRTL_BITMAP
  2663. (*044*)TlsBitmapBits: array[0..1] of ULONG; // 64 bits
  2664. (*04c*)ReadOnlySharedMemoryBase: PVOID;
  2665. (*050*)ReadOnlySharedMemoryHeap: PVOID;
  2666. (*054*)ReadOnlyStaticServerData: PTEXT_INFO;
  2667. (*058*)AnsiCodePageData: PVOID;
  2668. (*05c*)OemCodePageData: PVOID;
  2669. (*060*)UnicodeCaseTableData: PVOID;
  2670. (*064*)NumberOfProcessors: ULONG;
  2671. (*068*)NtGlobalFlag: ULONG;
  2672. (*06C*)Unknown01: ULONG; // Padding or something
  2673. (*070*)CriticalSectionTimeout: LARGE_INTEGER;
  2674. (*078*)HeapSegmentReserve: ULONG;
  2675. (*07c*)HeapSegmentCommit: ULONG;
  2676. (*080*)HeapDeCommitTotalFreeThreshold: ULONG;
  2677. (*084*)HeapDeCommitFreeBlockThreshold: ULONG;
  2678. (*088*)NumberOfHeaps: ULONG;
  2679. (*08c*)MaximumNumberOfHeaps: ULONG;
  2680. (*090*)ProcessHeaps: PPVOID;
  2681. (*094*)GdiSharedHandleTable: PPVOID;
  2682. (*098*)ProcessStarterHelper: PVOID;
  2683. (*09c*)GdiDCAttributeList: ULONG;
  2684. (*0a0*)LoaderLock: PCRITICAL_SECTION;
  2685. (*0a4*)OSMajorVersion: ULONG;
  2686. (*0a8*)OSMinorVersion: ULONG;
  2687. (*0ac*)OSBuildNumber: USHORT;
  2688. (*0ae*)OSCSDVersion: USHORT;
  2689. (*0b0*)OSPlatformId: ULONG;
  2690. (*0b4*)ImageSubsystem: ULONG;
  2691. (*0b8*)ImageSubsystemMajorVersion: ULONG;
  2692. (*0bc*)ImageSubsystemMinorVersion: ULONG;
  2693. (*0c0*)ImageProcessAffinityMask: ULONG;
  2694. (*0c4*)GdiHandleBuffer: array[0..33] of HANDLE;
  2695. (*14c*)PostProcessInitRoutine: PVOID;
  2696. (*150*)TlsExpansionBitmap: PVOID;
  2697. (*154*)TlsExpansionBitmapBits: array[0..31] of ULONG;
  2698. (*1d4*)SessionId: ULONG;
  2699. // Windows 2000
  2700. (*1d8*)AppCompatInfo: PVOID;
  2701. (*1dc*)CSDVersion: UNICODE_STRING;
  2702. end;
  2703. // Verified in W2K, WXP and W2K3 using WinDbg
  2704. _PEB_WXP = packed record // packed!
  2705. (*000*)InheritedAddressSpace: BOOLEAN;
  2706. (*001*)ReadImageFileExecOptions: BOOLEAN;
  2707. (*002*)BeingDebugged: BOOLEAN;
  2708. (*003*)SpareBool: BOOLEAN;
  2709. (*004*)Mutant: PVOID;
  2710. (*008*)ImageBaseAddress: PVOID;
  2711. (*00c*)Ldr: PPEB_LDR_DATA;
  2712. (*010*)ProcessParameters: PRTL_USER_PROCESS_PARAMETERS;
  2713. (*014*)SubSystemData: PVOID;
  2714. (*018*)ProcessHeap: PVOID;
  2715. (*01c*)FastPebLock: PRTL_CRITICAL_SECTION;
  2716. (*020*)FastPebLockRoutine: PVOID; // RtlEnterCriticalSection
  2717. (*024*)FastPebUnlockRoutine: PVOID; // RtlLeaveCriticalSection
  2718. (*028*)EnvironmentUpdateCount: ULONG;
  2719. (*02c*)KernelCallbackTable: PPVOID; // List of callback functions
  2720. (*030*)SystemReserved: array[0..0] of ULONG;
  2721. (*034*)AtlThunkSListPtr32: PVOID; // (Windows XP)
  2722. (*038*)FreeList: PPEB_FREE_BLOCK;
  2723. (*03c*)TlsExpansionCounter: ULONG;
  2724. (*040*)TlsBitmap: PVOID; // ntdll!TlsBitMap of type PRTL_BITMAP
  2725. (*044*)TlsBitmapBits: array[0..1] of ULONG; // 64 bits
  2726. (*04c*)ReadOnlySharedMemoryBase: PVOID;
  2727. (*050*)ReadOnlySharedMemoryHeap: PVOID;
  2728. (*054*)ReadOnlyStaticServerData: PTEXT_INFO;
  2729. (*058*)AnsiCodePageData: PVOID;
  2730. (*05c*)OemCodePageData: PVOID;
  2731. (*060*)UnicodeCaseTableData: PVOID;
  2732. (*064*)NumberOfProcessors: ULONG;
  2733. (*068*)NtGlobalFlag: ULONG;
  2734. (*06C*)Unknown01: ULONG; // Padding or something
  2735. (*070*)CriticalSectionTimeout: LARGE_INTEGER;
  2736. (*078*)HeapSegmentReserve: ULONG;
  2737. (*07c*)HeapSegmentCommit: ULONG;
  2738. (*080*)HeapDeCommitTotalFreeThreshold: ULONG;
  2739. (*084*)HeapDeCommitFreeBlockThreshold: ULONG;
  2740. (*088*)NumberOfHeaps: ULONG;
  2741. (*08c*)MaximumNumberOfHeaps: ULONG;
  2742. (*090*)ProcessHeaps: PPVOID;
  2743. (*094*)GdiSharedHandleTable: PPVOID;
  2744. (*098*)ProcessStarterHelper: PVOID;
  2745. (*09c*)GdiDCAttributeList: ULONG;
  2746. (*0a0*)LoaderLock: PCRITICAL_SECTION;
  2747. (*0a4*)OSMajorVersion: ULONG;
  2748. (*0a8*)OSMinorVersion: ULONG;
  2749. (*0ac*)OSBuildNumber: USHORT;
  2750. (*0ae*)OSCSDVersion: USHORT;
  2751. (*0b0*)OSPlatformId: ULONG;
  2752. (*0b4*)ImageSubsystem: ULONG;
  2753. (*0b8*)ImageSubsystemMajorVersion: ULONG;
  2754. (*0bc*)ImageSubsystemMinorVersion: ULONG;
  2755. (*0c0*)ImageProcessAffinityMask: ULONG;
  2756. (*0c4*)GdiHandleBuffer: array[0..33] of HANDLE;
  2757. (*14c*)PostProcessInitRoutine: PVOID;
  2758. (*150*)TlsExpansionBitmap: PVOID;
  2759. (*154*)TlsExpansionBitmapBits: array[0..31] of ULONG;
  2760. (*1d4*)SessionId: ULONG;
  2761. // Windows XP
  2762. (*1d8*)AppCompatFlags: ULARGE_INTEGER;
  2763. (*1e0*)AppCompatFlagsUser: ULARGE_INTEGER;
  2764. (*1e8*)pShimData: PVOID;
  2765. (*1ec*)AppCompatInfo: PVOID;
  2766. (*1f0*)CSDVersion: UNICODE_STRING;
  2767. (*1f8*)ActivationContextData: PVOID; // PACTIVATION_CONTEXT_DATA
  2768. (*1fc*)ProcessAssemblyStorageMap: PVOID; // PASSEMBLY_STORAGE_MAP
  2769. (*200*)SystemDefaultActivationContextData: PVOID; // PACTIVATION_CONTEXT_DATA
  2770. (*204*)SystemAssemblyStorageMap: PVOID; // PASSEMBLY_STORAGE_MAP
  2771. (*208*)MinimumStackCommit: ULONG;
  2772. end;
  2773. // Verified in W2K, WXP and W2K3 using WinDbg
  2774. _PEB_2K3 = packed record // packed!
  2775. (*000*)InheritedAddressSpace: BOOLEAN;
  2776. (*001*)ReadImageFileExecOptions: BOOLEAN;
  2777. (*002*)BeingDebugged: BOOLEAN;
  2778. (*003*)SpareBool: BOOLEAN;
  2779. (*004*)Mutant: PVOID;
  2780. (*008*)ImageBaseAddress: PVOID;
  2781. (*00c*)Ldr: PPEB_LDR_DATA;
  2782. (*010*)ProcessParameters: PRTL_USER_PROCESS_PARAMETERS;
  2783. (*014*)SubSystemData: PVOID;
  2784. (*018*)ProcessHeap: PVOID;
  2785. (*01c*)FastPebLock: PRTL_CRITICAL_SECTION;
  2786. (*020*)FastPebLockRoutine: PVOID; // RtlEnterCriticalSection
  2787. (*024*)FastPebUnlockRoutine: PVOID; // RtlLeaveCriticalSection
  2788. (*028*)EnvironmentUpdateCount: ULONG;
  2789. (*02c*)KernelCallbackTable: PPVOID; // List of callback functions
  2790. (*030*)SystemReserved: array[0..0] of ULONG;
  2791. (*034*)ExecuteOptions: ULONG; // 2 Bits used (Windows 2003)
  2792. (*038*)FreeList: PPEB_FREE_BLOCK;
  2793. (*03c*)TlsExpansionCounter: ULONG;
  2794. (*040*)TlsBitmap: PVOID; // ntdll!TlsBitMap of type PRTL_BITMAP
  2795. (*044*)TlsBitmapBits: array[0..1] of ULONG; // 64 bits
  2796. (*04c*)ReadOnlySharedMemoryBase: PVOID;
  2797. (*050*)ReadOnlySharedMemoryHeap: PVOID;
  2798. (*054*)ReadOnlyStaticServerData: PTEXT_INFO;
  2799. (*058*)AnsiCodePageData: PVOID;
  2800. (*05c*)OemCodePageData: PVOID;
  2801. (*060*)UnicodeCaseTableData: PVOID;
  2802. (*064*)NumberOfProcessors: ULONG;
  2803. (*068*)NtGlobalFlag: ULONG;
  2804. (*06C*)Unknown01: ULONG; // Padding or something
  2805. (*070*)CriticalSectionTimeout: LARGE_INTEGER;
  2806. (*078*)HeapSegmentReserve: ULONG;
  2807. (*07c*)HeapSegmentCommit: ULONG;
  2808. (*080*)HeapDeCommitTotalFreeThreshold: ULONG;
  2809. (*084*)HeapDeCommitFreeBlockThreshold: ULONG;
  2810. (*088*)NumberOfHeaps: ULONG;
  2811. (*08c*)MaximumNumberOfHeaps: ULONG;
  2812. (*090*)ProcessHeaps: PPVOID;
  2813. (*094*)GdiSharedHandleTable: PPVOID;
  2814. (*098*)ProcessStarterHelper: PVOID;
  2815. (*09c*)GdiDCAttributeList: ULONG;
  2816. (*0a0*)LoaderLock: PCRITICAL_SECTION;
  2817. (*0a4*)OSMajorVersion: ULONG;
  2818. (*0a8*)OSMinorVersion: ULONG;
  2819. (*0ac*)OSBuildNumber: USHORT;
  2820. (*0ae*)OSCSDVersion: USHORT;
  2821. (*0b0*)OSPlatformId: ULONG;
  2822. (*0b4*)ImageSubsystem: ULONG;
  2823. (*0b8*)ImageSubsystemMajorVersion: ULONG;
  2824. (*0bc*)ImageSubsystemMinorVersion: ULONG;
  2825. (*0c0*)ImageProcessAffinityMask: ULONG;
  2826. (*0c4*)GdiHandleBuffer: array[0..33] of HANDLE;
  2827. (*14c*)PostProcessInitRoutine: PVOID;
  2828. (*150*)TlsExpansionBitmap: PVOID;
  2829. (*154*)TlsExpansionBitmapBits: array[0..31] of ULONG;
  2830. (*1d4*)SessionId: ULONG;
  2831. // Windows XP
  2832. (*1d8*)AppCompatFlags: ULARGE_INTEGER;
  2833. (*1e0*)AppCompatFlagsUser: ULARGE_INTEGER;
  2834. (*1e8*)pShimData: PVOID;
  2835. (*1ec*)AppCompatInfo: PVOID;
  2836. (*1f0*)CSDVersion: UNICODE_STRING;
  2837. (*1f8*)ActivationContextData: PVOID; // PACTIVATION_CONTEXT_DATA
  2838. (*1fc*)ProcessAssemblyStorageMap: PVOID; // PASSEMBLY_STORAGE_MAP
  2839. (*200*)SystemDefaultActivationContextData: PVOID; // PACTIVATION_CONTEXT_DATA
  2840. (*204*)SystemAssemblyStorageMap: PVOID; // PASSEMBLY_STORAGE_MAP
  2841. (*208*)MinimumStackCommit: ULONG;
  2842. // New members in Windows 2003
  2843. (*20c*)FlsCallback: PPVOID;
  2844. (*210*)FlsListHead: LIST_ENTRY;
  2845. (*218*)FlsBitmap: PVOID;
  2846. (*21c*)FlsBitmapBits: array[0..3] of ULONG;
  2847. (*22c*)FlsHighIndex: ULONG;
  2848. end;
  2849. {$IFDEF WINNT4}
  2850. _PEB = _PEB_W2K; // Exact layout for NT4 unknown
  2851. {$ENDIF WINNT4}
  2852. {$IFDEF WIN2000}
  2853. _PEB = _PEB_W2K;
  2854. {$ENDIF WIN2000}
  2855. {$IFDEF WINXP}
  2856. _PEB = _PEB_WXP;
  2857. {$ENDIF WINXP}
  2858. {$IFDEF WIN2003}
  2859. _PEB = _PEB_2K3;
  2860. {$ENDIF WIN2003}
  2861. PEB = _PEB;
  2862. PPEB = ^_PEB;
  2863. PPPEB = ^PPEB;
  2864. {$IFNDEF JWA_INCLUDEMODE}
  2865. // =================================================================
  2866. // THREAD ENVIRONMENT BLOCK (TEB)
  2867. // =================================================================
  2868. PNT_TIB = ^_NT_TIB;
  2869. _NT_TIB = record
  2870. ExceptionList: Pointer; // ^_EXCEPTION_REGISTRATION_RECORD
  2871. StackBase,
  2872. StackLimit,
  2873. SubSystemTib: Pointer;
  2874. case Integer of
  2875. 0: (
  2876. FiberData: Pointer
  2877. );
  2878. 1: (
  2879. Version: ULONG;
  2880. ArbitraryUserPointer: Pointer;
  2881. Self: PNT_TIB;
  2882. )
  2883. end;
  2884. NT_TIB = _NT_TIB;
  2885. {$ENDIF JWA_INCLUDEMODE}
  2886. PPNT_TIB = ^PNT_TIB;
  2887. tagACTCTX = record // not packed!
  2888. (*000*)cbSize: ULONG;
  2889. (*004*)dwFlags: DWORD;
  2890. (*008*)lpSource: LPCWSTR;
  2891. (*00C*)wProcessorArchitecture: USHORT;
  2892. (*00E*)wLangId: LANGID;
  2893. (*010*)lpAssemblyDirectory: LPCTSTR;
  2894. (*014*)lpResourceName: LPCTSTR;
  2895. (*018*)lpApplicationName: LPCTSTR;
  2896. (*01C*)hModule: HMODULE;
  2897. end;
  2898. {$IFNDEF JWA_INCLUDEMODE}
  2899. ACTCTX = tagACTCTX;
  2900. PACTCTX = ^tagACTCTX;
  2901. {$ENDIF JWA_INCLUDEMODE}
  2902. ACTIVATION_CONTEXT = tagACTCTX;
  2903. PACTIVATION_CONTEXT = ^tagACTCTX;
  2904. PPACTIVATION_CONTEXT = ^PACTIVATION_CONTEXT;
  2905. PRTL_ACTIVATION_CONTEXT_STACK_FRAME = ^_RTL_ACTIVATION_CONTEXT_STACK_FRAME;
  2906. _RTL_ACTIVATION_CONTEXT_STACK_FRAME = record // not packed!
  2907. (*000*)Previous: PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
  2908. (*004*)ActivationContext: PACTIVATION_CONTEXT;
  2909. (*008*)Flags: ULONG;
  2910. end;
  2911. RTL_ACTIVATION_CONTEXT_STACK_FRAME = _RTL_ACTIVATION_CONTEXT_STACK_FRAME;
  2912. PPRTL_ACTIVATION_CONTEXT_STACK_FRAME = ^PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
  2913. // Verified in XP using WinDbg
  2914. _ACTIVATION_CONTEXT_STACK = record // not packed!
  2915. (*000*)Flags: ULONG;
  2916. (*004*)NextCookieSequenceNumber: ULONG;
  2917. (*008*)ActiveFrame: PRTL_ACTIVATION_CONTEXT_STACK_FRAME;
  2918. (*00c*)FrameListCache: LIST_ENTRY;
  2919. end;
  2920. ACTIVATION_CONTEXT_STACK = _ACTIVATION_CONTEXT_STACK;
  2921. PACTIVATION_CONTEXT_STACK = ^_ACTIVATION_CONTEXT_STACK;
  2922. PPACTIVATION_CONTEXT_STACK = ^PACTIVATION_CONTEXT_STACK;
  2923. // Verified in XP using WinDbg
  2924. _GDI_TEB_BATCH = record // not packed!
  2925. (*000*)Offset: ULONG;
  2926. (*004*)HDC: HANDLE;
  2927. (*008*)Buffer: array[0..309] of ULONG;
  2928. end;
  2929. GDI_TEB_BATCH = _GDI_TEB_BATCH;
  2930. PGDI_TEB_BATCH = ^_GDI_TEB_BATCH;
  2931. PPGDI_TEB_BATCH = ^PGDI_TEB_BATCH;
  2932. // Verified in XP using WinDbg
  2933. _Wx86ThreadState = packed record // packed!
  2934. (*000*)CallBx86Eip: PULONG;
  2935. (*004*)DeallocationCpu: PVOID;
  2936. (*008*)UseKnownWx86Dll: BOOLEAN;
  2937. (*009*)OleStubInvoked: CHAR;
  2938. end;
  2939. Wx86ThreadState = _Wx86ThreadState;
  2940. PWx86ThreadState = ^_Wx86ThreadState;
  2941. PPWx86ThreadState = ^PWx86ThreadState;
  2942. // Verified in XP using WinDbg
  2943. _TEB_ACTIVE_FRAME_CONTEXT = record // not packed!
  2944. (*000*)Flags: ULONG;
  2945. (*004*)FrameName: PCHAR;
  2946. end;
  2947. TEB_ACTIVE_FRAME_CONTEXT = _TEB_ACTIVE_FRAME_CONTEXT;
  2948. PTEB_ACTIVE_FRAME_CONTEXT = ^_TEB_ACTIVE_FRAME_CONTEXT;
  2949. PPTEB_ACTIVE_FRAME_CONTEXT = ^PTEB_ACTIVE_FRAME_CONTEXT;
  2950. // Verified in XP using WinDbg
  2951. PTEB_ACTIVE_FRAME = ^_TEB_ACTIVE_FRAME;
  2952. _TEB_ACTIVE_FRAME = record // not packed!
  2953. (*000*)Flags: ULONG;
  2954. (*004*)Previous: PTEB_ACTIVE_FRAME;
  2955. (*008*)Context: PTEB_ACTIVE_FRAME_CONTEXT;
  2956. end;
  2957. TEB_ACTIVE_FRAME = _TEB_ACTIVE_FRAME;
  2958. PPTEB_ACTIVE_FRAME = ^PTEB_ACTIVE_FRAME;
  2959. // Verified in W2K, WXP and W2K3 using WinDbg
  2960. _TEB = record // not packed!
  2961. (*000*)NtTib: NT_TIB;
  2962. (*01c*)EnvironmentPointer: PVOID;
  2963. (*020*)ClientId: CLIENT_ID;
  2964. (*028*)ActiveRpcHandle: PVOID;
  2965. (*02c*)ThreadLocalStoragePointer: PVOID;
  2966. (*030*)Peb: PPEB;
  2967. (*034*)LastErrorValue: ULONG;
  2968. (*038*)CountOfOwnedCriticalSections: ULONG;
  2969. (*03c*)CsrClientThread: PVOID;
  2970. (*040*)Win32ThreadInfo: PVOID;
  2971. (*044*)User32Reserved: array[0..25] of ULONG;
  2972. (*0ac*)UserReserved: array[0..4] of ULONG;
  2973. (*0c0*)WOW32Reserved: PVOID;
  2974. (*0c4*)CurrentLocale: LCID;
  2975. (*0c8*)FpSoftwareStatusRegister: ULONG;
  2976. (*0cc*)SystemReserved1: array[0..53] of PVOID;
  2977. (*1a4*)ExceptionCode: LONG;
  2978. (*1a8*)ActivationContextStack: ACTIVATION_CONTEXT_STACK;
  2979. (*1bc*)SpareBytes1: array[0..23] of UCHAR;
  2980. (*1d4*)GdiTebBatch: GDI_TEB_BATCH;
  2981. (*6b4*)RealClientId: CLIENT_ID;
  2982. (*6bc*)GdiCachedProcessHandle: PVOID;
  2983. (*6c0*)GdiClientPID: ULONG;
  2984. (*6c4*)GdiClientTID: ULONG;
  2985. (*6c8*)GdiThreadLocalInfo: PVOID;
  2986. (*6cc*)Win32ClientInfo: array[0..61] of ULONG;
  2987. (*7c4*)glDispatchTable: array[0..232] of PVOID;
  2988. (*b68*)glReserved1: array[0..28] of ULONG;
  2989. (*bdc*)glReserved2: PVOID;
  2990. (*be0*)glSectionInfo: PVOID;
  2991. (*be4*)glSection: PVOID;
  2992. (*be8*)glTable: PVOID;
  2993. (*bec*)glCurrentRC: PVOID;
  2994. (*bf0*)glContext: PVOID;
  2995. (*bf4*)LastStatusValue: ULONG;
  2996. (*bf8*)StaticUnicodeString: UNICODE_STRING;
  2997. (*c00*)StaticUnicodeBuffer: array[0..MAX_PATH] of WCHAR;
  2998. (*e0a*)Padding: USHORT;
  2999. (*e0c*)DeallocationStack: PVOID;
  3000. (*e10*)TlsSlots: array[0..63] of PVOID;
  3001. (*f10*)TlsLinks: LIST_ENTRY;
  3002. (*f18*)Vdm: PVOID;
  3003. (*f1c*)ReservedForNtRpc: PVOID;
  3004. (*f20*)DbgSsReserved: array[0..1] of PVOID;
  3005. case Integer of
  3006. (* *)0: (
  3007. (*f28*)HardErrorMode: ULONG // (Windows 2003)
  3008. );
  3009. (* *)1: (
  3010. (*f28*)HardErrorsAreDisabled: ULONG; // (Windows XP)
  3011. (*f2c*)Instrumentation: array[0..15] of PVOID;
  3012. (*f6c*)WinSockData: PVOID;
  3013. (*f70*)GdiBatchCount: ULONG;
  3014. (*f74*)InDbgPrint: BOOLEAN;
  3015. (*f75*)FreeStackOnTermination: BOOLEAN;
  3016. (*f76*)HasFiberData: BOOLEAN;
  3017. (*f77*)IdealProcessor: BOOLEAN;
  3018. (*f78*)Spare3: ULONG;
  3019. (*f7c*)ReservedForPerf: PVOID;
  3020. (*f80*)ReservedForOle: PVOID;
  3021. (*f84*)WaitingOnLoaderLock: PVOID;
  3022. (*f88*)Wx86Thread: Wx86ThreadState;
  3023. (*f94*)TlsExpansionSlots: PPVOID;
  3024. (*f98*)ImpersonationLocale: LCID;
  3025. (*f9c*)IsImpersonating: ULONG;
  3026. (*fa0*)NlsCache: PVOID;
  3027. (*fa4*)pShimData: PVOID;
  3028. (*fa8*)HeapVirtualAffinity: ULONG;
  3029. (*fac*)CurrentTransactionHandle: PVOID;
  3030. (*fb0*)ActiveFrame: PTEB_ACTIVE_FRAME;
  3031. case Integer of
  3032. 0: (
  3033. (*fb4*)SafeThunkCall: BOOLEAN; // Before Windows 2003
  3034. (*fb5*)BooleanSpare: array[0..2] of BOOLEAN // Before Windows 2003
  3035. );
  3036. 1: (
  3037. (*fb4*)FlsData: PVOID; // Starting with Windows 2003
  3038. )
  3039. )
  3040. end;
  3041. TEB = _TEB;
  3042. PTEB = ^_TEB;
  3043. PPTEB = ^PTEB;
  3044. type
  3045. _OBJECT_NAME_INFORMATION = record
  3046. Name: UNICODE_STRING;
  3047. end;
  3048. OBJECT_NAME_INFORMATION = _OBJECT_NAME_INFORMATION;
  3049. POBJECT_NAME_INFORMATION = ^OBJECT_NAME_INFORMATION;
  3050. TObjectNameInformation = OBJECT_NAME_INFORMATION;
  3051. PObjectNameInformation = ^OBJECT_NAME_INFORMATION;
  3052. const
  3053. NtCurrentProcess = HANDLE(-1);
  3054. NtCurrentThread = HANDLE(-2);
  3055. // Object Manager specific stuff
  3056. OBJ_NAME_PATH_SEPARATOR = '\';
  3057. // Object Manager Object Type Specific Access Rights.
  3058. OBJECT_TYPE_CREATE = $0001;
  3059. OBJECT_TYPE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or $1;
  3060. // Object Manager Directory Specific Access Rights.
  3061. DIRECTORY_QUERY = $0001;
  3062. DIRECTORY_TRAVERSE = $0002;
  3063. DIRECTORY_CREATE_OBJECT = $0004;
  3064. DIRECTORY_CREATE_SUBDIRECTORY = $0008;
  3065. DIRECTORY_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or $F;
  3066. // Object Manager Symbolic Link Specific Access Rights.
  3067. SYMBOLIC_LINK_QUERY = $0001;
  3068. SYMBOLIC_LINK_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or $1;
  3069. {$IFNDEF JWA_INCLUDEMODE}
  3070. DUPLICATE_CLOSE_SOURCE = $00000001;
  3071. DUPLICATE_SAME_ACCESS = $00000002;
  3072. DUPLICATE_SAME_ATTRIBUTES = $00000004;
  3073. {$ENDIF JWA_INCLUDEMODE}
  3074. //
  3075. // Define the access check value for any access
  3076. //
  3077. //
  3078. // The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in
  3079. // ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these
  3080. // constants *MUST* always be in sync.
  3081. //
  3082. //
  3083. // FILE_SPECIAL_ACCESS is checked by the NT I/O system the same as FILE_ANY_ACCESS.
  3084. // The file systems, however, may add additional access checks for I/O and FS controls
  3085. // that use this value.
  3086. //
  3087. {$IFNDEF JWA_INCLUDEMODE}
  3088. FILE_ANY_ACCESS = 0;
  3089. FILE_SPECIAL_ACCESS = FILE_ANY_ACCESS;
  3090. FILE_READ_ACCESS = $0001; // file & pipe
  3091. FILE_WRITE_ACCESS = $0002; // file & pipe
  3092. //
  3093. // Define share access rights to files and directories
  3094. //
  3095. FILE_SHARE_READ = $00000001; // JwaWindows.pas
  3096. FILE_SHARE_WRITE = $00000002; // JwaWindows.pas
  3097. FILE_SHARE_DELETE = $00000004; // JwaWindows.pas
  3098. {$ENDIF JWA_INCLUDEMODE}
  3099. FILE_SHARE_VALID_FLAGS = $00000007;
  3100. //
  3101. // Define the file attributes values
  3102. //
  3103. // Note: = $00000008 is reserved for use for the old DOS VOLID (volume ID)
  3104. // and is therefore not considered valid in NT.
  3105. //
  3106. // Note: = $00000010 is reserved for use for the old DOS SUBDIRECTORY flag
  3107. // and is therefore not considered valid in NT. This flag has
  3108. // been disassociated with file attributes since the other flags are
  3109. // protected with READ_ and WRITE_ATTRIBUTES access to the file.
  3110. //
  3111. // Note: Note also that the order of these flags is set to allow both the
  3112. // FAT and the Pinball File Systems to directly set the attributes
  3113. // flags in attributes words without having to pick each flag out
  3114. // individually. The order of these flags should not be changed!
  3115. //
  3116. {$IFNDEF JWA_INCLUDEMODE}
  3117. FILE_ATTRIBUTE_READONLY = $00000001; // JwaWindows.pas
  3118. FILE_ATTRIBUTE_HIDDEN = $00000002; // JwaWindows.pas
  3119. FILE_ATTRIBUTE_SYSTEM = $00000004; // JwaWindows.pas
  3120. //OLD DOS VOLID = $00000008
  3121. FILE_ATTRIBUTE_DIRECTORY = $00000010; // JwaWindows.pas
  3122. FILE_ATTRIBUTE_ARCHIVE = $00000020; // JwaWindows.pas
  3123. FILE_ATTRIBUTE_DEVICE = $00000040; // JwaWindows.pas
  3124. FILE_ATTRIBUTE_NORMAL = $00000080; // JwaWindows.pas
  3125. FILE_ATTRIBUTE_TEMPORARY = $00000100; // JwaWindows.pas
  3126. FILE_ATTRIBUTE_SPARSE_FILE = $00000200; // JwaWindows.pas
  3127. FILE_ATTRIBUTE_REPARSE_POINT = $00000400; // JwaWindows.pas
  3128. FILE_ATTRIBUTE_COMPRESSED = $00000800; // JwaWindows.pas
  3129. FILE_ATTRIBUTE_OFFLINE = $00001000; // JwaWindows.pas
  3130. FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = $00002000; // JwaWindows.pas
  3131. FILE_ATTRIBUTE_ENCRYPTED = $00004000; // JwaWindows.pas
  3132. //
  3133. // This definition is old and will disappear shortly
  3134. //
  3135. FILE_ATTRIBUTE_VALID_FLAGS = $00007FB7;
  3136. FILE_ATTRIBUTE_VALID_SET_FLAGS = $000031A7;
  3137. {$ENDIF JWA_INCLUDEMODE}
  3138. //
  3139. // Define the create disposition values
  3140. //
  3141. FILE_SUPERSEDE = $00000000;
  3142. FILE_OPEN = $00000001;
  3143. FILE_CREATE = $00000002;
  3144. FILE_OPEN_IF = $00000003;
  3145. FILE_OVERWRITE = $00000004;
  3146. FILE_OVERWRITE_IF = $00000005;
  3147. FILE_MAXIMUM_DISPOSITION = $00000005;
  3148. //
  3149. // Define the create/open option flags
  3150. //
  3151. FILE_DIRECTORY_FILE = $00000001;
  3152. FILE_WRITE_THROUGH = $00000002;
  3153. FILE_SEQUENTIAL_ONLY = $00000004;
  3154. FILE_NO_INTERMEDIATE_BUFFERING = $00000008;
  3155. FILE_SYNCHRONOUS_IO_ALERT = $00000010;
  3156. FILE_SYNCHRONOUS_IO_NONALERT = $00000020;
  3157. FILE_NON_DIRECTORY_FILE = $00000040;
  3158. FILE_CREATE_TREE_CONNECTION = $00000080;
  3159. FILE_COMPLETE_IF_OPLOCKED = $00000100;
  3160. FILE_NO_EA_KNOWLEDGE = $00000200;
  3161. FILE_OPEN_FOR_RECOVERY = $00000400;
  3162. FILE_RANDOM_ACCESS = $00000800;
  3163. FILE_DELETE_ON_CLOSE = $00001000;
  3164. FILE_OPEN_BY_FILE_ID = $00002000;
  3165. FILE_OPEN_FOR_BACKUP_INTENT = $00004000;
  3166. FILE_NO_COMPRESSION = $00008000;
  3167. FILE_RESERVE_OPFILTER = $00100000;
  3168. FILE_OPEN_REPARSE_POINT = $00200000;
  3169. FILE_OPEN_NO_RECALL = $00400000;
  3170. FILE_OPEN_FOR_FREE_SPACE_QUERY = $00800000;
  3171. FILE_COPY_STRUCTURED_STORAGE = $00000041;
  3172. FILE_STRUCTURED_STORAGE = $00000441;
  3173. FILE_VALID_OPTION_FLAGS = $00FFFFFF;
  3174. FILE_VALID_PIPE_OPTION_FLAGS = $00000032;
  3175. FILE_VALID_MAILSLOT_OPTION_FLAGS = $00000032;
  3176. FILE_VALID_SET_FLAGS = $00000036;
  3177. //
  3178. // Define the I/O status information return values for NtCreateFile/NtOpenFile
  3179. //
  3180. FILE_SUPERSEDED = $00000000;
  3181. FILE_OPENED = $00000001;
  3182. FILE_CREATED = $00000002;
  3183. FILE_OVERWRITTEN = $00000003;
  3184. FILE_EXISTS = $00000004;
  3185. FILE_DOES_NOT_EXIST = $00000005;
  3186. //
  3187. // Define special ByteOffset parameters for read and write operations
  3188. //
  3189. FILE_WRITE_TO_END_OF_FILE = $FFFFFFFF;
  3190. FILE_USE_FILE_POINTER_POSITION = $FFFFFFFE;
  3191. //
  3192. // Define alignment requirement values
  3193. //
  3194. FILE_BYTE_ALIGNMENT = $00000000;
  3195. FILE_WORD_ALIGNMENT = $00000001;
  3196. FILE_LONG_ALIGNMENT = $00000003;
  3197. FILE_QUAD_ALIGNMENT = $00000007;
  3198. FILE_OCTA_ALIGNMENT = $0000000F;
  3199. FILE_32_BYTE_ALIGNMENT = $0000001F;
  3200. FILE_64_BYTE_ALIGNMENT = $0000003F;
  3201. FILE_128_BYTE_ALIGNMENT = $0000007F;
  3202. FILE_256_BYTE_ALIGNMENT = $000000FF;
  3203. FILE_512_BYTE_ALIGNMENT = $000001FF;
  3204. //
  3205. // Define the maximum length of a filename string
  3206. //
  3207. MAXIMUM_FILENAME_LENGTH = 256;
  3208. //
  3209. // Define the various device characteristics flags
  3210. //
  3211. FILE_REMOVABLE_MEDIA = $00000001;
  3212. FILE_READ_ONLY_DEVICE = $00000002;
  3213. FILE_FLOPPY_DISKETTE = $00000004;
  3214. FILE_WRITE_ONCE_MEDIA = $00000008;
  3215. FILE_REMOTE_DEVICE = $00000010;
  3216. FILE_DEVICE_IS_MOUNTED = $00000020;
  3217. FILE_VIRTUAL_VOLUME = $00000040;
  3218. FILE_AUTOGENERATED_DEVICE_NAME = $00000080;
  3219. FILE_DEVICE_SECURE_OPEN = $00000100;
  3220. //
  3221. // Define kernel debugger print prototypes and macros.
  3222. //
  3223. // N.B. The following function cannot be directly imported because there are
  3224. // a few places in the source tree where this function is redefined.
  3225. //
  3226. //procedure DbgBreakPoint(); stdcall;
  3227. //procedure DbgUserBreakPoint(); stdcall;
  3228. //procedure DbgBreakPointWithStatus(Status: ULONG); stdcall;
  3229. //// BEGIN: Reverse function forwarders and custom functions
  3230. //// Using Kernel32 function with same functionality for macros and "future version" functions
  3231. (* Compatibility: All *)
  3232. procedure RtlCopyMemory(
  3233. Destination: PVOID;
  3234. Source: PVOID;
  3235. Length: SIZE_T
  3236. ); stdcall; // Own replacement function
  3237. (* XREF: see GetLastError()! *)
  3238. (* Compatibility: All *)
  3239. // This functions was introduced with Windows XP. The Kernel32 version
  3240. // is a function forwarder for this function.
  3241. function RtlGetLastWin32Error(): DWORD; external 'kernel32.dll' name 'GetLastError'; // imported as kernel32!GetLastError
  3242. (* XREF: see SetLastError()! *)
  3243. (* Compatibility: All *)
  3244. // This functions was introduced with Windows XP. The Kernel32 version
  3245. // is a function forwarder for this function.
  3246. procedure RtlSetLastWin32Error(dwErrCode: DWORD); external 'kernel32.dll' name 'SetLastError'; // imported as kernel32!SetLastError
  3247. // Own function to retrieve the process's heap handle
  3248. (* XREF: see GetProcessHeap()! *)
  3249. (* Compatibility: All *)
  3250. function NtpGetProcessHeap(): HANDLE;
  3251. // Own function to retrieve the thread environment block (TEB) pointer
  3252. (* Compatibility: All *)
  3253. function NtpCurrentTeb(): PTEB;
  3254. // Own function to retrieve the process environment block (PEB) pointer
  3255. (* Compatibility: All *)
  3256. function RtlpGetCurrentPeb(): PPEB;
  3257. // No FASTCALL directive exists in Delphi so we write our own versions ...
  3258. // Own function to swap bytes in 16bit values
  3259. function RtlUshortByteSwap(Source: USHORT): USHORT;
  3260. // Own function to swap bytes in 32bit values
  3261. function RtlUlongByteSwap(Source: ULONG): ULONG;
  3262. // Own function to swap bytes in 64bit values
  3263. function RtlUlonglongByteSwap(Source: ULONGLONG): ULONGLONG;
  3264. // Resembles the RtlValidateUnicodeString() function available from Windows XP
  3265. // on exactly as it is on this OS version, except for the calling convention.
  3266. function RtlpValidateUnicodeString(dwMustBeNull: DWORD; UnicodeString: PUNICODE_STRING): NTSTATUS;
  3267. // Resembles the RtlValidateUnicodeString() function available from Windows XP
  3268. // on, but does not require the first parameter which anyway must be zero.
  3269. function RtlpValidateUnicodeString2(UnicodeString: PUNICODE_STRING): NTSTATUS;
  3270. //// END : Reverse function forwarders and custom functions
  3271. //// BEGIN: Function prototypes
  3272. // Compatibility: WXP, 2K3
  3273. function CsrGetProcessId(): DWORD; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3274. // Compatibility: WXP, 2K3
  3275. function DbgQueryDebugFilterState(
  3276. ComponentId : ULONG;
  3277. Level : ULONG
  3278. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3279. // Compatibility: WXP, 2K3
  3280. function DbgSetDebugFilterState(
  3281. ComponentId : ULONG;
  3282. Level : ULONG;
  3283. State : BOOLEAN
  3284. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3285. // Unknown return value, maybe NTSTATUS?
  3286. // Compatibility: NT4, W2K, WXP, 2K3
  3287. function KiRaiseUserExceptionDispatcher(): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3288. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3289. function LdrAccessResource(
  3290. hModule : HANDLE;
  3291. ResourceDataEntry : PIMAGE_RESOURCE_DATA_ENTRY;
  3292. Address : PPVOID;
  3293. dwSize : PULONG
  3294. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3295. // Compatibility: W2K, WXP, 2K3
  3296. function LdrAlternateResourcesEnabled(): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3297. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3298. function LdrDisableThreadCalloutsForDll(
  3299. hModule : HANDLE
  3300. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3301. // This function is very similar to GetModuleHandle() from Kernel32.dll.
  3302. // Refer to the PSDK for additional information. Usually the same flags
  3303. // apply.
  3304. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3305. function LdrGetDllHandle(
  3306. pwPath : PWORD;
  3307. pReserved : PVOID;
  3308. pusPath : PUNICODE_STRING;
  3309. var phModule : HANDLE
  3310. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3311. // This function is very similar to GetProcAddress() from Kernel32.dll.
  3312. // Refer to the PSDK for additional information. Usually the same flags
  3313. // apply.
  3314. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3315. function LdrGetProcedureAddress(
  3316. hModule : HANDLE;
  3317. dwOrdinal : ULONG;
  3318. psName : PSTRING;
  3319. var pProcedure : PVOID
  3320. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3321. // This function is very similar to LoadLibrary() from Kernel32.dll. Refer
  3322. // to the PSDK for additional information. Usually the same flags apply.
  3323. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3324. function LdrLoadDll(
  3325. pwPath : PWORD;
  3326. pdwFlags : PDWORD;
  3327. pusPath : PUNICODE_STRING;
  3328. var phModule : HANDLE
  3329. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3330. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3331. function LdrQueryImageFileExecutionOptions(
  3332. pusImagePath : PUNICODE_STRING;
  3333. pwOptionName : PWORD;
  3334. dwRequestedType : DWORD;
  3335. pData : PVOID;
  3336. dwSize : DWORD;
  3337. pdwSize : PDWORD
  3338. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3339. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3340. function LdrQueryProcessModuleInformation(
  3341. psmi : PSYSTEM_MODULE_INFORMATION;
  3342. dwSize : DWORD;
  3343. pdwSize : PDWORD
  3344. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3345. // This function is very similar to TerminateProcess() from Kernel32.dll.
  3346. // Refer to the PSDK for additional information. Usually the same flags
  3347. // apply.
  3348. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3349. procedure LdrShutdownProcess(); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3350. // This function is very similar to TerminateThread() from Kernel32.dll.
  3351. // Refer to the PSDK for additional information. Usually the same flags
  3352. // apply.
  3353. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3354. procedure LdrShutdownThread(); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3355. // This function is very similar to FreeLibrary() from Kernel32.dll. Refer
  3356. // to the PSDK for additional information. Usually the same flags apply.
  3357. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3358. function LdrUnloadDll(
  3359. hModule : HANDLE
  3360. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3361. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3362. function NtAcceptConnectPort(
  3363. PortHandle : PHANDLE;
  3364. PortIdentifier : ULONG;
  3365. Message : PPORT_MESSAGE;
  3366. Accept : BOOLEAN;
  3367. WriteSection : PPORT_SECTION_WRITE;
  3368. ReadSection : PPORT_SECTION_READ
  3369. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3370. function ZwAcceptConnectPort(PortHandle: PHANDLE; PortIdentifier: ULONG; Message: PPORT_MESSAGE; Accept: BOOLEAN; WriteSection: PPORT_SECTION_WRITE; ReadSection: PPORT_SECTION_READ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;
  3371. {$ENDIF}
  3372. // This function is very similar to AccessCheck() from Advapi32.dll. Refer
  3373. // to the PSDK for additional information. Usually the same flags apply.
  3374. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3375. function NtAccessCheck(
  3376. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  3377. TokenHandle : HANDLE;
  3378. DesiredAccess : ACCESS_MASK;
  3379. GenericMapping : PGENERIC_MAPPING;
  3380. PrivilegeSet : PPRIVILEGE_SET;
  3381. PrivilegeSetLength : PULONG;
  3382. GrantedAccess : PACCESS_MASK;
  3383. AccessStatus : PBOOLEAN
  3384. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3385. function ZwAccessCheck(SecurityDescriptor: PSECURITY_DESCRIPTOR; TokenHandle: HANDLE; DesiredAccess: ACCESS_MASK; GenericMapping: PGENERIC_MAPPING; PrivilegeSet: PPRIVILEGE_SET; PrivilegeSetLength: PULONG; GrantedAccess: PACCESS_MASK;
  3386. AccessStatus: PBOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3387. // This function is very similar to AccessCheckAndAuditAlarm() from
  3388. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  3389. // same flags apply.
  3390. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3391. function NtAccessCheckAndAuditAlarm(
  3392. SubsystemName : PUNICODE_STRING;
  3393. HandleId : PVOID;
  3394. ObjectTypeName : PUNICODE_STRING;
  3395. ObjectName : PUNICODE_STRING;
  3396. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  3397. DesiredAccess : ACCESS_MASK;
  3398. GenericMapping : PGENERIC_MAPPING;
  3399. ObjectCreation : BOOLEAN;
  3400. GrantedAccess : PACCESS_MASK;
  3401. AccessStatus : PBOOLEAN;
  3402. GenerateOnClose : PBOOLEAN
  3403. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3404. function ZwAccessCheckAndAuditAlarm(SubsystemName: PUNICODE_STRING; HandleId: PVOID; ObjectTypeName: PUNICODE_STRING; ObjectName: PUNICODE_STRING; SecurityDescriptor: PSECURITY_DESCRIPTOR; DesiredAccess: ACCESS_MASK;
  3405. GenericMapping: PGENERIC_MAPPING; ObjectCreation: BOOLEAN; GrantedAccess: PACCESS_MASK; AccessStatus: PBOOLEAN; GenerateOnClose: PBOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3406. // This function is very similar to AccessCheckByType() from Advapi32.dll.
  3407. // Refer to the PSDK for additional information. Usually the same flags
  3408. // apply.
  3409. // Compatibility: W2K, WXP, 2K3
  3410. function NtAccessCheckByType(
  3411. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  3412. PrincipalSelfSid : PSID;
  3413. TokenHandle : HANDLE;
  3414. DesiredAccess : ACCESS_MASK;
  3415. ObjectTypeList : POBJECT_TYPE_LIST;
  3416. ObjectTypeListLength : ULONG;
  3417. GenericMapping : PGENERIC_MAPPING;
  3418. PrivilegeSet : PPRIVILEGE_SET;
  3419. PrivilegeSetLength : PULONG;
  3420. GrantedAccess : PACCESS_MASK;
  3421. AccessStatus : PULONG
  3422. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3423. function ZwAccessCheckByType(SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID; TokenHandle: HANDLE; DesiredAccess: ACCESS_MASK; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: ULONG;
  3424. GenericMapping: PGENERIC_MAPPING; PrivilegeSet: PPRIVILEGE_SET; PrivilegeSetLength: PULONG; GrantedAccess: PACCESS_MASK; AccessStatus: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3425. // This function is very similar to AccessCheckByTypeAndAuditAlarm() from
  3426. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  3427. // same flags apply.
  3428. // Compatibility: W2K, WXP, 2K3
  3429. function NtAccessCheckByTypeAndAuditAlarm(
  3430. SubsystemName : PUNICODE_STRING;
  3431. HandleId : PVOID;
  3432. ObjectTypeName : PUNICODE_STRING;
  3433. ObjectName : PUNICODE_STRING;
  3434. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  3435. PrincipalSelfSid : PSID;
  3436. DesiredAccess : ACCESS_MASK;
  3437. AuditType : AUDIT_EVENT_TYPE;
  3438. Flags : ULONG;
  3439. ObjectTypeList : POBJECT_TYPE_LIST;
  3440. ObjectTypeListLength : ULONG;
  3441. GenericMapping : PGENERIC_MAPPING;
  3442. ObjectCreation : BOOLEAN;
  3443. GrantedAccess : PACCESS_MASK;
  3444. AccessStatus : PULONG;
  3445. GenerateOnClose : PBOOLEAN
  3446. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3447. function ZwAccessCheckByTypeAndAuditAlarm(SubsystemName: PUNICODE_STRING; HandleId: PVOID; ObjectTypeName: PUNICODE_STRING; ObjectName: PUNICODE_STRING; SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID;
  3448. DesiredAccess: ACCESS_MASK; AuditType: AUDIT_EVENT_TYPE; Flags: ULONG; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: ULONG; GenericMapping: PGENERIC_MAPPING; ObjectCreation: BOOLEAN; GrantedAccess: PACCESS_MASK;
  3449. AccessStatus: PULONG; GenerateOnClose: PBOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3450. // This function is very similar to AccessCheckByTypeResultList() from
  3451. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  3452. // same flags apply.
  3453. // Compatibility: W2K, WXP, 2K3
  3454. function NtAccessCheckByTypeResultList(
  3455. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  3456. PrincipalSelfSid : PSID;
  3457. TokenHandle : HANDLE;
  3458. DesiredAccess : ACCESS_MASK;
  3459. ObjectTypeList : POBJECT_TYPE_LIST;
  3460. ObjectTypeListLength : ULONG;
  3461. GenericMapping : PGENERIC_MAPPING;
  3462. PrivilegeSet : PPRIVILEGE_SET;
  3463. PrivilegeSetLength : PULONG;
  3464. GrantedAccessList : PACCESS_MASK;
  3465. AccessStatusList : PULONG
  3466. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3467. function ZwAccessCheckByTypeResultList(SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID; TokenHandle: HANDLE; DesiredAccess: ACCESS_MASK; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: ULONG;
  3468. GenericMapping: PGENERIC_MAPPING; PrivilegeSet: PPRIVILEGE_SET; PrivilegeSetLength: PULONG; GrantedAccessList: PACCESS_MASK; AccessStatusList: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3469. // This function is very similar to
  3470. // AccessCheckByTypeResultListAndAuditAlarm() from Advapi32.dll. Refer to
  3471. // the PSDK for additional information. Usually the same flags apply.
  3472. // Compatibility: W2K, WXP, 2K3
  3473. function NtAccessCheckByTypeResultListAndAuditAlarm(
  3474. SubsystemName : PUNICODE_STRING;
  3475. HandleId : PVOID;
  3476. ObjectTypeName : PUNICODE_STRING;
  3477. ObjectName : PUNICODE_STRING;
  3478. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  3479. PrincipalSelfSid : PSID;
  3480. DesiredAccess : ACCESS_MASK;
  3481. AuditType : AUDIT_EVENT_TYPE;
  3482. Flags : ULONG;
  3483. ObjectTypeList : POBJECT_TYPE_LIST;
  3484. ObjectTypeListLength : ULONG;
  3485. GenericMapping : PGENERIC_MAPPING;
  3486. ObjectCreation : BOOLEAN;
  3487. GrantedAccessList : PACCESS_MASK;
  3488. AccessStatusList : PULONG;
  3489. GenerateOnClose : PULONG
  3490. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3491. function ZwAccessCheckByTypeResultListAndAuditAlarm(SubsystemName: PUNICODE_STRING; HandleId: PVOID; ObjectTypeName: PUNICODE_STRING; ObjectName: PUNICODE_STRING; SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID;
  3492. DesiredAccess: ACCESS_MASK; AuditType: AUDIT_EVENT_TYPE; Flags: ULONG; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: ULONG; GenericMapping: PGENERIC_MAPPING; ObjectCreation: BOOLEAN; GrantedAccessList: PACCESS_MASK;
  3493. AccessStatusList: PULONG; GenerateOnClose: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3494. // This function is very similar to
  3495. // AccessCheckByTypeResultListAndAuditAlarmByHandle() from Advapi32.dll.
  3496. // Refer to the PSDK for additional information. Usually the same flags
  3497. // apply.
  3498. // Compatibility: W2K, WXP, 2K3
  3499. function NtAccessCheckByTypeResultListAndAuditAlarmByHandle(
  3500. SubsystemName : PUNICODE_STRING;
  3501. HandleId : PVOID;
  3502. TokenHandle : HANDLE;
  3503. ObjectTypeName : PUNICODE_STRING;
  3504. ObjectName : PUNICODE_STRING;
  3505. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  3506. PrincipalSelfSid : PSID;
  3507. DesiredAccess : ACCESS_MASK;
  3508. AuditType : AUDIT_EVENT_TYPE;
  3509. Flags : ULONG;
  3510. ObjectTypeList : POBJECT_TYPE_LIST;
  3511. ObjectTypeListLength : ULONG;
  3512. GenericMapping : PGENERIC_MAPPING;
  3513. ObjectCreation : BOOLEAN;
  3514. GrantedAccessList : PACCESS_MASK;
  3515. AccessStatusList : PULONG;
  3516. GenerateOnClose : PULONG
  3517. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3518. function ZwAccessCheckByTypeResultListAndAuditAlarmByHandle(SubsystemName: PUNICODE_STRING; HandleId: PVOID; TokenHandle: HANDLE; ObjectTypeName: PUNICODE_STRING; ObjectName: PUNICODE_STRING; SecurityDescriptor: PSECURITY_DESCRIPTOR;
  3519. PrincipalSelfSid: PSID; DesiredAccess: ACCESS_MASK; AuditType: AUDIT_EVENT_TYPE; Flags: ULONG; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: ULONG; GenericMapping: PGENERIC_MAPPING; ObjectCreation: BOOLEAN;
  3520. GrantedAccessList: PACCESS_MASK; AccessStatusList: PULONG; GenerateOnClose: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3521. // Compatibility: NT4, W2K, WXP, 2K3
  3522. function NtAddAtom(
  3523. Str : PWSTR;
  3524. StringLength : ULONG;
  3525. Atom : PUSHORT
  3526. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3527. function ZwAddAtom(Str: PWSTR; StringLength: ULONG; Atom: PUSHORT): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3528. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3529. function NtAdjustGroupsToken(
  3530. TokenHandle : HANDLE;
  3531. ResetToDefault : BOOLEAN;
  3532. NewState : PTOKEN_GROUPS;
  3533. BufferLength : ULONG;
  3534. PreviousState : PTOKEN_GROUPS;
  3535. ReturnLength : PULONG
  3536. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3537. function ZwAdjustGroupsToken(TokenHandle: HANDLE; ResetToDefault: BOOLEAN; NewState: PTOKEN_GROUPS; BufferLength: ULONG; PreviousState: PTOKEN_GROUPS; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3538. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3539. function NtAdjustPrivilegesToken(
  3540. TokenHandle : HANDLE;
  3541. DisableAllPrivileges : BOOLEAN;
  3542. NewState : PTOKEN_PRIVILEGES;
  3543. BufferLength : ULONG;
  3544. PreviousState : PTOKEN_PRIVILEGES;
  3545. ReturnLength : PULONG
  3546. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3547. function ZwAdjustPrivilegesToken(TokenHandle: HANDLE; DisableAllPrivileges: BOOLEAN; NewState: PTOKEN_PRIVILEGES; BufferLength: ULONG; PreviousState: PTOKEN_PRIVILEGES; ReturnLength: PULONG): NTSTATUS; stdcall;
  3548. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3549. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3550. function NtAlertResumeThread(
  3551. ThreadHandle : HANDLE;
  3552. PreviousSuspendCount : PULONG
  3553. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3554. function ZwAlertResumeThread(ThreadHandle: HANDLE; PreviousSuspendCount: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3555. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3556. function NtAlertThread(
  3557. ThreadHandle : HANDLE
  3558. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3559. function ZwAlertThread(ThreadHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3560. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3561. function NtAllocateLocallyUniqueId(
  3562. Luid : PLUID
  3563. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3564. function ZwAllocateLocallyUniqueId(Luid: PLUID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3565. // Compatibility: W2K, WXP, 2K3
  3566. function NtAllocateUserPhysicalPages(
  3567. ProcessHandle : HANDLE;
  3568. NumberOfPages : PULONG;
  3569. PageFrameNumbers : PULONG
  3570. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3571. function ZwAllocateUserPhysicalPages(ProcessHandle: HANDLE; NumberOfPages: PULONG; PageFrameNumbers: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3572. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3573. function NtAllocateUuids(
  3574. UuidLastTimeAllocated : PLARGE_INTEGER;
  3575. UuidDeltaTime : PULONG;
  3576. UuidSequenceNumber : PULONG;
  3577. UuidSeed : PUCHAR
  3578. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3579. function ZwAllocateUuids(UuidLastTimeAllocated: PLARGE_INTEGER; UuidDeltaTime: PULONG; UuidSequenceNumber: PULONG; UuidSeed: PUCHAR): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3580. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3581. function NtAllocateVirtualMemory(
  3582. ProcessHandle : HANDLE;
  3583. BaseAddress : PPVOID;
  3584. ZeroBits : ULONG;
  3585. AllocationSize : PULONG;
  3586. AllocationType : ULONG;
  3587. Protect : ULONG
  3588. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3589. function ZwAllocateVirtualMemory(ProcessHandle: HANDLE; BaseAddress: PPVOID; ZeroBits: ULONG; AllocationSize: PULONG; AllocationType: ULONG; Protect: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3590. // Compatibility: W2K, WXP, 2K3
  3591. function NtAreMappedFilesTheSame(
  3592. Address1 : PVOID;
  3593. Address2 : PVOID
  3594. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3595. function ZwAreMappedFilesTheSame(Address1: PVOID; Address2: PVOID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3596. // Compatibility: W2K, WXP, 2K3
  3597. function NtAssignProcessToJobObject(
  3598. JobHandle : HANDLE;
  3599. ProcessHandle : HANDLE
  3600. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3601. function ZwAssignProcessToJobObject(JobHandle: HANDLE; ProcessHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3602. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3603. function NtCallbackReturn(
  3604. Result_ : PVOID;
  3605. ResultLength : ULONG;
  3606. Status : NTSTATUS
  3607. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3608. function ZwCallbackReturn(Result_: PVOID; ResultLength: ULONG; Status: NTSTATUS): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3609. // Compatibility: W2K, WXP, 2K3
  3610. function NtCancelDeviceWakeupRequest(
  3611. DeviceHandle : HANDLE
  3612. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3613. function ZwCancelDeviceWakeupRequest(DeviceHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3614. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3615. function NtCancelIoFile(
  3616. FileHandle : HANDLE;
  3617. IoStatusBlock : PIO_STATUS_BLOCK
  3618. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3619. function ZwCancelIoFile(FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3620. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3621. function NtCancelTimer(
  3622. TimerHandle : HANDLE;
  3623. PreviousState : PBOOLEAN
  3624. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3625. function ZwCancelTimer(TimerHandle: HANDLE; PreviousState: PBOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3626. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3627. function NtClearEvent(
  3628. EventHandle : HANDLE
  3629. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3630. function ZwClearEvent(EventHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3631. // This function is very similar to CloseHandle() from Kernel32.dll. Refer
  3632. // to the PSDK for additional information. Usually the same flags apply.
  3633. // Documented in the DDK as ZwClose().
  3634. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3635. {$IFNDEF JWA_INCLUDEMODE}
  3636. function NtClose(
  3637. Handle : HANDLE
  3638. ): NTSTATUS; stdcall; {$IFNDEF RTDL} external ntdll; {$ENDIF}
  3639. {$ENDIF JWA_INCLUDEMODE}
  3640. function ZwClose(Handle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3641. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3642. function NtCloseObjectAuditAlarm(
  3643. SubsystemName : PUNICODE_STRING;
  3644. HandleId : PVOID;
  3645. GenerateOnClose : BOOLEAN
  3646. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3647. function ZwCloseObjectAuditAlarm(SubsystemName: PUNICODE_STRING; HandleId: PVOID; GenerateOnClose: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3648. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3649. function NtCompleteConnectPort(
  3650. PortHandle : HANDLE
  3651. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3652. function ZwCompleteConnectPort(PortHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3653. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3654. function NtConnectPort(
  3655. PortHandle : PHANDLE;
  3656. PortName : PUNICODE_STRING;
  3657. SecurityQos : PSECURITY_QUALITY_OF_SERVICE;
  3658. WriteSection : PPORT_SECTION_WRITE;
  3659. ReadSection : PPORT_SECTION_READ;
  3660. MaxMessageSize : PULONG;
  3661. ConnectData : PVOID;
  3662. ConnectDataLength : PULONG
  3663. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3664. function ZwConnectPort(PortHandle: PHANDLE; PortName: PUNICODE_STRING; SecurityQos: PSECURITY_QUALITY_OF_SERVICE; WriteSection: PPORT_SECTION_WRITE; ReadSection: PPORT_SECTION_READ; MaxMessageSize: PULONG; ConnectData: PVOID;
  3665. ConnectDataLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3666. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3667. function NtContinue(
  3668. Context : PCONTEXT;
  3669. TestAlert : BOOLEAN
  3670. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3671. function ZwContinue(Context: PCONTEXT; TestAlert: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3672. // Returns STATUS_NOT_IMPLEMENTED. Only MS knows the intention behind this.
  3673. //
  3674. // !!!DO NOT USE!!!
  3675. // Compatibility: NT4, W2K
  3676. function NtCreateChannel(
  3677. ChannelHandle : PHANDLE;
  3678. ObjectAttributes : POBJECT_ATTRIBUTES
  3679. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3680. function ZwCreateChannel(ChannelHandle: PHANDLE; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3681. // Documented in the DDK as ZwCreateDirectoryObject().
  3682. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3683. function NtCreateDirectoryObject(
  3684. DirectoryHandle : PHANDLE;
  3685. DesiredAccess : ACCESS_MASK;
  3686. ObjectAttributes : POBJECT_ATTRIBUTES
  3687. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3688. function ZwCreateDirectoryObject(DirectoryHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3689. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3690. function NtCreateEvent(
  3691. EventHandle : PHANDLE;
  3692. DesiredAccess : ACCESS_MASK;
  3693. ObjectAttributes : POBJECT_ATTRIBUTES;
  3694. EventType : EVENT_TYPE;
  3695. InitialState : BOOLEAN
  3696. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3697. function ZwCreateEvent(EventHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; EventType: EVENT_TYPE; InitialState: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3698. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3699. function NtCreateEventPair(
  3700. EventPairHandle : PHANDLE;
  3701. DesiredAccess : ACCESS_MASK;
  3702. ObjectAttributes : POBJECT_ATTRIBUTES
  3703. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3704. function ZwCreateEventPair(EventPairHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3705. {$IFNDEF JWA_INCLUDEMODE}
  3706. // Documented in the DDK as ZwCreateFile().
  3707. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3708. function NtCreateFile(
  3709. FileHandle : PHANDLE;
  3710. DesiredAccess : ACCESS_MASK;
  3711. ObjectAttributes : POBJECT_ATTRIBUTES;
  3712. IoStatusBlock : PIO_STATUS_BLOCK;
  3713. AllocationSize : PLARGE_INTEGER;
  3714. FileAttributes : ULONG;
  3715. ShareAccess : ULONG;
  3716. CreateDisposition : ULONG;
  3717. CreateOptions : ULONG;
  3718. EaBuffer : PVOID;
  3719. EaLength : ULONG
  3720. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3721. {$ENDIF JWA_INCLUDEMODE}
  3722. function ZwCreateFile(FileHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; IoStatusBlock: PIO_STATUS_BLOCK; AllocationSize: PLARGE_INTEGER; FileAttributes: ULONG; ShareAccess: ULONG;
  3723. CreateDisposition: ULONG; CreateOptions: ULONG; EaBuffer: PVOID; EaLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3724. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3725. function NtCreateIoCompletion(
  3726. IoCompletionHandle : PHANDLE;
  3727. DesiredAccess : ACCESS_MASK;
  3728. ObjectAttributes : POBJECT_ATTRIBUTES;
  3729. NumberOfConcurrentThreads : ULONG
  3730. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3731. function ZwCreateIoCompletion(IoCompletionHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; NumberOfConcurrentThreads: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3732. // Compatibility: W2K, WXP, 2K3
  3733. function NtCreateJobObject(
  3734. JobHandle : PHANDLE;
  3735. DesiredAccess : ACCESS_MASK;
  3736. ObjectAttributes : POBJECT_ATTRIBUTES
  3737. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3738. function ZwCreateJobObject(JobHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3739. // Documented in the DDK as ZwCreateKey().
  3740. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3741. function NtCreateKey(
  3742. KeyHandle : PHANDLE;
  3743. DesiredAccess : ACCESS_MASK;
  3744. ObjectAttributes : POBJECT_ATTRIBUTES;
  3745. TitleIndex : ULONG;
  3746. Class_ : PUNICODE_STRING;
  3747. CreateOptions : ULONG;
  3748. Disposition : PULONG
  3749. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3750. function ZwCreateKey(KeyHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; TitleIndex: ULONG; Class_: PUNICODE_STRING; CreateOptions: ULONG; Disposition: PULONG): NTSTATUS; stdcall;
  3751. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3752. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3753. function NtCreateMailslotFile(
  3754. FileHandle : PHANDLE;
  3755. DesiredAccess : ACCESS_MASK;
  3756. ObjectAttributes : POBJECT_ATTRIBUTES;
  3757. IoStatusBlock : PIO_STATUS_BLOCK;
  3758. CreateOptions : ULONG;
  3759. Unknown : ULONG;
  3760. MaxMessageSize : ULONG;
  3761. ReadTimeout : PLARGE_INTEGER
  3762. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3763. function ZwCreateMailslotFile(FileHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; IoStatusBlock: PIO_STATUS_BLOCK; CreateOptions: ULONG; Unknown: ULONG; MaxMessageSize: ULONG;
  3764. ReadTimeout: PLARGE_INTEGER): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3765. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3766. function NtCreateMutant(
  3767. MutantHandle : PHANDLE;
  3768. DesiredAccess : ACCESS_MASK;
  3769. ObjectAttributes : POBJECT_ATTRIBUTES;
  3770. InitialOwner : BOOLEAN
  3771. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3772. function ZwCreateMutant(MutantHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; InitialOwner: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3773. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3774. function NtCreateNamedPipeFile(
  3775. FileHandle : PHANDLE;
  3776. DesiredAccess : ACCESS_MASK;
  3777. ObjectAttributes : POBJECT_ATTRIBUTES;
  3778. IoStatusBlock : PIO_STATUS_BLOCK;
  3779. ShareAccess : ULONG;
  3780. CreateDisposition : ULONG;
  3781. CreateOptions : ULONG;
  3782. TypeMessage : BOOLEAN;
  3783. ReadmodeMessage : BOOLEAN;
  3784. Nonblocking : BOOLEAN;
  3785. MaxInstances : ULONG;
  3786. InBufferSize : ULONG;
  3787. OutBufferSize : ULONG;
  3788. DefaultTimeout : PLARGE_INTEGER
  3789. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3790. function ZwCreateNamedPipeFile(FileHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; IoStatusBlock: PIO_STATUS_BLOCK; ShareAccess: ULONG; CreateDisposition: ULONG; CreateOptions: ULONG;
  3791. TypeMessage: BOOLEAN; ReadmodeMessage: BOOLEAN; Nonblocking: BOOLEAN; MaxInstances: ULONG; InBufferSize: ULONG; OutBufferSize: ULONG; DefaultTimeout: PLARGE_INTEGER): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3792. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3793. function NtCreatePagingFile(
  3794. FileName : PUNICODE_STRING;
  3795. InitialSize : PULARGE_INTEGER;
  3796. MaximumSize : PULARGE_INTEGER;
  3797. Reserved : ULONG
  3798. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3799. function ZwCreatePagingFile(FileName: PUNICODE_STRING; InitialSize: PULARGE_INTEGER; MaximumSize: PULARGE_INTEGER; Reserved: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3800. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3801. function NtCreatePort(
  3802. PortHandle : PHANDLE;
  3803. ObjectAttributes : POBJECT_ATTRIBUTES;
  3804. MaxDataSize : ULONG;
  3805. MaxMessageSize : ULONG;
  3806. Reserved : ULONG
  3807. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3808. function ZwCreatePort(PortHandle: PHANDLE; ObjectAttributes: POBJECT_ATTRIBUTES; MaxDataSize: ULONG; MaxMessageSize: ULONG; Reserved: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3809. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3810. function NtCreateProcess(
  3811. ProcessHandle : PHANDLE;
  3812. DesiredAccess : ACCESS_MASK;
  3813. ObjectAttributes : POBJECT_ATTRIBUTES;
  3814. InheritFromProcessHandle : HANDLE;
  3815. InheritHandles : BOOLEAN;
  3816. SectionHandle : HANDLE;
  3817. DebugPort : HANDLE;
  3818. ExceptionPort : HANDLE
  3819. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3820. function ZwCreateProcess(ProcessHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; InheritFromProcessHandle: HANDLE; InheritHandles: BOOLEAN; SectionHandle: HANDLE; DebugPort: HANDLE;
  3821. ExceptionPort: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3822. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3823. function NtCreateProfile(
  3824. ProfileHandle : PHANDLE;
  3825. ProcessHandle : HANDLE;
  3826. Base : PVOID;
  3827. Size : ULONG;
  3828. BucketShift : ULONG;
  3829. Buffer : PULONG;
  3830. BufferLength : ULONG;
  3831. Source : KPROFILE_SOURCE;
  3832. ProcessorMask : ULONG
  3833. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3834. function ZwCreateProfile(ProfileHandle: PHANDLE; ProcessHandle: HANDLE; Base: PVOID; Size: ULONG; BucketShift: ULONG; Buffer: PULONG; BufferLength: ULONG; Source: KPROFILE_SOURCE; ProcessorMask: ULONG): NTSTATUS; stdcall;
  3835. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3836. // Documented in the DDK as ZwCreateSection().
  3837. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3838. function NtCreateSection(
  3839. SectionHandle : PHANDLE;
  3840. DesiredAccess : ACCESS_MASK;
  3841. ObjectAttributes : POBJECT_ATTRIBUTES;
  3842. SectionSize : PLARGE_INTEGER;
  3843. Protect : ULONG;
  3844. Attributes : ULONG;
  3845. FileHandle : HANDLE
  3846. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3847. function ZwCreateSection(SectionHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; SectionSize: PLARGE_INTEGER; Protect: ULONG; Attributes: ULONG; FileHandle: HANDLE): NTSTATUS; stdcall;
  3848. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3849. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3850. function NtCreateSemaphore(
  3851. SemaphoreHandle : PHANDLE;
  3852. DesiredAccess : ACCESS_MASK;
  3853. ObjectAttributes : POBJECT_ATTRIBUTES;
  3854. InitialCount : LONG;
  3855. MaximumCount : LONG
  3856. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3857. function ZwCreateSemaphore(SemaphoreHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; InitialCount: LONG; MaximumCount: LONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3858. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3859. function NtCreateSymbolicLinkObject(
  3860. SymbolicLinkHandle : PHANDLE;
  3861. DesiredAccess : ACCESS_MASK;
  3862. ObjectAttributes : POBJECT_ATTRIBUTES;
  3863. TargetName : PUNICODE_STRING
  3864. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3865. function ZwCreateSymbolicLinkObject(SymbolicLinkHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; TargetName: PUNICODE_STRING): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3866. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3867. function NtCreateThread(
  3868. ThreadHandle : PHANDLE;
  3869. DesiredAccess : ACCESS_MASK;
  3870. ObjectAttributes : POBJECT_ATTRIBUTES;
  3871. ProcessHandle : HANDLE;
  3872. ClientId : PCLIENT_ID;
  3873. ThreadContext : PCONTEXT;
  3874. UserStack : PUSER_STACK;
  3875. CreateSuspended : BOOLEAN
  3876. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3877. function ZwCreateThread(ThreadHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; ProcessHandle: HANDLE; ClientId: PCLIENT_ID; ThreadContext: PCONTEXT; UserStack: PUSER_STACK;
  3878. CreateSuspended: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3879. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3880. function NtCreateTimer(
  3881. TimerHandle : PHANDLE;
  3882. DesiredAccess : ACCESS_MASK;
  3883. ObjectAttributes : POBJECT_ATTRIBUTES;
  3884. TimerType : TIMER_TYPE
  3885. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3886. function ZwCreateTimer(TimerHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; TimerType: TIMER_TYPE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3887. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3888. function NtCreateToken(
  3889. TokenHandle : PHANDLE;
  3890. DesiredAccess : ACCESS_MASK;
  3891. ObjectAttributes : POBJECT_ATTRIBUTES;
  3892. Type_ : TOKEN_TYPE;
  3893. AuthenticationId : PLUID;
  3894. ExpirationTime : PLARGE_INTEGER;
  3895. User : PTOKEN_USER;
  3896. Groups : PTOKEN_GROUPS;
  3897. Privileges : PTOKEN_PRIVILEGES;
  3898. Owner : PTOKEN_OWNER;
  3899. PrimaryGroup : PTOKEN_PRIMARY_GROUP;
  3900. DefaultDacl : PTOKEN_DEFAULT_DACL;
  3901. Source : PTOKEN_SOURCE
  3902. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3903. function ZwCreateToken(TokenHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; Type_: TOKEN_TYPE; AuthenticationId: PLUID; ExpirationTime: PLARGE_INTEGER; User: PTOKEN_USER; Groups: PTOKEN_GROUPS;
  3904. Privileges: PTOKEN_PRIVILEGES; Owner: PTOKEN_OWNER; PrimaryGroup: PTOKEN_PRIMARY_GROUP; DefaultDacl: PTOKEN_DEFAULT_DACL; Source: PTOKEN_SOURCE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3905. // Compatibility: W2K, WXP, 2K3
  3906. function NtCreateWaitablePort(
  3907. PortHandle : PHANDLE;
  3908. ObjectAttributes : POBJECT_ATTRIBUTES;
  3909. MaxDataSize : ULONG;
  3910. MaxMessageSize : ULONG;
  3911. Reserved : ULONG
  3912. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3913. function ZwCreateWaitablePort(PortHandle: PHANDLE; ObjectAttributes: POBJECT_ATTRIBUTES; MaxDataSize: ULONG; MaxMessageSize: ULONG; Reserved: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3914. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3915. function NtCurrentTeb(): PTEB; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3916. function ZwCurrentTeb(): PTEB; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3917. // Compatibility: WXP, 2K3
  3918. function NtDebugActiveProcess(
  3919. hProcess : HANDLE;
  3920. hDebugObject : HANDLE
  3921. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3922. function ZwDebugActiveProcess(hProcess: HANDLE; hDebugObject: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3923. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3924. function NtDelayExecution(
  3925. Alertable : BOOLEAN;
  3926. Interval : PLARGE_INTEGER
  3927. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3928. function ZwDelayExecution(Alertable: BOOLEAN; Interval: PLARGE_INTEGER): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3929. // Compatibility: NT4, W2K, WXP, 2K3
  3930. function NtDeleteAtom(
  3931. Atom : USHORT
  3932. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3933. function ZwDeleteAtom(Atom: USHORT): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3934. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3935. function NtDeleteFile(
  3936. ObjectAttributes : POBJECT_ATTRIBUTES
  3937. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3938. function ZwDeleteFile(ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3939. // Documented in the DDK as ZwDeleteKey().
  3940. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3941. function NtDeleteKey(
  3942. KeyHandle : HANDLE
  3943. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3944. function ZwDeleteKey(KeyHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3945. // Compatibility: NT4, W2K, WXP, 2K3
  3946. function NtDeleteObjectAuditAlarm(
  3947. SubsystemName : PUNICODE_STRING;
  3948. HandleId : PVOID;
  3949. GenerateOnClose : BOOLEAN
  3950. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3951. function ZwDeleteObjectAuditAlarm(SubsystemName: PUNICODE_STRING; HandleId: PVOID; GenerateOnClose: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3952. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3953. function NtDeleteValueKey(
  3954. KeyHandle : HANDLE;
  3955. ValueName : PUNICODE_STRING
  3956. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3957. function ZwDeleteValueKey(KeyHandle: HANDLE; ValueName: PUNICODE_STRING): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3958. {$IFNDEF JWA_INCLUDEMODE}
  3959. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3960. function NtDeviceIoControlFile(
  3961. FileHandle : HANDLE;
  3962. Event : HANDLE;
  3963. ApcRoutine : PIO_APC_ROUTINE;
  3964. ApcContext : PVOID;
  3965. IoStatusBlock : PIO_STATUS_BLOCK;
  3966. IoControlCode : ULONG;
  3967. InputBuffer : PVOID;
  3968. InputBufferLength : ULONG;
  3969. OutputBuffer : PVOID;
  3970. OutputBufferLength : ULONG
  3971. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3972. {$ENDIF JWA_INCLUDEMODE}
  3973. function ZwDeviceIoControlFile(FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; IoControlCode: ULONG; InputBuffer: PVOID; InputBufferLength: ULONG; OutputBuffer: PVOID;
  3974. OutputBufferLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3975. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3976. function NtDisplayString(
  3977. Str : PUNICODE_STRING
  3978. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3979. function ZwDisplayString(Str: PUNICODE_STRING): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3980. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3981. function NtDuplicateObject(
  3982. SourceProcessHandle : HANDLE;
  3983. SourceHandle : HANDLE;
  3984. TargetProcessHandle : HANDLE;
  3985. TargetHandle : PHANDLE;
  3986. DesiredAccess : ACCESS_MASK;
  3987. Attributes : ULONG;
  3988. Options : ULONG
  3989. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3990. function ZwDuplicateObject(SourceProcessHandle: HANDLE; SourceHandle: HANDLE; TargetProcessHandle: HANDLE; TargetHandle: PHANDLE; DesiredAccess: ACCESS_MASK; Attributes: ULONG; Options: ULONG): NTSTATUS; stdcall;
  3991. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  3992. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  3993. function NtDuplicateToken(
  3994. ExistingTokenHandle : HANDLE;
  3995. DesiredAccess : ACCESS_MASK;
  3996. ObjectAttributes : POBJECT_ATTRIBUTES;
  3997. EffectiveOnly : BOOLEAN;
  3998. TokenType : TOKEN_TYPE;
  3999. NewTokenHandle : PHANDLE
  4000. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4001. function ZwDuplicateToken(ExistingTokenHandle: HANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; EffectiveOnly: BOOLEAN; TokenType: TOKEN_TYPE; NewTokenHandle: PHANDLE): NTSTATUS; stdcall;
  4002. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4003. // Documented in the DDK as ZwEnumerateKey().
  4004. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4005. function NtEnumerateKey(
  4006. KeyHandle : HANDLE;
  4007. Index : ULONG;
  4008. KeyInformationClass : KEY_INFORMATION_CLASS;
  4009. KeyInformation : PVOID;
  4010. KeyInformationLength : ULONG;
  4011. ResultLength : PULONG
  4012. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4013. function ZwEnumerateKey(KeyHandle: HANDLE; Index: ULONG; KeyInformationClass: KEY_INFORMATION_CLASS; KeyInformation: PVOID; KeyInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4014. // Documented in the DDK as ZwEnumerateValueKey().
  4015. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4016. function NtEnumerateValueKey(
  4017. KeyHandle : HANDLE;
  4018. Index : ULONG;
  4019. KeyValueInformationClass : KEY_VALUE_INFORMATION_CLASS;
  4020. KeyValueInformation : PVOID;
  4021. KeyValueInformationLength : ULONG;
  4022. ResultLength : PULONG
  4023. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4024. function ZwEnumerateValueKey(KeyHandle: HANDLE; Index: ULONG; KeyValueInformationClass: KEY_VALUE_INFORMATION_CLASS; KeyValueInformation: PVOID; KeyValueInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  4025. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4026. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4027. function NtExtendSection(
  4028. SectionHandle : HANDLE;
  4029. SectionSize : PLARGE_INTEGER
  4030. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4031. function ZwExtendSection(SectionHandle: HANDLE; SectionSize: PLARGE_INTEGER): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4032. // Compatibility: W2K, WXP, 2K3
  4033. function NtFilterToken(
  4034. ExistingTokenHandle : HANDLE;
  4035. Flags : ULONG;
  4036. SidsToDisable : PTOKEN_GROUPS;
  4037. PrivilegesToDelete : PTOKEN_PRIVILEGES;
  4038. SidsToRestricted : PTOKEN_GROUPS;
  4039. NewTokenHandle : PHANDLE
  4040. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4041. function ZwFilterToken(ExistingTokenHandle: HANDLE; Flags: ULONG; SidsToDisable: PTOKEN_GROUPS; PrivilegesToDelete: PTOKEN_PRIVILEGES; SidsToRestricted: PTOKEN_GROUPS; NewTokenHandle: PHANDLE): NTSTATUS; stdcall;
  4042. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4043. // Compatibility: NT4, W2K, WXP, 2K3
  4044. function NtFindAtom(
  4045. Str : PWSTR;
  4046. StringLength : ULONG;
  4047. Atom : PUSHORT
  4048. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4049. function ZwFindAtom(Str: PWSTR; StringLength: ULONG; Atom: PUSHORT): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4050. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4051. function NtFlushBuffersFile(
  4052. FileHandle : HANDLE;
  4053. IoStatusBlock : PIO_STATUS_BLOCK
  4054. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4055. function ZwFlushBuffersFile(FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4056. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4057. function NtFlushInstructionCache(
  4058. ProcessHandle : HANDLE;
  4059. BaseAddress : PVOID;
  4060. FlushSize : ULONG
  4061. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4062. function ZwFlushInstructionCache(ProcessHandle: HANDLE; BaseAddress: PVOID; FlushSize: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4063. // Documented in the DDK as ZwFlushKey().
  4064. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4065. function NtFlushKey(
  4066. KeyHandle : HANDLE
  4067. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4068. function ZwFlushKey(KeyHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4069. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4070. function NtFlushVirtualMemory(
  4071. ProcessHandle : HANDLE;
  4072. BaseAddress : PPVOID;
  4073. FlushSize : PULONG;
  4074. IoStatusBlock : PIO_STATUS_BLOCK
  4075. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4076. function ZwFlushVirtualMemory(ProcessHandle: HANDLE; BaseAddress: PPVOID; FlushSize: PULONG; IoStatusBlock: PIO_STATUS_BLOCK): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4077. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4078. function NtFlushWriteBuffer(): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4079. function ZwFlushWriteBuffer(): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4080. // Compatibility: W2K, WXP, 2K3
  4081. function NtFreeUserPhysicalPages(
  4082. ProcessHandle : HANDLE;
  4083. NumberOfPages : PULONG;
  4084. PageFrameNumbers : PULONG
  4085. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4086. function ZwFreeUserPhysicalPages(ProcessHandle: HANDLE; NumberOfPages: PULONG; PageFrameNumbers: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4087. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4088. function NtFreeVirtualMemory(
  4089. ProcessHandle : HANDLE;
  4090. BaseAddress : PPVOID;
  4091. FreeSize : PULONG;
  4092. FreeType : ULONG
  4093. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4094. function ZwFreeVirtualMemory(ProcessHandle: HANDLE; BaseAddress: PPVOID; FreeSize: PULONG; FreeType: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4095. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4096. function NtFsControlFile(
  4097. FileHandle : HANDLE;
  4098. Event : HANDLE;
  4099. ApcRoutine : PIO_APC_ROUTINE;
  4100. ApcContext : PVOID;
  4101. IoStatusBlock : PIO_STATUS_BLOCK;
  4102. FsControlCode : ULONG;
  4103. InputBuffer : PVOID;
  4104. InputBufferLength : ULONG;
  4105. OutputBuffer : PVOID;
  4106. OutputBufferLength : ULONG
  4107. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4108. function ZwFsControlFile(FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; FsControlCode: ULONG; InputBuffer: PVOID; InputBufferLength: ULONG; OutputBuffer: PVOID;
  4109. OutputBufferLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4110. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4111. function NtGetContextThread(
  4112. ThreadHandle : HANDLE;
  4113. Context : PCONTEXT
  4114. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4115. function ZwGetContextThread(ThreadHandle: HANDLE; Context: PCONTEXT): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4116. // Compatibility: 2K3
  4117. function NtGetCurrentProcessorNumber(): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4118. function ZwGetCurrentProcessorNumber(): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4119. // Compatibility: W2K, WXP, 2K3
  4120. function NtGetDevicePowerState(
  4121. DeviceHandle : HANDLE;
  4122. DevicePowerState : PDEVICE_POWER_STATE
  4123. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4124. function ZwGetDevicePowerState(DeviceHandle: HANDLE; DevicePowerState: PDEVICE_POWER_STATE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4125. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4126. function NtGetPlugPlayEvent(
  4127. Reserved1 : ULONG;
  4128. Reserved2 : ULONG;
  4129. Buffer : PVOID;
  4130. BufferLength : ULONG
  4131. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4132. function ZwGetPlugPlayEvent(Reserved1: ULONG; Reserved2: ULONG; Buffer: PVOID; BufferLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4133. // Compatibility: NT3, NT4, W2K, 2K3
  4134. function NtGetTickCount(): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4135. function ZwGetTickCount(): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4136. // Compatibility: W2K, WXP, 2K3
  4137. function NtGetWriteWatch(
  4138. ProcessHandle : HANDLE;
  4139. Flags : ULONG;
  4140. BaseAddress : PVOID;
  4141. RegionSize : ULONG;
  4142. Buffer : PULONG;
  4143. BufferEntries : PULONG;
  4144. Granularity : PULONG
  4145. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4146. function ZwGetWriteWatch(ProcessHandle: HANDLE; Flags: ULONG; BaseAddress: PVOID; RegionSize: ULONG; Buffer: PULONG; BufferEntries: PULONG; Granularity: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4147. // Compatibility: W2K, WXP, 2K3
  4148. function NtImpersonateAnonymousToken(
  4149. ThreadHandle : HANDLE
  4150. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4151. function ZwImpersonateAnonymousToken(ThreadHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4152. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4153. function NtImpersonateClientOfPort(
  4154. PortHandle : HANDLE;
  4155. Message : PPORT_MESSAGE
  4156. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4157. function ZwImpersonateClientOfPort(PortHandle: HANDLE; Message: PPORT_MESSAGE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4158. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4159. function NtImpersonateThread(
  4160. ThreadHandle : HANDLE;
  4161. TargetThreadHandle : HANDLE;
  4162. SecurityQos : PSECURITY_QUALITY_OF_SERVICE
  4163. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4164. function ZwImpersonateThread(ThreadHandle: HANDLE; TargetThreadHandle: HANDLE; SecurityQos: PSECURITY_QUALITY_OF_SERVICE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4165. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4166. function NtInitializeRegistry(
  4167. Setup : BOOLEAN
  4168. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4169. function ZwInitializeRegistry(Setup: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4170. // Compatibility: W2K, WXP, 2K3
  4171. function NtInitiatePowerAction(
  4172. SystemAction : POWER_ACTION;
  4173. MinSystemState : SYSTEM_POWER_STATE;
  4174. Flags : ULONG;
  4175. Asynchronous : BOOLEAN
  4176. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4177. function ZwInitiatePowerAction(SystemAction: POWER_ACTION; MinSystemState: SYSTEM_POWER_STATE; Flags: ULONG; Asynchronous: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4178. // Compatibility: W2K, WXP, 2K3
  4179. function NtIsSystemResumeAutomatic(): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4180. function ZwIsSystemResumeAutomatic(): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4181. // Returns STATUS_NOT_IMPLEMENTED. Only MS knows the intention behind this.
  4182. //
  4183. // !!!DO NOT USE!!!
  4184. // Compatibility: NT4, W2K
  4185. function NtListenChannel(
  4186. x : PVOID;
  4187. y : PVOID
  4188. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4189. function ZwListenChannel(x: PVOID; y: PVOID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4190. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4191. function NtListenPort(
  4192. PortHandle : HANDLE;
  4193. Message : PPORT_MESSAGE
  4194. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4195. function ZwListenPort(PortHandle: HANDLE; Message: PPORT_MESSAGE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4196. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4197. function NtLoadDriver(
  4198. DriverServiceName : PUNICODE_STRING
  4199. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4200. function ZwLoadDriver(DriverServiceName: PUNICODE_STRING): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4201. // Relates to RegLoadKey().
  4202. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4203. function NtLoadKey(
  4204. KeyObjectAttributes : POBJECT_ATTRIBUTES;
  4205. FileObjectAttributes : POBJECT_ATTRIBUTES
  4206. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4207. function ZwLoadKey(KeyObjectAttributes: POBJECT_ATTRIBUTES; FileObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4208. // Relates to RegLoadKey().
  4209. // Compatibility: NT4, W2K, WXP, 2K3
  4210. function NtLoadKey2(
  4211. KeyObjectAttributes : POBJECT_ATTRIBUTES;
  4212. FileObjectAttributes : POBJECT_ATTRIBUTES;
  4213. Flags : ULONG
  4214. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4215. function ZwLoadKey2(KeyObjectAttributes: POBJECT_ATTRIBUTES; FileObjectAttributes: POBJECT_ATTRIBUTES; Flags: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4216. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4217. function NtLockFile(
  4218. FileHandle : HANDLE;
  4219. Event : HANDLE;
  4220. ApcRoutine : PIO_APC_ROUTINE;
  4221. ApcContext : PVOID;
  4222. IoStatusBlock : PIO_STATUS_BLOCK;
  4223. LockOffset : PULARGE_INTEGER;
  4224. LockLength : PULARGE_INTEGER;
  4225. Key : ULONG;
  4226. FailImmediately : BOOLEAN;
  4227. ExclusiveLock : BOOLEAN
  4228. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4229. function ZwLockFile(FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; LockOffset: PULARGE_INTEGER; LockLength: PULARGE_INTEGER; Key: ULONG; FailImmediately: BOOLEAN;
  4230. ExclusiveLock: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4231. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4232. function NtLockVirtualMemory(
  4233. ProcessHandle : HANDLE;
  4234. BaseAddress : PPVOID;
  4235. LockSize : PULONG;
  4236. LockType : ULONG
  4237. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4238. function ZwLockVirtualMemory(ProcessHandle: HANDLE; BaseAddress: PPVOID; LockSize: PULONG; LockType: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4239. // Compatibility: WXP, 2K3
  4240. function NtMakePermanentObject(
  4241. Handle : HANDLE
  4242. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4243. function ZwMakePermanentObject(Handle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4244. // Documented in the DDK as ZwMakeTemporaryObject().
  4245. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4246. function NtMakeTemporaryObject(
  4247. Handle : HANDLE
  4248. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4249. function ZwMakeTemporaryObject(Handle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4250. // Compatibility: W2K, WXP, 2K3
  4251. function NtMapUserPhysicalPages(
  4252. BaseAddress : PVOID;
  4253. NumberOfPages : PULONG;
  4254. PageFrameNumbers : PULONG
  4255. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4256. function ZwMapUserPhysicalPages(BaseAddress: PVOID; NumberOfPages: PULONG; PageFrameNumbers: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4257. // Compatibility: W2K, WXP, 2K3
  4258. function NtMapUserPhysicalPagesScatter(
  4259. BaseAddresses : PPVOID;
  4260. NumberOfPages : PULONG;
  4261. PageFrameNumbers : PULONG
  4262. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4263. function ZwMapUserPhysicalPagesScatter(BaseAddresses: PPVOID; NumberOfPages: PULONG; PageFrameNumbers: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4264. // Documented in the DDK as ZwMapViewOfSection().
  4265. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4266. function NtMapViewOfSection(
  4267. SectionHandle : HANDLE;
  4268. ProcessHandle : HANDLE;
  4269. BaseAddress : PPVOID;
  4270. ZeroBits : ULONG;
  4271. CommitSize : ULONG;
  4272. SectionOffset : PLARGE_INTEGER;
  4273. ViewSize : PULONG;
  4274. InheritDisposition : SECTION_INHERIT;
  4275. AllocationType : ULONG;
  4276. Protect : ULONG
  4277. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4278. function ZwMapViewOfSection(SectionHandle: HANDLE; ProcessHandle: HANDLE; BaseAddress: PPVOID; ZeroBits: ULONG; CommitSize: ULONG; SectionOffset: PLARGE_INTEGER; ViewSize: PULONG; InheritDisposition: SECTION_INHERIT; AllocationType: ULONG;
  4279. Protect: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4280. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4281. function NtNotifyChangeDirectoryFile(
  4282. FileHandle : HANDLE;
  4283. Event : HANDLE;
  4284. ApcRoutine : PIO_APC_ROUTINE;
  4285. ApcContext : PVOID;
  4286. IoStatusBlock : PIO_STATUS_BLOCK;
  4287. Buffer : PFILE_NOTIFY_INFORMATION;
  4288. BufferLength : ULONG;
  4289. NotifyFilter : ULONG;
  4290. WatchSubtree : BOOLEAN
  4291. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4292. function ZwNotifyChangeDirectoryFile(FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_NOTIFY_INFORMATION; BufferLength: ULONG; NotifyFilter: ULONG;
  4293. WatchSubtree: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4294. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4295. function NtNotifyChangeKey(
  4296. KeyHandle : HANDLE;
  4297. EventHandle : HANDLE;
  4298. ApcRoutine : PIO_APC_ROUTINE;
  4299. ApcContext : PVOID;
  4300. IoStatusBlock : PIO_STATUS_BLOCK;
  4301. NotifyFilter : ULONG;
  4302. WatchSubtree : BOOLEAN;
  4303. Buffer : PVOID;
  4304. BufferLength : ULONG;
  4305. Asynchronous : BOOLEAN
  4306. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4307. function ZwNotifyChangeKey(KeyHandle: HANDLE; EventHandle: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; NotifyFilter: ULONG; WatchSubtree: BOOLEAN; Buffer: PVOID; BufferLength: ULONG;
  4308. Asynchronous: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4309. // Compatibility: W2K, WXP, 2K3
  4310. function NtNotifyChangeMultipleKeys(
  4311. KeyHandle : HANDLE;
  4312. Flags : ULONG;
  4313. KeyObjectAttributes : POBJECT_ATTRIBUTES;
  4314. EventHandle : HANDLE;
  4315. ApcRoutine : PIO_APC_ROUTINE;
  4316. ApcContext : PVOID;
  4317. IoStatusBlock : PIO_STATUS_BLOCK;
  4318. NotifyFilter : ULONG;
  4319. WatchSubtree : BOOLEAN;
  4320. Buffer : PVOID;
  4321. BufferLength : ULONG;
  4322. Asynchronous : BOOLEAN
  4323. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4324. function ZwNotifyChangeMultipleKeys(KeyHandle: HANDLE; Flags: ULONG; KeyObjectAttributes: POBJECT_ATTRIBUTES; EventHandle: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; NotifyFilter: ULONG;
  4325. WatchSubtree: BOOLEAN; Buffer: PVOID; BufferLength: ULONG; Asynchronous: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4326. // Returns STATUS_NOT_IMPLEMENTED. Only MS knows the intention behind this.
  4327. //
  4328. // !!!DO NOT USE!!!
  4329. // Compatibility: NT4, W2K
  4330. function NtOpenChannel(
  4331. ChannelHandle : PHANDLE;
  4332. ObjectAttributes : POBJECT_ATTRIBUTES
  4333. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4334. function ZwOpenChannel(ChannelHandle: PHANDLE; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4335. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4336. function NtOpenDirectoryObject(
  4337. DirectoryHandle : PHANDLE;
  4338. DesiredAccess : ACCESS_MASK;
  4339. ObjectAttributes : POBJECT_ATTRIBUTES
  4340. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4341. function ZwOpenDirectoryObject(DirectoryHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4342. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4343. function NtOpenEvent(
  4344. EventHandle : PHANDLE;
  4345. DesiredAccess : ACCESS_MASK;
  4346. ObjectAttributes : POBJECT_ATTRIBUTES
  4347. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4348. function ZwOpenEvent(EventHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4349. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4350. function NtOpenEventPair(
  4351. EventPairHandle : PHANDLE;
  4352. DesiredAccess : ACCESS_MASK;
  4353. ObjectAttributes : POBJECT_ATTRIBUTES
  4354. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4355. function ZwOpenEventPair(EventPairHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4356. {$IFNDEF JWA_INCLUDEMODE}
  4357. // Documented in the DDK as ZwOpenFile().
  4358. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4359. function NtOpenFile(
  4360. FileHandle : PHANDLE;
  4361. DesiredAccess : ACCESS_MASK;
  4362. ObjectAttributes : POBJECT_ATTRIBUTES;
  4363. IoStatusBlock : PIO_STATUS_BLOCK;
  4364. ShareAccess : ULONG;
  4365. OpenOptions : ULONG
  4366. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4367. {$ENDIF JWA_INCLUDEMODE}
  4368. function ZwOpenFile(FileHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; IoStatusBlock: PIO_STATUS_BLOCK; ShareAccess: ULONG; OpenOptions: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4369. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4370. function NtOpenIoCompletion(
  4371. IoCompletionHandle : PHANDLE;
  4372. DesiredAccess : ACCESS_MASK;
  4373. ObjectAttributes : POBJECT_ATTRIBUTES
  4374. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4375. function ZwOpenIoCompletion(IoCompletionHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4376. // Compatibility: W2K, WXP, 2K3
  4377. function NtOpenJobObject(
  4378. JobHandle : PHANDLE;
  4379. DesiredAccess : ACCESS_MASK;
  4380. ObjectAttributes : POBJECT_ATTRIBUTES
  4381. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4382. function ZwOpenJobObject(JobHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4383. // Documented in the DDK as ZwOpenKey().
  4384. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4385. function NtOpenKey(
  4386. KeyHandle : PHANDLE;
  4387. DesiredAccess : ACCESS_MASK;
  4388. ObjectAttributes : POBJECT_ATTRIBUTES
  4389. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4390. function ZwOpenKey(KeyHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4391. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4392. function NtOpenMutant(
  4393. MutantHandle : PHANDLE;
  4394. DesiredAccess : ACCESS_MASK;
  4395. ObjectAttributes : POBJECT_ATTRIBUTES
  4396. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4397. function ZwOpenMutant(MutantHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4398. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4399. function NtOpenObjectAuditAlarm(
  4400. SubsystemName : PUNICODE_STRING;
  4401. HandleId : PPVOID;
  4402. ObjectTypeName : PUNICODE_STRING;
  4403. ObjectName : PUNICODE_STRING;
  4404. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  4405. TokenHandle : HANDLE;
  4406. DesiredAccess : ACCESS_MASK;
  4407. GrantedAccess : ACCESS_MASK;
  4408. Privileges : PPRIVILEGE_SET;
  4409. ObjectCreation : BOOLEAN;
  4410. AccessGranted : BOOLEAN;
  4411. GenerateOnClose : PBOOLEAN
  4412. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4413. function ZwOpenObjectAuditAlarm(SubsystemName: PUNICODE_STRING; HandleId: PPVOID; ObjectTypeName: PUNICODE_STRING; ObjectName: PUNICODE_STRING; SecurityDescriptor: PSECURITY_DESCRIPTOR; TokenHandle: HANDLE; DesiredAccess: ACCESS_MASK;
  4414. GrantedAccess: ACCESS_MASK; Privileges: PPRIVILEGE_SET; ObjectCreation: BOOLEAN; AccessGranted: BOOLEAN; GenerateOnClose: PBOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4415. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4416. function NtOpenProcess(
  4417. ProcessHandle : PHANDLE;
  4418. DesiredAccess : ACCESS_MASK;
  4419. ObjectAttributes : POBJECT_ATTRIBUTES;
  4420. ClientId : PCLIENT_ID
  4421. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4422. function ZwOpenProcess(ProcessHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; ClientId: PCLIENT_ID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4423. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4424. function NtOpenProcessToken(
  4425. ProcessHandle : HANDLE;
  4426. DesiredAccess : ACCESS_MASK;
  4427. TokenHandle : PHANDLE
  4428. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4429. function ZwOpenProcessToken(ProcessHandle: HANDLE; DesiredAccess: ACCESS_MASK; TokenHandle: PHANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4430. // Documented in the DDK as ZwOpenSection().
  4431. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4432. function NtOpenSection(
  4433. SectionHandle : PHANDLE;
  4434. DesiredAccess : ACCESS_MASK;
  4435. ObjectAttributes : POBJECT_ATTRIBUTES
  4436. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4437. function ZwOpenSection(SectionHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4438. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4439. function NtOpenSemaphore(
  4440. SemaphoreHandle : PHANDLE;
  4441. DesiredAccess : ACCESS_MASK;
  4442. ObjectAttributes : POBJECT_ATTRIBUTES
  4443. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4444. function ZwOpenSemaphore(SemaphoreHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4445. // Documented in the DDK as ZwOpenSymbolicLinkObject().
  4446. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4447. function NtOpenSymbolicLinkObject(
  4448. SymbolicLinkHandle : PHANDLE;
  4449. DesiredAccess : ACCESS_MASK;
  4450. ObjectAttributes : POBJECT_ATTRIBUTES
  4451. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4452. function ZwOpenSymbolicLinkObject(SymbolicLinkHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4453. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4454. function NtOpenThread(
  4455. ThreadHandle : PHANDLE;
  4456. DesiredAccess : ACCESS_MASK;
  4457. ObjectAttributes : POBJECT_ATTRIBUTES;
  4458. ClientId : PCLIENT_ID
  4459. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4460. function ZwOpenThread(ThreadHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; ClientId: PCLIENT_ID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4461. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4462. function NtOpenThreadToken(
  4463. ThreadHandle : HANDLE;
  4464. DesiredAccess : ACCESS_MASK;
  4465. OpenAsSelf : BOOLEAN;
  4466. TokenHandle : PHANDLE
  4467. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4468. function ZwOpenThreadToken(ThreadHandle: HANDLE; DesiredAccess: ACCESS_MASK; OpenAsSelf: BOOLEAN; TokenHandle: PHANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4469. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4470. function NtOpenTimer(
  4471. TimerHandle : PHANDLE;
  4472. DesiredAccess : ACCESS_MASK;
  4473. ObjectAttributes : POBJECT_ATTRIBUTES
  4474. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4475. function ZwOpenTimer(TimerHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4476. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4477. function NtPlugPlayControl(
  4478. ControlCode : ULONG;
  4479. Buffer : PVOID;
  4480. BufferLength : ULONG
  4481. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4482. function ZwPlugPlayControl(ControlCode: ULONG; Buffer: PVOID; BufferLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4483. // Compatibility: W2K, WXP, 2K3
  4484. function NtPowerInformation(
  4485. PowerInformationLevel : POWER_INFORMATION_LEVEL;
  4486. InputBuffer : PVOID;
  4487. InputBufferLength : ULONG;
  4488. OutputBuffer : PVOID;
  4489. OutputBufferLength : ULONG
  4490. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4491. function ZwPowerInformation(PowerInformationLevel: POWER_INFORMATION_LEVEL; InputBuffer: PVOID; InputBufferLength: ULONG; OutputBuffer: PVOID; OutputBufferLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4492. // This function is very similar to PrivilegeCheck() from Advapi32.dll.
  4493. // Refer to the PSDK for additional information. Usually the same flags
  4494. // apply.
  4495. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4496. function NtPrivilegeCheck(
  4497. TokenHandle : HANDLE;
  4498. RequiredPrivileges : PPRIVILEGE_SET;
  4499. Result_ : PBOOLEAN
  4500. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4501. function ZwPrivilegeCheck(TokenHandle: HANDLE; RequiredPrivileges: PPRIVILEGE_SET; Result_: PBOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4502. // This function is very similar to PrivilegedServiceAuditAlarm() from
  4503. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  4504. // same flags apply.
  4505. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4506. function NtPrivilegedServiceAuditAlarm(
  4507. SubsystemName : PUNICODE_STRING;
  4508. ServiceName : PUNICODE_STRING;
  4509. TokenHandle : HANDLE;
  4510. Privileges : PPRIVILEGE_SET;
  4511. AccessGranted : BOOLEAN
  4512. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4513. function ZwPrivilegedServiceAuditAlarm(SubsystemName: PUNICODE_STRING; ServiceName: PUNICODE_STRING; TokenHandle: HANDLE; Privileges: PPRIVILEGE_SET; AccessGranted: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4514. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4515. function NtPrivilegeObjectAuditAlarm(
  4516. SubsystemName : PUNICODE_STRING;
  4517. HandleId : PVOID;
  4518. TokenHandle : HANDLE;
  4519. DesiredAccess : ACCESS_MASK;
  4520. Privileges : PPRIVILEGE_SET;
  4521. AccessGranted : BOOLEAN
  4522. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4523. function ZwPrivilegeObjectAuditAlarm(SubsystemName: PUNICODE_STRING; HandleId: PVOID; TokenHandle: HANDLE; DesiredAccess: ACCESS_MASK; Privileges: PPRIVILEGE_SET; AccessGranted: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;
  4524. {$ENDIF}
  4525. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4526. function NtProtectVirtualMemory(
  4527. ProcessHandle : HANDLE;
  4528. BaseAddress : PPVOID;
  4529. ProtectSize : PULONG;
  4530. NewProtect : ULONG;
  4531. OldProtect : PULONG
  4532. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4533. function ZwProtectVirtualMemory(ProcessHandle: HANDLE; BaseAddress: PPVOID; ProtectSize: PULONG; NewProtect: ULONG; OldProtect: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4534. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4535. function NtPulseEvent(
  4536. EventHandle : HANDLE;
  4537. PreviousState : PULONG
  4538. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4539. function ZwPulseEvent(EventHandle: HANDLE; PreviousState: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4540. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4541. function NtQueryAttributesFile(
  4542. ObjectAttributes : POBJECT_ATTRIBUTES;
  4543. FileInformation : PFILE_BASIC_INFORMATION
  4544. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4545. function ZwQueryAttributesFile(ObjectAttributes: POBJECT_ATTRIBUTES; FileInformation: PFILE_BASIC_INFORMATION): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4546. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4547. function NtQueryDefaultLocale(
  4548. ThreadOrSystem : BOOLEAN;
  4549. Locale : PLCID
  4550. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4551. function ZwQueryDefaultLocale(ThreadOrSystem: BOOLEAN; Locale: PLCID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4552. // Compatibility: W2K, WXP, 2K3
  4553. function NtQueryDefaultUILanguage(
  4554. LanguageId : PLANGID
  4555. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4556. function ZwQueryDefaultUILanguage(LanguageId: PLANGID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4557. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4558. function NtQueryDirectoryFile(
  4559. FileHandle : HANDLE;
  4560. Event : HANDLE;
  4561. ApcRoutine : PIO_APC_ROUTINE;
  4562. ApcContext : PVOID;
  4563. IoStatusBlock : PIO_STATUS_BLOCK;
  4564. FileInformation : PVOID;
  4565. FileInformationLength : ULONG;
  4566. FileInformationClass : FILE_INFORMATION_CLASS;
  4567. ReturnSingleEntry : BOOLEAN;
  4568. FileName : PUNICODE_STRING;
  4569. RestartScan : BOOLEAN
  4570. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4571. function ZwQueryDirectoryFile(FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; FileInformation: PVOID; FileInformationLength: ULONG;
  4572. FileInformationClass: FILE_INFORMATION_CLASS; ReturnSingleEntry: BOOLEAN; FileName: PUNICODE_STRING; RestartScan: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4573. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4574. function NtQueryDirectoryObject(
  4575. DirectoryHandle : HANDLE;
  4576. Buffer : PVOID;
  4577. BufferLength : ULONG;
  4578. ReturnSingleEntry : BOOLEAN;
  4579. RestartScan : BOOLEAN;
  4580. Context : PULONG;
  4581. ReturnLength : PULONG
  4582. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4583. function ZwQueryDirectoryObject(DirectoryHandle: HANDLE; Buffer: PVOID; BufferLength: ULONG; ReturnSingleEntry: BOOLEAN; RestartScan: BOOLEAN; Context: PULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;
  4584. {$ENDIF}
  4585. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4586. function NtQueryEaFile(
  4587. FileHandle : HANDLE;
  4588. IoStatusBlock : PIO_STATUS_BLOCK;
  4589. Buffer : PFILE_FULL_EA_INFORMATION;
  4590. BufferLength : ULONG;
  4591. ReturnSingleEntry : BOOLEAN;
  4592. EaList : PFILE_GET_EA_INFORMATION;
  4593. EaListLength : ULONG;
  4594. EaIndex : PULONG;
  4595. RestartScan : BOOLEAN
  4596. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4597. function ZwQueryEaFile(FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_FULL_EA_INFORMATION; BufferLength: ULONG; ReturnSingleEntry: BOOLEAN; EaList: PFILE_GET_EA_INFORMATION; EaListLength: ULONG; EaIndex: PULONG;
  4598. RestartScan: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4599. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4600. function NtQueryEvent(
  4601. EventHandle : HANDLE;
  4602. EventInformationClass : EVENT_INFORMATION_CLASS;
  4603. EventInformation : PVOID;
  4604. EventInformationLength : ULONG;
  4605. ResultLength : PULONG
  4606. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4607. function ZwQueryEvent(EventHandle: HANDLE; EventInformationClass: EVENT_INFORMATION_CLASS; EventInformation: PVOID; EventInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4608. // Compatibility: NT4, W2K, WXP, 2K3
  4609. function NtQueryFullAttributesFile(
  4610. ObjectAttributes : POBJECT_ATTRIBUTES;
  4611. FileInformation : PFILE_NETWORK_OPEN_INFORMATION
  4612. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4613. function ZwQueryFullAttributesFile(ObjectAttributes: POBJECT_ATTRIBUTES; FileInformation: PFILE_NETWORK_OPEN_INFORMATION): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4614. // Compatibility: NT4, W2K, WXP, 2K3
  4615. function NtQueryInformationAtom(
  4616. Atom : USHORT;
  4617. AtomInformationClass : ATOM_INFORMATION_CLASS;
  4618. AtomInformation : PVOID;
  4619. AtomInformationLength : ULONG;
  4620. ReturnLength : PULONG
  4621. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4622. function ZwQueryInformationAtom(Atom: USHORT; AtomInformationClass: ATOM_INFORMATION_CLASS; AtomInformation: PVOID; AtomInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4623. // Documented in the DDK as ZwQueryInformationFile().
  4624. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4625. function NtQueryInformationFile(
  4626. FileHandle : HANDLE;
  4627. IoStatusBlock : PIO_STATUS_BLOCK;
  4628. FileInformation : PVOID;
  4629. FileInformationLength : ULONG;
  4630. FileInformationClass : FILE_INFORMATION_CLASS
  4631. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4632. function ZwQueryInformationFile(FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; FileInformation: PVOID; FileInformationLength: ULONG; FileInformationClass: FILE_INFORMATION_CLASS): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;
  4633. {$ENDIF}
  4634. // Compatibility: W2K, WXP, 2K3
  4635. function NtQueryInformationJobObject(
  4636. JobHandle : HANDLE;
  4637. JobInformationClass : JOBOBJECTINFOCLASS;
  4638. JobInformation : PVOID;
  4639. JobInformationLength : ULONG;
  4640. ReturnLength : PULONG
  4641. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4642. function ZwQueryInformationJobObject(JobHandle: HANDLE; JobInformationClass: JOBOBJECTINFOCLASS; JobInformation: PVOID; JobInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4643. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4644. function NtQueryInformationPort(
  4645. PortHandle : HANDLE;
  4646. PortInformationClass : PORT_INFORMATION_CLASS;
  4647. PortInformation : PVOID;
  4648. PortInformationLength : ULONG;
  4649. ReturnLength : PULONG
  4650. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4651. function ZwQueryInformationPort(PortHandle: HANDLE; PortInformationClass: PORT_INFORMATION_CLASS; PortInformation: PVOID; PortInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4652. {$IFNDEF JWA_INCLUDEMODE}
  4653. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4654. function NtQueryInformationProcess(
  4655. ProcessHandle : HANDLE;
  4656. ProcessInformationClass : PROCESSINFOCLASS;
  4657. ProcessInformation : PVOID;
  4658. ProcessInformationLength : ULONG;
  4659. ReturnLength : PULONG
  4660. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4661. {$ENDIF JWA_INCLUDEMODE}
  4662. function ZwQueryInformationProcess(ProcessHandle: HANDLE; ProcessInformationClass: PROCESSINFOCLASS; ProcessInformation: PVOID; ProcessInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  4663. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4664. {$IFNDEF JWA_INCLUDEMODE}
  4665. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4666. function NtQueryInformationThread(
  4667. ThreadHandle : HANDLE;
  4668. ThreadInformationClass : THREADINFOCLASS;
  4669. ThreadInformation : PVOID;
  4670. ThreadInformationLength : ULONG;
  4671. ReturnLength : PULONG
  4672. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4673. {$ENDIF JWA_INCLUDEMODE}
  4674. function ZwQueryInformationThread(ThreadHandle: HANDLE; ThreadInformationClass: THREADINFOCLASS; ThreadInformation: PVOID; ThreadInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4675. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4676. function NtQueryInformationToken(
  4677. TokenHandle : HANDLE;
  4678. TokenInformationClass : TOKEN_INFORMATION_CLASS;
  4679. TokenInformation : PVOID;
  4680. TokenInformationLength : ULONG;
  4681. ReturnLength : PULONG
  4682. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4683. function ZwQueryInformationToken(TokenHandle: HANDLE; TokenInformationClass: TOKEN_INFORMATION_CLASS; TokenInformation: PVOID; TokenInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4684. // Compatibility: W2K, WXP, 2K3
  4685. function NtQueryInstallUILanguage(
  4686. LanguageId : PLANGID
  4687. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4688. function ZwQueryInstallUILanguage(LanguageId: PLANGID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4689. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4690. function NtQueryIntervalProfile(
  4691. Source : KPROFILE_SOURCE;
  4692. Interval : PULONG
  4693. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4694. function ZwQueryIntervalProfile(Source: KPROFILE_SOURCE; Interval: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4695. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4696. function NtQueryIoCompletion(
  4697. IoCompletionHandle : HANDLE;
  4698. IoCompletionInformationClass : IO_COMPLETION_INFORMATION_CLASS;
  4699. IoCompletionInformation : PVOID;
  4700. IoCompletionInformationLength : ULONG;
  4701. ResultLength : PULONG
  4702. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4703. function ZwQueryIoCompletion(IoCompletionHandle: HANDLE; IoCompletionInformationClass: IO_COMPLETION_INFORMATION_CLASS; IoCompletionInformation: PVOID; IoCompletionInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  4704. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4705. // Documented in the DDK as ZwQueryKey().
  4706. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4707. function NtQueryKey(
  4708. KeyHandle : HANDLE;
  4709. KeyInformationClass : KEY_INFORMATION_CLASS;
  4710. KeyInformation : PVOID;
  4711. KeyInformationLength : ULONG;
  4712. ResultLength : PULONG
  4713. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4714. function ZwQueryKey(KeyHandle: HANDLE; KeyInformationClass: KEY_INFORMATION_CLASS; KeyInformation: PVOID; KeyInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4715. // Compatibility: NT4, W2K, WXP, 2K3
  4716. function NtQueryMultipleValueKey(
  4717. KeyHandle : HANDLE;
  4718. ValueList : PKEY_VALUE_ENTRY;
  4719. NumberOfValues : ULONG;
  4720. Buffer : PVOID;
  4721. Length : PULONG;
  4722. ReturnLength : PULONG
  4723. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4724. function ZwQueryMultipleValueKey(KeyHandle: HANDLE; ValueList: PKEY_VALUE_ENTRY; NumberOfValues: ULONG; Buffer: PVOID; Length: PULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4725. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4726. function NtQueryMutant(
  4727. MutantHandle : HANDLE;
  4728. MutantInformationClass : MUTANT_INFORMATION_CLASS;
  4729. MutantInformation : PVOID;
  4730. MutantInformationLength : ULONG;
  4731. ResultLength : PULONG
  4732. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4733. function ZwQueryMutant(MutantHandle: HANDLE; MutantInformationClass: MUTANT_INFORMATION_CLASS; MutantInformation: PVOID; MutantInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4734. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4735. function NtQueryObject(
  4736. ObjectHandle : HANDLE;
  4737. ObjectInformationClass : OBJECT_INFORMATION_CLASS;
  4738. ObjectInformation : PVOID;
  4739. ObjectInformationLength : ULONG;
  4740. ReturnLength : PULONG
  4741. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4742. function ZwQueryObject(ObjectHandle: HANDLE; ObjectInformationClass: OBJECT_INFORMATION_CLASS; ObjectInformation: PVOID; ObjectInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4743. // Compatibility: W2K, WXP, 2K3
  4744. function NtQueryOpenSubKeys(
  4745. KeyObjectAttributes : POBJECT_ATTRIBUTES;
  4746. NumberOfKey : PULONG
  4747. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4748. function ZwQueryOpenSubKeys(KeyObjectAttributes: POBJECT_ATTRIBUTES; NumberOfKey: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4749. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4750. function NtQueryPerformanceCounter(
  4751. PerformanceCount : PLARGE_INTEGER;
  4752. PerformanceFrequency : PLARGE_INTEGER
  4753. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4754. function ZwQueryPerformanceCounter(PerformanceCount: PLARGE_INTEGER; PerformanceFrequency: PLARGE_INTEGER): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4755. // Compatibility: WXP, 2K3
  4756. function NtQueryPortInformationProcess(): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4757. function ZwQueryPortInformationProcess(): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4758. // Compatibility: W2K, WXP, 2K3
  4759. function NtQueryQuotaInformationFile(
  4760. FileHandle : HANDLE;
  4761. IoStatusBlock : PIO_STATUS_BLOCK;
  4762. Buffer : PFILE_USER_QUOTA_INFORMATION;
  4763. BufferLength : ULONG;
  4764. ReturnSingleEntry : BOOLEAN;
  4765. QuotaList : PFILE_QUOTA_LIST_INFORMATION;
  4766. QuotaListLength : ULONG;
  4767. ResumeSid : PSID;
  4768. RestartScan : BOOLEAN
  4769. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4770. function ZwQueryQuotaInformationFile(FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_USER_QUOTA_INFORMATION; BufferLength: ULONG; ReturnSingleEntry: BOOLEAN; QuotaList: PFILE_QUOTA_LIST_INFORMATION;
  4771. QuotaListLength: ULONG; ResumeSid: PSID; RestartScan: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4772. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4773. function NtQuerySection(
  4774. SectionHandle : HANDLE;
  4775. SectionInformationClass : SECTION_INFORMATION_CLASS;
  4776. SectionInformation : PVOID;
  4777. SectionInformationLength : ULONG;
  4778. ResultLength : PULONG
  4779. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4780. function ZwQuerySection(SectionHandle: HANDLE; SectionInformationClass: SECTION_INFORMATION_CLASS; SectionInformation: PVOID; SectionInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4781. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4782. function NtQuerySecurityObject(
  4783. Handle : HANDLE;
  4784. RequestedInformation : SECURITY_INFORMATION;
  4785. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  4786. SecurityDescriptorLength : ULONG;
  4787. ReturnLength : PULONG
  4788. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4789. function ZwQuerySecurityObject(Handle: HANDLE; RequestedInformation: SECURITY_INFORMATION; SecurityDescriptor: PSECURITY_DESCRIPTOR; SecurityDescriptorLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;
  4790. {$ENDIF}
  4791. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4792. function NtQuerySemaphore(
  4793. SemaphoreHandle : HANDLE;
  4794. SemaphoreInformationClass : SEMAPHORE_INFORMATION_CLASS;
  4795. SemaphoreInformation : PVOID;
  4796. SemaphoreInformationLength : ULONG;
  4797. ResultLength : PULONG
  4798. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4799. function ZwQuerySemaphore(SemaphoreHandle: HANDLE; SemaphoreInformationClass: SEMAPHORE_INFORMATION_CLASS; SemaphoreInformation: PVOID; SemaphoreInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  4800. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4801. // Documented in the DDK as ZwQuerySymbolicLinkObject().
  4802. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4803. function NtQuerySymbolicLinkObject(
  4804. SymbolicLinkHandle : HANDLE;
  4805. TargetName : PUNICODE_STRING;
  4806. ReturnLength : PULONG
  4807. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4808. function ZwQuerySymbolicLinkObject(SymbolicLinkHandle: HANDLE; TargetName: PUNICODE_STRING; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4809. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4810. function NtQuerySystemEnvironmentValue(
  4811. Name : PUNICODE_STRING;
  4812. Value : PVOID;
  4813. ValueLength : ULONG;
  4814. ReturnLength : PULONG
  4815. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4816. function ZwQuerySystemEnvironmentValue(Name: PUNICODE_STRING; Value: PVOID; ValueLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4817. {$IFNDEF JWA_INCLUDEMODE}
  4818. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4819. function NtQuerySystemInformation(
  4820. SystemInformationClass : SYSTEM_INFORMATION_CLASS;
  4821. SystemInformation : PVOID;
  4822. SystemInformationLength : ULONG;
  4823. ReturnLength : PULONG
  4824. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4825. {$ENDIF JWA_INCLUDEMODE}
  4826. function ZwQuerySystemInformation(SystemInformationClass: SYSTEM_INFORMATION_CLASS; SystemInformation: PVOID; SystemInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4827. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4828. {$IFNDEF JWA_INCLUDEMODE}
  4829. function NtQuerySystemTime(
  4830. CurrentTime : PLARGE_INTEGER
  4831. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4832. {$ENDIF JWA_INCLUDEMODE}
  4833. function ZwQuerySystemTime(CurrentTime: PLARGE_INTEGER): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4834. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4835. function NtQueryTimer(
  4836. TimerHandle : HANDLE;
  4837. TimerInformationClass : TIMER_INFORMATION_CLASS;
  4838. TimerInformation : PVOID;
  4839. TimerInformationLength : ULONG;
  4840. ResultLength : PULONG
  4841. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4842. function ZwQueryTimer(TimerHandle: HANDLE; TimerInformationClass: TIMER_INFORMATION_CLASS; TimerInformation: PVOID; TimerInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4843. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4844. function NtQueryTimerResolution(
  4845. CoarsestResolution : PULONG;
  4846. FinestResolution : PULONG;
  4847. ActualResolution : PULONG
  4848. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4849. function ZwQueryTimerResolution(CoarsestResolution: PULONG; FinestResolution: PULONG; ActualResolution: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4850. // Documented in the DDK as ZwQueryValueKey().
  4851. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4852. function NtQueryValueKey(
  4853. KeyHandle : HANDLE;
  4854. ValueName : PUNICODE_STRING;
  4855. KeyValueInformationClass : KEY_VALUE_INFORMATION_CLASS;
  4856. KeyValueInformation : PVOID;
  4857. KeyValueInformationLength : ULONG;
  4858. ResultLength : PULONG
  4859. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4860. function ZwQueryValueKey(KeyHandle: HANDLE; ValueName: PUNICODE_STRING; KeyValueInformationClass: KEY_VALUE_INFORMATION_CLASS; KeyValueInformation: PVOID; KeyValueInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  4861. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4862. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4863. function NtQueryVirtualMemory(
  4864. ProcessHandle : HANDLE;
  4865. BaseAddress : PVOID;
  4866. MemoryInformationClass : MEMORY_INFORMATION_CLASS;
  4867. MemoryInformation : PVOID;
  4868. MemoryInformationLength : ULONG;
  4869. ReturnLength : PULONG
  4870. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4871. function ZwQueryVirtualMemory(ProcessHandle: HANDLE; BaseAddress: PVOID; MemoryInformationClass: MEMORY_INFORMATION_CLASS; MemoryInformation: PVOID; MemoryInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  4872. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4873. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4874. function NtQueryVolumeInformationFile(
  4875. FileHandle : HANDLE;
  4876. IoStatusBlock : PIO_STATUS_BLOCK;
  4877. VolumeInformation : PVOID;
  4878. VolumeInformationLength : ULONG;
  4879. VolumeInformationClass : FS_INFORMATION_CLASS
  4880. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4881. function ZwQueryVolumeInformationFile(FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; VolumeInformation: PVOID; VolumeInformationLength: ULONG; VolumeInformationClass: FS_INFORMATION_CLASS): NTSTATUS; stdcall;
  4882. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4883. // Compatibility: NT4, W2K, WXP, 2K3
  4884. function NtQueueApcThread(
  4885. ThreadHandle : HANDLE;
  4886. ApcRoutine : PKNORMAL_ROUTINE;
  4887. ApcContext : PVOID;
  4888. Argument1 : PVOID;
  4889. Argument2 : PVOID
  4890. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4891. function ZwQueueApcThread(ThreadHandle: HANDLE; ApcRoutine: PKNORMAL_ROUTINE; ApcContext: PVOID; Argument1: PVOID; Argument2: PVOID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4892. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4893. function NtRaiseException(
  4894. ExceptionRecord : PEXCEPTION_RECORD;
  4895. Context : PCONTEXT;
  4896. SearchFrames : BOOLEAN
  4897. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4898. function ZwRaiseException(ExceptionRecord: PEXCEPTION_RECORD; Context: PCONTEXT; SearchFrames: BOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4899. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4900. function NtRaiseHardError(
  4901. Status : NTSTATUS;
  4902. NumberOfArguments : ULONG;
  4903. StringArgumentsMask : ULONG;
  4904. Arguments : PULONG;
  4905. MessageBoxType : ULONG;
  4906. MessageBoxResult : PULONG
  4907. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4908. function ZwRaiseHardError(Status: NTSTATUS; NumberOfArguments: ULONG; StringArgumentsMask: ULONG; Arguments: PULONG; MessageBoxType: ULONG; MessageBoxResult: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4909. // Documented in the DDK as ZwReadFile().
  4910. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4911. function NtReadFile(
  4912. FileHandle : HANDLE;
  4913. Event : HANDLE;
  4914. ApcRoutine : PIO_APC_ROUTINE;
  4915. ApcContext : PVOID;
  4916. IoStatusBlock : PIO_STATUS_BLOCK;
  4917. Buffer : PVOID;
  4918. Length : ULONG;
  4919. ByteOffset : PLARGE_INTEGER;
  4920. Key : PULONG
  4921. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4922. function ZwReadFile(FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PVOID; Length: ULONG; ByteOffset: PLARGE_INTEGER; Key: PULONG): NTSTATUS; stdcall;
  4923. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4924. // Compatibility: NT4, W2K, WXP, 2K3
  4925. function NtReadFileScatter(
  4926. FileHandle : HANDLE;
  4927. Event : HANDLE;
  4928. ApcRoutine : PIO_APC_ROUTINE;
  4929. ApcContext : PVOID;
  4930. IoStatusBlock : PIO_STATUS_BLOCK;
  4931. Buffer : PFILE_SEGMENT_ELEMENT;
  4932. Length : ULONG;
  4933. ByteOffset : PLARGE_INTEGER;
  4934. Key : PULONG
  4935. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4936. function ZwReadFileScatter(FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_SEGMENT_ELEMENT; Length: ULONG; ByteOffset: PLARGE_INTEGER;
  4937. Key: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4938. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4939. function NtReadRequestData(
  4940. PortHandle : HANDLE;
  4941. Message : PPORT_MESSAGE;
  4942. Index : ULONG;
  4943. Buffer : PVOID;
  4944. BufferLength : ULONG;
  4945. ReturnLength : PULONG
  4946. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4947. function ZwReadRequestData(PortHandle: HANDLE; Message: PPORT_MESSAGE; Index: ULONG; Buffer: PVOID; BufferLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4948. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4949. function NtReadVirtualMemory(
  4950. ProcessHandle : HANDLE;
  4951. BaseAddress : PVOID;
  4952. Buffer : PVOID;
  4953. BufferLength : ULONG;
  4954. ReturnLength : PULONG
  4955. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4956. function ZwReadVirtualMemory(ProcessHandle: HANDLE; BaseAddress: PVOID; Buffer: PVOID; BufferLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4957. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4958. function NtRegisterThreadTerminatePort(
  4959. PortHandle : HANDLE
  4960. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4961. function ZwRegisterThreadTerminatePort(PortHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4962. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4963. function NtReleaseMutant(
  4964. MutantHandle : HANDLE;
  4965. PreviousState : PULONG
  4966. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4967. function ZwReleaseMutant(MutantHandle: HANDLE; PreviousState: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4968. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4969. function NtReleaseSemaphore(
  4970. SemaphoreHandle : HANDLE;
  4971. ReleaseCount : LONG;
  4972. PreviousCount : PLONG
  4973. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4974. function ZwReleaseSemaphore(SemaphoreHandle: HANDLE; ReleaseCount: LONG; PreviousCount: PLONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4975. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4976. function NtRemoveIoCompletion(
  4977. IoCompletionHandle : HANDLE;
  4978. CompletionKey : PULONG;
  4979. CompletionValue : PULONG;
  4980. IoStatusBlock : PIO_STATUS_BLOCK;
  4981. Timeout : PLARGE_INTEGER
  4982. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4983. function ZwRemoveIoCompletion(IoCompletionHandle: HANDLE; CompletionKey: PULONG; CompletionValue: PULONG; IoStatusBlock: PIO_STATUS_BLOCK; Timeout: PLARGE_INTEGER): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4984. // Compatibility: WXP, 2K3
  4985. function NtRemoveProcessDebug(
  4986. hProcess : HANDLE;
  4987. hDebugObject : HANDLE
  4988. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4989. function ZwRemoveProcessDebug(hProcess: HANDLE; hDebugObject: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4990. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4991. function NtReplaceKey(
  4992. NewFileObjectAttributes : POBJECT_ATTRIBUTES;
  4993. KeyHandle : HANDLE;
  4994. OldFileObjectAttributes : POBJECT_ATTRIBUTES
  4995. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4996. function ZwReplaceKey(NewFileObjectAttributes: POBJECT_ATTRIBUTES; KeyHandle: HANDLE; OldFileObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  4997. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  4998. function NtReplyPort(
  4999. PortHandle : HANDLE;
  5000. ReplyMessage : PPORT_MESSAGE
  5001. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5002. function ZwReplyPort(PortHandle: HANDLE; ReplyMessage: PPORT_MESSAGE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5003. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5004. function NtReplyWaitReceivePort(
  5005. PortHandle : HANDLE;
  5006. PortIdentifier : PULONG;
  5007. ReplyMessage : PPORT_MESSAGE;
  5008. Message : PPORT_MESSAGE
  5009. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5010. function ZwReplyWaitReceivePort(PortHandle: HANDLE; PortIdentifier: PULONG; ReplyMessage: PPORT_MESSAGE; Message: PPORT_MESSAGE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5011. // Compatibility: W2K, WXP, 2K3
  5012. function NtReplyWaitReceivePortEx(
  5013. PortHandle : HANDLE;
  5014. PortIdentifier : PULONG;
  5015. ReplyMessage : PPORT_MESSAGE;
  5016. Message : PPORT_MESSAGE;
  5017. Timeout : PLARGE_INTEGER
  5018. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5019. function ZwReplyWaitReceivePortEx(PortHandle: HANDLE; PortIdentifier: PULONG; ReplyMessage: PPORT_MESSAGE; Message: PPORT_MESSAGE; Timeout: PLARGE_INTEGER): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5020. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5021. function NtReplyWaitReplyPort(
  5022. PortHandle : HANDLE;
  5023. ReplyMessage : PPORT_MESSAGE
  5024. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5025. function ZwReplyWaitReplyPort(PortHandle: HANDLE; ReplyMessage: PPORT_MESSAGE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5026. // Returns STATUS_NOT_IMPLEMENTED. Only MS knows the intention behind this.
  5027. //
  5028. // !!!DO NOT USE!!!
  5029. // Compatibility: NT4, W2K
  5030. function NtReplyWaitSendChannel(
  5031. x : PVOID;
  5032. y : PVOID;
  5033. z : PVOID
  5034. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5035. function ZwReplyWaitSendChannel(x: PVOID; y: PVOID; z: PVOID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5036. // Compatibility: W2K, WXP, 2K3
  5037. function NtRequestDeviceWakeup(
  5038. DeviceHandle : HANDLE
  5039. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5040. function ZwRequestDeviceWakeup(DeviceHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5041. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5042. function NtRequestPort(
  5043. PortHandle : HANDLE;
  5044. RequestMessage : PPORT_MESSAGE
  5045. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5046. function ZwRequestPort(PortHandle: HANDLE; RequestMessage: PPORT_MESSAGE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5047. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5048. function NtRequestWaitReplyPort(
  5049. PortHandle : HANDLE;
  5050. RequestMessage : PPORT_MESSAGE;
  5051. ReplyMessage : PPORT_MESSAGE
  5052. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5053. function ZwRequestWaitReplyPort(PortHandle: HANDLE; RequestMessage: PPORT_MESSAGE; ReplyMessage: PPORT_MESSAGE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5054. // Compatibility: W2K, WXP, 2K3
  5055. function NtRequestWakeupLatency(
  5056. Latency : LATENCY_TIME
  5057. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5058. function ZwRequestWakeupLatency(Latency: LATENCY_TIME): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5059. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5060. function NtResetEvent(
  5061. EventHandle : HANDLE;
  5062. PreviousState : PULONG
  5063. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5064. function ZwResetEvent(EventHandle: HANDLE; PreviousState: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5065. // Compatibility: W2K, WXP, 2K3
  5066. function NtResetWriteWatch(
  5067. ProcessHandle : HANDLE;
  5068. BaseAddress : PVOID;
  5069. RegionSize : ULONG
  5070. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5071. function ZwResetWriteWatch(ProcessHandle: HANDLE; BaseAddress: PVOID; RegionSize: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5072. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5073. function NtRestoreKey(
  5074. KeyHandle : HANDLE;
  5075. FileHandle : HANDLE;
  5076. Flags : ULONG
  5077. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5078. function ZwRestoreKey(KeyHandle: HANDLE; FileHandle: HANDLE; Flags: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5079. // Compatibility: WXP, 2K3
  5080. function NtResumeProcess(
  5081. hProcess : HANDLE
  5082. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5083. function ZwResumeProcess(hProcess: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5084. // This function is very similar to ResumeThread() from Kernel32.dll. Refer
  5085. // to the PSDK for additional information. Usually the same flags apply.
  5086. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5087. function NtResumeThread(
  5088. hThread : HANDLE;
  5089. dwResumeCount : PULONG
  5090. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5091. function ZwResumeThread(hThread: HANDLE; dwResumeCount: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5092. // Relates to RegSaveKey().
  5093. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5094. function NtSaveKey(
  5095. KeyHandle : HANDLE;
  5096. FileHandle : HANDLE
  5097. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5098. function ZwSaveKey(KeyHandle: HANDLE; FileHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5099. // Relates to RegSaveKeyEx().
  5100. // Compatibility: WXP, 2K3
  5101. function NtSaveKeyEx(
  5102. KeyHandle : HANDLE;
  5103. FileHandle : HANDLE;
  5104. Flags : DWORD
  5105. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5106. function ZwSaveKeyEx(KeyHandle: HANDLE; FileHandle: HANDLE; Flags: DWORD): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5107. // Compatibility: W2K, WXP, 2K3
  5108. function NtSaveMergedKeys(
  5109. KeyHandle1 : HANDLE;
  5110. KeyHandle2 : HANDLE;
  5111. FileHandle : HANDLE
  5112. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5113. function ZwSaveMergedKeys(KeyHandle1: HANDLE; KeyHandle2: HANDLE; FileHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5114. // Compatibility: W2K, WXP, 2K3
  5115. function NtSecureConnectPort(
  5116. PortHandle : PHANDLE;
  5117. PortName : PUNICODE_STRING;
  5118. SecurityQos : PSECURITY_QUALITY_OF_SERVICE;
  5119. WriteSection : PPORT_SECTION_WRITE;
  5120. ServerSid : PSID;
  5121. ReadSection : PPORT_SECTION_READ;
  5122. MaxMessageSize : PULONG;
  5123. ConnectData : PVOID;
  5124. ConnectDataLength : PULONG
  5125. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5126. function ZwSecureConnectPort(PortHandle: PHANDLE; PortName: PUNICODE_STRING; SecurityQos: PSECURITY_QUALITY_OF_SERVICE; WriteSection: PPORT_SECTION_WRITE; ServerSid: PSID; ReadSection: PPORT_SECTION_READ; MaxMessageSize: PULONG;
  5127. ConnectData: PVOID; ConnectDataLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5128. // Returns STATUS_NOT_IMPLEMENTED. Only MS knows the intention behind this.
  5129. //
  5130. // !!!DO NOT USE!!!
  5131. // Compatibility: NT4, W2K
  5132. function NtSendWaitReplyChannel(
  5133. x : PVOID;
  5134. y : PVOID;
  5135. z : PVOID;
  5136. z2 : PVOID
  5137. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5138. function ZwSendWaitReplyChannel(x: PVOID; y: PVOID; z: PVOID; z2: PVOID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5139. // Returns STATUS_NOT_IMPLEMENTED. Only MS knows the intention behind this.
  5140. //
  5141. // !!!DO NOT USE!!!
  5142. // Compatibility: NT4, W2K
  5143. function NtSetContextChannel(
  5144. x : PVOID
  5145. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5146. function ZwSetContextChannel(x: PVOID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5147. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5148. function NtSetContextThread(
  5149. ThreadHandle : HANDLE;
  5150. Context : PCONTEXT
  5151. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5152. function ZwSetContextThread(ThreadHandle: HANDLE; Context: PCONTEXT): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5153. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5154. function NtSetDefaultHardErrorPort(
  5155. PortHandle : HANDLE
  5156. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5157. function ZwSetDefaultHardErrorPort(PortHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5158. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5159. function NtSetDefaultLocale(
  5160. ThreadOrSystem : BOOLEAN;
  5161. Locale : LCID
  5162. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5163. function ZwSetDefaultLocale(ThreadOrSystem: BOOLEAN; Locale: LCID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5164. // Compatibility: W2K, WXP, 2K3
  5165. function NtSetDefaultUILanguage(
  5166. LanguageId : LANGID
  5167. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5168. function ZwSetDefaultUILanguage(LanguageId: LANGID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5169. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5170. function NtSetEaFile(
  5171. FileHandle : HANDLE;
  5172. IoStatusBlock : PIO_STATUS_BLOCK;
  5173. Buffer : PFILE_FULL_EA_INFORMATION;
  5174. BufferLength : ULONG
  5175. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5176. function ZwSetEaFile(FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_FULL_EA_INFORMATION; BufferLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5177. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5178. function NtSetEvent(
  5179. EventHandle : HANDLE;
  5180. PreviousState : PULONG
  5181. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5182. function ZwSetEvent(EventHandle: HANDLE; PreviousState: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5183. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5184. function NtSetHighEventPair(
  5185. EventPairHandle : HANDLE
  5186. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5187. function ZwSetHighEventPair(EventPairHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5188. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5189. function NtSetHighWaitLowEventPair(
  5190. EventPairHandle : HANDLE
  5191. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5192. function ZwSetHighWaitLowEventPair(EventPairHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5193. // Compatibility: NT3, NT4
  5194. function NtSetHighWaitLowThread(): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5195. function ZwSetHighWaitLowThread(): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5196. // Documented in the DDK as ZwSetInformationFile().
  5197. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5198. function NtSetInformationFile(
  5199. FileHandle : HANDLE;
  5200. IoStatusBlock : PIO_STATUS_BLOCK;
  5201. FileInformation : PVOID;
  5202. FileInformationLength : ULONG;
  5203. FileInformationClass : FILE_INFORMATION_CLASS
  5204. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5205. function ZwSetInformationFile(FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; FileInformation: PVOID; FileInformationLength: ULONG; FileInformationClass: FILE_INFORMATION_CLASS): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;
  5206. {$ENDIF}
  5207. // Compatibility: W2K, WXP, 2K3
  5208. function NtSetInformationJobObject(
  5209. JobHandle : HANDLE;
  5210. JobInformationClass : JOBOBJECTINFOCLASS;
  5211. JobInformation : PVOID;
  5212. JobInformationLength : ULONG
  5213. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5214. function ZwSetInformationJobObject(JobHandle: HANDLE; JobInformationClass: JOBOBJECTINFOCLASS; JobInformation: PVOID; JobInformationLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5215. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5216. function NtSetInformationKey(
  5217. KeyHandle : HANDLE;
  5218. KeyInformationClass : KEY_SET_INFORMATION_CLASS;
  5219. KeyInformation : PVOID;
  5220. KeyInformationLength : ULONG
  5221. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5222. function ZwSetInformationKey(KeyHandle: HANDLE; KeyInformationClass: KEY_SET_INFORMATION_CLASS; KeyInformation: PVOID; KeyInformationLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5223. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5224. function NtSetInformationObject(
  5225. ObjectHandle : HANDLE;
  5226. ObjectInformationClass : OBJECT_INFORMATION_CLASS;
  5227. ObjectInformation : PVOID;
  5228. ObjectInformationLength : ULONG
  5229. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5230. function ZwSetInformationObject(ObjectHandle: HANDLE; ObjectInformationClass: OBJECT_INFORMATION_CLASS; ObjectInformation: PVOID; ObjectInformationLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5231. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5232. function NtSetInformationProcess(
  5233. ProcessHandle : HANDLE;
  5234. ProcessInformationClass : PROCESSINFOCLASS;
  5235. ProcessInformation : PVOID;
  5236. ProcessInformationLength : ULONG
  5237. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5238. function ZwSetInformationProcess(ProcessHandle: HANDLE; ProcessInformationClass: PROCESSINFOCLASS; ProcessInformation: PVOID; ProcessInformationLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5239. // Documented in the DDK as ZwSetInformationThread().
  5240. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5241. function NtSetInformationThread(
  5242. ThreadHandle : HANDLE;
  5243. ThreadInformationClass : THREADINFOCLASS;
  5244. ThreadInformation : PVOID;
  5245. ThreadInformationLength : ULONG
  5246. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5247. function ZwSetInformationThread(ThreadHandle: HANDLE; ThreadInformationClass: THREADINFOCLASS; ThreadInformation: PVOID; ThreadInformationLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5248. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5249. function NtSetInformationToken(
  5250. TokenHandle : HANDLE;
  5251. TokenInformationClass : TOKEN_INFORMATION_CLASS;
  5252. TokenInformation : PVOID;
  5253. TokenInformationLength : ULONG
  5254. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5255. function ZwSetInformationToken(TokenHandle: HANDLE; TokenInformationClass: TOKEN_INFORMATION_CLASS; TokenInformation: PVOID; TokenInformationLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5256. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5257. function NtSetIntervalProfile(
  5258. Interval : ULONG;
  5259. Source : KPROFILE_SOURCE
  5260. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5261. function ZwSetIntervalProfile(Interval: ULONG; Source: KPROFILE_SOURCE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5262. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5263. function NtSetIoCompletion(
  5264. IoCompletionHandle : HANDLE;
  5265. CompletionKey : ULONG;
  5266. CompletionValue : ULONG;
  5267. Status : NTSTATUS;
  5268. Information : ULONG
  5269. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5270. function ZwSetIoCompletion(IoCompletionHandle: HANDLE; CompletionKey: ULONG; CompletionValue: ULONG; Status: NTSTATUS; Information: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5271. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5272. function NtSetLdtEntries(
  5273. Selector1 : ULONG;
  5274. LdtEntry1 : LDT_ENTRY;
  5275. Selector2 : ULONG;
  5276. LdtEntry2 : LDT_ENTRY
  5277. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5278. function ZwSetLdtEntries(Selector1: ULONG; LdtEntry1: LDT_ENTRY; Selector2: ULONG; LdtEntry2: LDT_ENTRY): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5279. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5280. function NtSetLowEventPair(
  5281. EventPairHandle : HANDLE
  5282. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5283. function ZwSetLowEventPair(EventPairHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5284. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5285. function NtSetLowWaitHighEventPair(
  5286. EventPairHandle : HANDLE
  5287. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5288. function ZwSetLowWaitHighEventPair(EventPairHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5289. // Compatibility: NT3, NT4
  5290. function NtSetLowWaitHighThread(): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5291. function ZwSetLowWaitHighThread(): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5292. // Compatibility: W2K, WXP, 2K3
  5293. function NtSetQuotaInformationFile(
  5294. FileHandle : HANDLE;
  5295. IoStatusBlock : PIO_STATUS_BLOCK;
  5296. Buffer : PFILE_USER_QUOTA_INFORMATION;
  5297. BufferLength : ULONG
  5298. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5299. function ZwSetQuotaInformationFile(FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_USER_QUOTA_INFORMATION; BufferLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5300. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5301. function NtSetSecurityObject(
  5302. Handle : HANDLE;
  5303. SecurityInformation : SECURITY_INFORMATION;
  5304. SecurityDescriptor : PSECURITY_DESCRIPTOR
  5305. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5306. function ZwSetSecurityObject(Handle: HANDLE; SecurityInformation: SECURITY_INFORMATION; SecurityDescriptor: PSECURITY_DESCRIPTOR): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5307. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5308. function NtSetSystemEnvironmentValue(
  5309. Name : PUNICODE_STRING;
  5310. Value : PUNICODE_STRING
  5311. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5312. function ZwSetSystemEnvironmentValue(Name: PUNICODE_STRING; Value: PUNICODE_STRING): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5313. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5314. function NtSetSystemInformation(
  5315. SystemInformationClass : SYSTEM_INFORMATION_CLASS;
  5316. SystemInformation : PVOID;
  5317. SystemInformationLength : ULONG
  5318. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5319. function ZwSetSystemInformation(SystemInformationClass: SYSTEM_INFORMATION_CLASS; SystemInformation: PVOID; SystemInformationLength: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5320. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5321. function NtSetSystemPowerState(
  5322. SystemAction : POWER_ACTION;
  5323. MinSystemState : SYSTEM_POWER_STATE;
  5324. Flags : ULONG
  5325. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5326. function ZwSetSystemPowerState(SystemAction: POWER_ACTION; MinSystemState: SYSTEM_POWER_STATE; Flags: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5327. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5328. function NtSetSystemTime(
  5329. NewTime : PLARGE_INTEGER;
  5330. OldTime : PLARGE_INTEGER
  5331. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5332. function ZwSetSystemTime(NewTime: PLARGE_INTEGER; OldTime: PLARGE_INTEGER): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5333. // Compatibility: W2K, WXP, 2K3
  5334. function NtSetThreadExecutionState(
  5335. ExecutionState : EXECUTION_STATE;
  5336. PreviousExecutionState : PEXECUTION_STATE
  5337. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5338. function ZwSetThreadExecutionState(ExecutionState: EXECUTION_STATE; PreviousExecutionState: PEXECUTION_STATE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5339. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5340. function NtSetTimer(
  5341. TimerHandle : HANDLE;
  5342. DueTime : PLARGE_INTEGER;
  5343. TimerApcRoutine : PTIMER_APC_ROUTINE;
  5344. TimerContext : PVOID;
  5345. Resume : BOOLEAN;
  5346. Period : LONG;
  5347. PreviousState : PBOOLEAN
  5348. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5349. function ZwSetTimer(TimerHandle: HANDLE; DueTime: PLARGE_INTEGER; TimerApcRoutine: PTIMER_APC_ROUTINE; TimerContext: PVOID; Resume: BOOLEAN; Period: LONG; PreviousState: PBOOLEAN): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5350. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5351. function NtSetTimerResolution(
  5352. RequestedResolution : ULONG;
  5353. Set_ : BOOLEAN;
  5354. ActualResolution : PULONG
  5355. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5356. function ZwSetTimerResolution(RequestedResolution: ULONG; Set_: BOOLEAN; ActualResolution: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5357. // Compatibility: W2K, WXP, 2K3
  5358. function NtSetUuidSeed(
  5359. UuidSeed : PUCHAR
  5360. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5361. function ZwSetUuidSeed(UuidSeed: PUCHAR): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5362. // Documented in the DDK as ZwSetValueKey().
  5363. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5364. function NtSetValueKey(
  5365. KeyHandle : HANDLE;
  5366. ValueName : PUNICODE_STRING;
  5367. TitleIndex : ULONG;
  5368. Type_ : ULONG;
  5369. Data : PVOID;
  5370. DataSize : ULONG
  5371. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5372. function ZwSetValueKey(KeyHandle: HANDLE; ValueName: PUNICODE_STRING; TitleIndex: ULONG; Type_: ULONG; Data: PVOID; DataSize: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5373. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5374. function NtSetVolumeInformationFile(
  5375. FileHandle : HANDLE;
  5376. IoStatusBlock : PIO_STATUS_BLOCK;
  5377. Buffer : PVOID;
  5378. BufferLength : ULONG;
  5379. VolumeInformationClass : FS_INFORMATION_CLASS
  5380. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5381. function ZwSetVolumeInformationFile(FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PVOID; BufferLength: ULONG; VolumeInformationClass: FS_INFORMATION_CLASS): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5382. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5383. function NtShutdownSystem(
  5384. Action : SHUTDOWN_ACTION
  5385. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5386. function ZwShutdownSystem(Action: SHUTDOWN_ACTION): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5387. // Compatibility: NT4, W2K, WXP, 2K3
  5388. function NtSignalAndWaitForSingleObject(
  5389. HandleToSignal : HANDLE;
  5390. HandleToWait : HANDLE;
  5391. Alertable : BOOLEAN;
  5392. Timeout : PLARGE_INTEGER
  5393. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5394. function ZwSignalAndWaitForSingleObject(HandleToSignal: HANDLE; HandleToWait: HANDLE; Alertable: BOOLEAN; Timeout: PLARGE_INTEGER): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5395. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5396. function NtStartProfile(
  5397. ProfileHandle : HANDLE
  5398. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5399. function ZwStartProfile(ProfileHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5400. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5401. function NtStopProfile(
  5402. ProfileHandle : HANDLE
  5403. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5404. function ZwStopProfile(ProfileHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5405. // Compatibility: WXP, 2K3
  5406. function NtSuspendProcess(
  5407. hProcess : HANDLE
  5408. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5409. function ZwSuspendProcess(hProcess: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5410. // This function is very similar to SuspendThread() from Kernel32.dll.
  5411. // Refer to the PSDK for additional information. Usually the same flags
  5412. // apply.
  5413. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5414. function NtSuspendThread(
  5415. hThread : HANDLE;
  5416. dwLastResumeCount : PULONG
  5417. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5418. function ZwSuspendThread(hThread: HANDLE; dwLastResumeCount: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5419. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5420. function NtSystemDebugControl(
  5421. ControlCode : DEBUG_CONTROL_CODE;
  5422. InputBuffer : PVOID;
  5423. InputBufferLength : ULONG;
  5424. OutputBuffer : PVOID;
  5425. OutputBufferLength : ULONG;
  5426. ReturnLength : PULONG
  5427. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5428. function ZwSystemDebugControl(ControlCode: DEBUG_CONTROL_CODE; InputBuffer: PVOID; InputBufferLength: ULONG; OutputBuffer: PVOID; OutputBufferLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5429. // Compatibility: W2K, WXP, 2K3
  5430. function NtTerminateJobObject(
  5431. JobHandle : HANDLE;
  5432. ExitStatus : NTSTATUS
  5433. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5434. function ZwTerminateJobObject(JobHandle: HANDLE; ExitStatus: NTSTATUS): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5435. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5436. function NtTerminateProcess(
  5437. ProcessHandle : HANDLE;
  5438. ExitStatus : NTSTATUS
  5439. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5440. function ZwTerminateProcess(ProcessHandle: HANDLE; ExitStatus: NTSTATUS): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5441. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5442. function NtTerminateThread(
  5443. ThreadHandle : HANDLE;
  5444. ExitStatus : NTSTATUS
  5445. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5446. function ZwTerminateThread(ThreadHandle: HANDLE; ExitStatus: NTSTATUS): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5447. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5448. function NtTestAlert(): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5449. function ZwTestAlert(): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5450. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5451. function NtUnloadDriver(
  5452. DriverServiceName : PUNICODE_STRING
  5453. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5454. function ZwUnloadDriver(DriverServiceName: PUNICODE_STRING): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5455. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5456. function NtUnloadKey(
  5457. KeyObjectAttributes : POBJECT_ATTRIBUTES
  5458. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5459. function ZwUnloadKey(KeyObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5460. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5461. function NtUnlockFile(
  5462. FileHandle : HANDLE;
  5463. IoStatusBlock : PIO_STATUS_BLOCK;
  5464. LockOffset : PULARGE_INTEGER;
  5465. LockLength : PULARGE_INTEGER;
  5466. Key : ULONG
  5467. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5468. function ZwUnlockFile(FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; LockOffset: PULARGE_INTEGER; LockLength: PULARGE_INTEGER; Key: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5469. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5470. function NtUnlockVirtualMemory(
  5471. ProcessHandle : HANDLE;
  5472. BaseAddress : PPVOID;
  5473. LockSize : PULONG;
  5474. LockType : ULONG
  5475. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5476. function ZwUnlockVirtualMemory(ProcessHandle: HANDLE; BaseAddress: PPVOID; LockSize: PULONG; LockType: ULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5477. // Documented in the DDK as ZwUnmapViewOfSection().
  5478. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5479. function NtUnmapViewOfSection(
  5480. ProcessHandle : HANDLE;
  5481. BaseAddress : PVOID
  5482. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5483. function ZwUnmapViewOfSection(ProcessHandle: HANDLE; BaseAddress: PVOID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5484. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5485. function NtVdmControl(
  5486. ControlCode : ULONG;
  5487. ControlData : PVOID
  5488. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5489. function ZwVdmControl(ControlCode: ULONG; ControlData: PVOID): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5490. // Compatibility: NT3
  5491. function NtW32Call(
  5492. RoutineIndex : ULONG;
  5493. Argument : PVOID;
  5494. ArgumentLength : ULONG;
  5495. Result_ : PPVOID;
  5496. ResultLength : PULONG
  5497. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5498. function ZwW32Call(RoutineIndex: ULONG; Argument: PVOID; ArgumentLength: ULONG; Result_: PPVOID; ResultLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5499. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5500. function NtWaitForMultipleObjects(
  5501. HandleCount : ULONG;
  5502. Handles : PHANDLE;
  5503. WaitType : WAIT_TYPE;
  5504. Alertable : BOOLEAN;
  5505. Timeout : PLARGE_INTEGER
  5506. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5507. function ZwWaitForMultipleObjects(HandleCount: ULONG; Handles: PHANDLE; WaitType: WAIT_TYPE; Alertable: BOOLEAN; Timeout: PLARGE_INTEGER): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5508. {$IFNDEF JWA_INCLUDEMODE}
  5509. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5510. function NtWaitForSingleObject(
  5511. Handle : HANDLE;
  5512. Alertable : BOOLEAN;
  5513. Timeout : PLARGE_INTEGER
  5514. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5515. {$ENDIF JWA_INCLUDEMODE}
  5516. function ZwWaitForSingleObject(Handle: HANDLE; Alertable: BOOLEAN; Timeout: PLARGE_INTEGER): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5517. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5518. function NtWaitHighEventPair(
  5519. EventPairHandle : HANDLE
  5520. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5521. function ZwWaitHighEventPair(EventPairHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5522. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5523. function NtWaitLowEventPair(
  5524. EventPairHandle : HANDLE
  5525. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5526. function ZwWaitLowEventPair(EventPairHandle: HANDLE): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5527. // Documented in the DDK as ZwWriteFile().
  5528. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5529. function NtWriteFile(
  5530. FileHandle : HANDLE;
  5531. Event : HANDLE;
  5532. ApcRoutine : PIO_APC_ROUTINE;
  5533. ApcContext : PVOID;
  5534. IoStatusBlock : PIO_STATUS_BLOCK;
  5535. Buffer : PVOID;
  5536. Length : ULONG;
  5537. ByteOffset : PLARGE_INTEGER;
  5538. Key : PULONG
  5539. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5540. function ZwWriteFile(FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PVOID; Length: ULONG; ByteOffset: PLARGE_INTEGER; Key: PULONG): NTSTATUS; stdcall;
  5541. {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5542. // Compatibility: NT4, W2K, WXP, 2K3
  5543. function NtWriteFileGather(
  5544. FileHandle : HANDLE;
  5545. Event : HANDLE;
  5546. ApcRoutine : PIO_APC_ROUTINE;
  5547. ApcContext : PVOID;
  5548. IoStatusBlock : PIO_STATUS_BLOCK;
  5549. Buffer : PFILE_SEGMENT_ELEMENT;
  5550. Length : ULONG;
  5551. ByteOffset : PLARGE_INTEGER;
  5552. Key : PULONG
  5553. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5554. function ZwWriteFileGather(FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_SEGMENT_ELEMENT; Length: ULONG; ByteOffset: PLARGE_INTEGER;
  5555. Key: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5556. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5557. function NtWriteRequestData(
  5558. PortHandle : HANDLE;
  5559. Message : PPORT_MESSAGE;
  5560. Index : ULONG;
  5561. Buffer : PVOID;
  5562. BufferLength : ULONG;
  5563. ReturnLength : PULONG
  5564. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5565. function ZwWriteRequestData(PortHandle: HANDLE; Message: PPORT_MESSAGE; Index: ULONG; Buffer: PVOID; BufferLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5566. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5567. function NtWriteVirtualMemory(
  5568. ProcessHandle : HANDLE;
  5569. BaseAddress : PVOID;
  5570. Buffer : PVOID;
  5571. BufferLength : ULONG;
  5572. ReturnLength : PULONG
  5573. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5574. function ZwWriteVirtualMemory(ProcessHandle: HANDLE; BaseAddress: PVOID; Buffer: PVOID; BufferLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5575. // Compatibility: NT4, W2K, WXP, 2K3
  5576. function NtYieldExecution(): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5577. function ZwYieldExecution(): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5578. // This function is very similar to MakeSelfRelativeSD() from Advapi32.dll.
  5579. // Refer to the PSDK for additional information. Usually the same flags
  5580. // apply.
  5581. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5582. function RtlAbsoluteToSelfRelativeSD(
  5583. pAbsoluteSD : PSECURITY_DESCRIPTOR;
  5584. pSelfRelativeSD : PSECURITY_DESCRIPTOR;
  5585. lpdwBufferLength : LPDWORD
  5586. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5587. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5588. procedure RtlAcquirePebLock(); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5589. // This function is very similar to AddAccessAllowedAce() from
  5590. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  5591. // same flags apply.
  5592. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5593. function RtlAddAccessAllowedAce(
  5594. pAcl: PACL;
  5595. dwAceRevision : DWORD;
  5596. AccessMask : ACCESS_MASK;
  5597. pSid : PSID
  5598. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5599. // This function is very similar to AddAccessAllowedAceEx() from
  5600. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  5601. // same flags apply.
  5602. // Compatibility: W2K, WXP, 2K3
  5603. function RtlAddAccessAllowedAceEx(
  5604. pAcl : PACL;
  5605. dwAceRevision : DWORD;
  5606. AceFlags : DWORD;
  5607. AccessMask : ACCESS_MASK;
  5608. pSid : PSID
  5609. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5610. // This function is very similar to AddAccessDeniedAce() from Advapi32.dll.
  5611. // Refer to the PSDK for additional information. Usually the same flags
  5612. // apply.
  5613. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5614. function RtlAddAccessDeniedAce(
  5615. pAcl : PACL;
  5616. dwAceRevision : DWORD;
  5617. AccessMask : ACCESS_MASK;
  5618. pSid : PSID
  5619. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5620. // This function is very similar to AddAccessDeniedAceEx() from
  5621. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  5622. // same flags apply.
  5623. // Compatibility: W2K, WXP, 2K3
  5624. function RtlAddAccessDeniedAceEx(
  5625. pAcl : PACL;
  5626. dwAceRevision : DWORD;
  5627. AceFlags : DWORD;
  5628. AccessMask : ACCESS_MASK;
  5629. pSid : PSID
  5630. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5631. // This function is very similar to AddAce() from Advapi32.dll. Refer to
  5632. // the PSDK for additional information. Usually the same flags apply.
  5633. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5634. function RtlAddAce(
  5635. pAcl : PACL;
  5636. dwAceRevision : DWORD;
  5637. dwStartingAceIndex : DWORD;
  5638. pAceList : PVOID;
  5639. nAceListLength : DWORD
  5640. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5641. // This function is very similar to AddAuditAccessAce() from Advapi32.dll.
  5642. // Refer to the PSDK for additional information. Usually the same flags
  5643. // apply.
  5644. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5645. function RtlAddAuditAccessAce(
  5646. pAcl : PACL;
  5647. dwAceRevision : DWORD;
  5648. AccessMask : ACCESS_MASK;
  5649. pSid : PSID;
  5650. bAuditSuccess : BOOLEAN;
  5651. bAuditFailure : BOOLEAN
  5652. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5653. // This function is very similar to AddAuditAccessAceEx() from
  5654. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  5655. // same flags apply.
  5656. // Compatibility: W2K, WXP, 2K3
  5657. function RtlAddAuditAccessAceEx(
  5658. pAcl : PACL;
  5659. dwAceRevision : DWORD;
  5660. AceFlags : DWORD;
  5661. AccessMask : ACCESS_MASK;
  5662. pSid : PSID;
  5663. bAuditSuccess : BOOLEAN;
  5664. bAuditFailure : BOOLEAN
  5665. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5666. // Compatibility: W2K, WXP
  5667. function RtlAddRange(
  5668. RangeList : PRTL_RANGE_LIST;
  5669. Start : ULONGLONG;
  5670. End_ : ULONGLONG;
  5671. Attributes : UCHAR;
  5672. Flags : ULONG;
  5673. UserData : PVOID;
  5674. Owner : PVOID
  5675. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5676. // Compatibility: WXP, 2K3
  5677. function RtlAddVectoredExceptionHandler(
  5678. FirstHandler : ULONG;
  5679. VectoredHandler : PVECTORED_EXCEPTION_HANDLER
  5680. ): PVOID; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5681. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5682. function RtlAdjustPrivilege(
  5683. Privilege : ULONG;
  5684. Enable : BOOLEAN;
  5685. CurrentThread : BOOLEAN;
  5686. Enabled : PBOOLEAN
  5687. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5688. // This function is very similar to AllocateAndInitializeSid() from
  5689. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  5690. // same flags apply.
  5691. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5692. function RtlAllocateAndInitializeSid(
  5693. pIdentifierAuthority : PSID_IDENTIFIER_AUTHORITY;
  5694. SubAuthorityCount : BYTE;
  5695. nSubAuthority0 : DWORD;
  5696. nSubAuthority1 : DWORD;
  5697. nSubAuthority2 : DWORD;
  5698. nSubAuthority3 : DWORD;
  5699. nSubAuthority4 : DWORD;
  5700. nSubAuthority5 : DWORD;
  5701. nSubAuthority6 : DWORD;
  5702. nSubAuthority7 : DWORD;
  5703. var pSid : PSID
  5704. ): BOOL; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5705. // The function HeapAlloc() from Kernel32.dll is an export forwarder to
  5706. // this function. This means you can refer to the documentation of
  5707. // HeapAlloc()!
  5708. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5709. function RtlAllocateHeap(
  5710. hHeap : HANDLE;
  5711. dwFlags : ULONG;
  5712. Size : ULONG
  5713. ): PVOID; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5714. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5715. function RtlAnsiCharToUnicodeChar(
  5716. AnsiChar : CHAR
  5717. ): WCHAR; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5718. // Documented in the DDK.
  5719. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5720. function RtlAnsiStringToUnicodeSize(
  5721. AnsiString : PANSI_STRING
  5722. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5723. {$IFNDEF JWA_INCLUDEMODE}
  5724. // Documented in the DDK.
  5725. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5726. function RtlAnsiStringToUnicodeString(
  5727. DestinationString : PUNICODE_STRING;
  5728. SourceString : PANSI_STRING;
  5729. AllocateDestinationString : BOOLEAN
  5730. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5731. {$ENDIF JWA_INCLUDEMODE}
  5732. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5733. function RtlAppendAsciizToString(
  5734. DestinationString : PSTRING;
  5735. AppendThisString : LPCSTR
  5736. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5737. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5738. function RtlAppendStringToString(
  5739. DestinationString : PSTRING;
  5740. AppendThisString : PSTRING
  5741. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5742. // Documented in the DDK.
  5743. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5744. function RtlAppendUnicodeStringToString(
  5745. DestinationString : PUNICODE_STRING;
  5746. SourceString : PUNICODE_STRING
  5747. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5748. // Documented in the DDK.
  5749. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5750. function RtlAppendUnicodeToString(
  5751. Destination : PUNICODE_STRING;
  5752. Source : LPCWSTR
  5753. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5754. // This function is very similar to AreAllAccessesGranted() from
  5755. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  5756. // same flags apply.
  5757. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5758. function RtlAreAllAccessesGranted(
  5759. GrantedAccess : ACCESS_MASK;
  5760. WantedAccess : ACCESS_MASK
  5761. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5762. // This function is very similar to AreAnyAccessesGranted() from
  5763. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  5764. // same flags apply.
  5765. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5766. function RtlAreAnyAccessesGranted(
  5767. GrantedAccess : ACCESS_MASK;
  5768. WantedAccess : ACCESS_MASK
  5769. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5770. // Documented in the DDK.
  5771. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5772. function RtlAreBitsClear(
  5773. BitMapHeader : PRTL_BITMAP;
  5774. StartingIndex : ULONG;
  5775. Length : ULONG
  5776. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5777. // Documented in the DDK.
  5778. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5779. function RtlAreBitsSet(
  5780. BitMapHeader : PRTL_BITMAP;
  5781. StartingIndex : ULONG;
  5782. Length : ULONG
  5783. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5784. // Mentioned in the DDK.
  5785. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5786. procedure RtlAssert(
  5787. FailedAssertion : PVOID;
  5788. FileName : PVOID;
  5789. LineNumber : ULONG;
  5790. Message : PCHAR
  5791. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5792. {$IFNDEF JWA_INCLUDEMODE}
  5793. // The function RtlCaptureContext() from Kernel32.dll is an export
  5794. // forwarder to this function. This means you can refer to the
  5795. // documentation of RtlCaptureContext()!
  5796. // Compatibility: WXP, 2K3
  5797. procedure RtlCaptureContext(
  5798. ContextRecord : PCONTEXT
  5799. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5800. {$ENDIF JWA_INCLUDEMODE}
  5801. {$IFNDEF JWA_INCLUDEMODE}
  5802. // Documented in the DDK.
  5803. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5804. function RtlCharToInteger(
  5805. Str : PCSZ;
  5806. Base : ULONG;
  5807. Value : PULONG
  5808. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5809. {$ENDIF JWA_INCLUDEMODE}
  5810. // Somehow internally used.
  5811. // Compatibility: W2K, WXP, 2K3
  5812. procedure RtlCheckForOrphanedCriticalSections(
  5813. hThread : HANDLE
  5814. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5815. // Documented in the DDK.
  5816. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5817. function RtlCheckRegistryKey(
  5818. RelativeTo : ULONG;
  5819. Path : PWSTR
  5820. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5821. // Documented in the DDK.
  5822. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5823. procedure RtlClearAllBits(
  5824. BitMapHeader : PRTL_BITMAP
  5825. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5826. // Documented in the DDK.
  5827. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5828. procedure RtlClearBits(
  5829. BitMapHeader : PRTL_BITMAP;
  5830. StartingIndex : ULONG;
  5831. NumberToClear : ULONG
  5832. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5833. // This function is very similar to HeapCompact() from Kernel32.dll. Refer
  5834. // to the PSDK for additional information. Usually the same flags apply.
  5835. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5836. function RtlCompactHeap(
  5837. hHeap : HANDLE;
  5838. dwFlags : ULONG
  5839. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5840. {$IFNDEF JWA_INCLUDEMODE}
  5841. // Documented in the DDK.
  5842. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5843. function RtlCompareMemory(
  5844. Source1 : PVOID;
  5845. Source2 : PVOID;
  5846. Length : SIZE_T
  5847. ): SIZE_T; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5848. {$ENDIF JWA_INCLUDEMODE}
  5849. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5850. function RtlCompareMemoryUlong(
  5851. Source : PVOID;
  5852. Length : ULONG;
  5853. Value : ULONG
  5854. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5855. // Documented in the DDK.
  5856. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5857. function RtlCompareString(
  5858. String1 : PSTRING;
  5859. String2 : PSTRING;
  5860. CaseInsensitive : BOOLEAN
  5861. ): LONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5862. // Documented in the DDK.
  5863. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5864. function RtlCompareUnicodeString(
  5865. String1 : PUNICODE_STRING;
  5866. String2 : PUNICODE_STRING;
  5867. CaseInsensitive : BOOLEAN
  5868. ): LONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5869. // Documented in the DDK.
  5870. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5871. function RtlConvertLongToLargeInteger(
  5872. SignedInteger : LONG
  5873. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5874. {$IFNDEF JWA_INCLUDEMODE}
  5875. // This function is very similar to ConvertSidToStringSid() from
  5876. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  5877. // same flags apply.
  5878. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5879. function RtlConvertSidToUnicodeString(
  5880. UnicodeString : PUNICODE_STRING;
  5881. Sid : PSID;
  5882. AllocateDestinationString : BOOLEAN
  5883. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5884. {$ENDIF JWA_INCLUDEMODE}
  5885. // Documented in the DDK.
  5886. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5887. function RtlConvertUlongToLargeInteger(
  5888. UnsignedInteger : ULONG
  5889. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5890. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5891. procedure RtlCopyLuid(
  5892. Destination : PLUID;
  5893. Source : PLUID
  5894. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5895. // Compatibility: W2K, WXP
  5896. function RtlCopyRangeList(
  5897. CopyRangeList : PRTL_RANGE_LIST;
  5898. RangeList : PRTL_RANGE_LIST
  5899. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5900. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5901. function RtlCopySecurityDescriptor(
  5902. Source : PSECURITY_DESCRIPTOR;
  5903. var Destination : PSECURITY_DESCRIPTOR
  5904. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5905. // This function is very similar to CopySid() from Advapi32.dll. Refer to
  5906. // the PSDK for additional information. Usually the same flags apply.
  5907. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5908. function RtlCopySid(
  5909. DestinationLength : ULONG;
  5910. Destination : PSID;
  5911. Source : PSID
  5912. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5913. // Documented in the DDK.
  5914. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5915. procedure RtlCopyString(
  5916. DestinationString : PSTRING;
  5917. SourceString : PSTRING
  5918. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5919. // Documented in the DDK.
  5920. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5921. procedure RtlCopyUnicodeString(
  5922. DestinationString : PUNICODE_STRING;
  5923. SourceString : PUNICODE_STRING
  5924. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5925. // This function is very similar to InitializeAcl() from Advapi32.dll.
  5926. // Refer to the PSDK for additional information. Usually the same flags
  5927. // apply.
  5928. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5929. function RtlCreateAcl(
  5930. pAcl : PACL;
  5931. nAclLength : DWORD;
  5932. dwAclRevision : DWORD
  5933. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5934. // This function is very similar to HeapCreate() from Kernel32.dll. Refer
  5935. // to the PSDK for additional information. Usually the same flags apply.
  5936. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5937. function RtlCreateHeap(
  5938. dwOptions : ULONG;
  5939. Base : PVOID;
  5940. dwMaximumSize : SIZE_T;
  5941. dwInitialSize : SIZE_T;
  5942. UnknownOptional1 : PVOID;
  5943. UnknownOptional2 : PVOID
  5944. ): HANDLE; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5945. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5946. function RtlCreateProcessParameters(
  5947. ProcessParameters : PPRTL_USER_PROCESS_PARAMETERS;
  5948. ImageFile : PUNICODE_STRING;
  5949. DllPath : PUNICODE_STRING;
  5950. CurrentDirectory : PUNICODE_STRING;
  5951. CommandLine : PUNICODE_STRING;
  5952. CreationFlags : ULONG;
  5953. WindowTitle : PUNICODE_STRING;
  5954. Desktop : PUNICODE_STRING;
  5955. Reserved : PUNICODE_STRING;
  5956. Reserved2 : PUNICODE_STRING
  5957. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5958. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5959. function RtlCreateQueryDebugBuffer(
  5960. Size : ULONG;
  5961. EventPair : BOOLEAN
  5962. ): PDEBUG_BUFFER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5963. // Documented in the DDK.
  5964. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5965. function RtlCreateRegistryKey(
  5966. RelativeTo : ULONG;
  5967. Path : PWSTR
  5968. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5969. // Documented in the DDK.
  5970. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5971. function RtlCreateSecurityDescriptor(
  5972. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  5973. Revision : ULONG
  5974. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5975. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5976. function RtlCreateUnicodeString(
  5977. DestinationString : PUNICODE_STRING;
  5978. SourceString : PWSTR
  5979. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5980. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5981. function RtlCreateUnicodeStringFromAsciiz(
  5982. DestinationString : PUNICODE_STRING;
  5983. SourceString : PCHAR
  5984. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5985. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5986. function RtlCreateUserProcess(
  5987. ImageFileName : PUNICODE_STRING;
  5988. Attributes : ULONG;
  5989. ProcessParameters : PRTL_USER_PROCESS_PARAMETERS;
  5990. ProcessSecurityDescriptor : PSECURITY_DESCRIPTOR;
  5991. ThreadSecurityDescriptor : PSECURITY_DESCRIPTOR;
  5992. ParentProcess : HANDLE;
  5993. InheritHandles : BOOLEAN;
  5994. DebugPort : HANDLE;
  5995. ExceptionPort : HANDLE;
  5996. ProcessInfo : PRTL_PROCESS_INFORMATION
  5997. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  5998. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  5999. function RtlCreateUserThread(
  6000. hProcess : HANDLE;
  6001. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  6002. CreateSuspended : BOOLEAN;
  6003. StackZeroBits : ULONG;
  6004. StackReserve : ULONG;
  6005. StackCommit : ULONG;
  6006. lpStartAddress : PTHREAD_START_ROUTINE;
  6007. lpParameter : PVOID;
  6008. phThread : PHANDLE;
  6009. ClientId : PCLIENT_ID
  6010. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6011. // #->REVIEW LAST PARAMETER
  6012. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6013. function RtlCutoverTimeToSystemTime(
  6014. TargetTimeFields : PTIME_FIELDS;
  6015. Time : PLARGE_INTEGER;
  6016. CurrentTime : PLARGE_INTEGER;
  6017. bUnknown : BOOLEAN
  6018. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6019. // This function is very similar to DeleteAce() from Advapi32.dll. Refer to
  6020. // the PSDK for additional information. Usually the same flags apply.
  6021. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6022. function RtlDeleteAce(
  6023. pAcl : PACL;
  6024. dwAceIndex : DWORD
  6025. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6026. // The function DeleteCriticalSection() from Kernel32.dll is an export
  6027. // forwarder to this function. This means you can refer to the
  6028. // documentation of DeleteCriticalSection()!
  6029. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6030. procedure RtlDeleteCriticalSection(
  6031. lpCriticalSection : PRTL_CRITICAL_SECTION
  6032. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6033. // Compatibility: W2K, WXP
  6034. function RtlDeleteOwnersRanges(
  6035. RangeList : PRTL_RANGE_LIST;
  6036. Owner : PVOID
  6037. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6038. // Compatibility: W2K, WXP
  6039. function RtlDeleteRange(
  6040. RangeList : PRTL_RANGE_LIST;
  6041. Start : ULONGLONG;
  6042. End_ : ULONGLONG;
  6043. Owner : PVOID
  6044. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6045. // Documented in the DDK.
  6046. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6047. function RtlDeleteRegistryValue(
  6048. RelativeTo : ULONG;
  6049. Path : LPCWSTR;
  6050. ValueName : LPCWSTR
  6051. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6052. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6053. function RtlDeNormalizeProcessParams(
  6054. ProcessParameters : PRTL_USER_PROCESS_PARAMETERS
  6055. ): PRTL_USER_PROCESS_PARAMETERS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6056. // This function is very similar to HeapDestroy() from Kernel32.dll. Refer
  6057. // to the PSDK for additional information. Usually the same flags apply.
  6058. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6059. function RtlDestroyHeap(
  6060. HeapHandle : HANDLE
  6061. ): HANDLE; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6062. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6063. function RtlDestroyProcessParameters(
  6064. ProcessParameters : PRTL_USER_PROCESS_PARAMETERS
  6065. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6066. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6067. function RtlDestroyQueryDebugBuffer(
  6068. DebugBuffer : PDEBUG_BUFFER
  6069. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6070. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6071. function RtlDetermineDosPathNameType_U(
  6072. wcsPathNameType : PWSTR
  6073. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6074. // Compatibility: W2K, WXP, 2K3
  6075. function RtlDnsHostNameToComputerName(
  6076. ComputerName : PUNICODE_STRING;
  6077. DnsName : PUNICODE_STRING;
  6078. AllocateComputerNameString : BOOLEAN
  6079. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6080. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6081. function RtlDoesFileExists_U(
  6082. FileName : PWSTR
  6083. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6084. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6085. function RtlDosPathNameToNtPathName_U(
  6086. DosName : PWSTR;
  6087. var NtName : UNICODE_STRING;
  6088. DosFilePath : PPWSTR;
  6089. NtFilePath : PUNICODE_STRING
  6090. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6091. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6092. function RtlDosSearchPath_U(
  6093. SearchPath : PWSTR;
  6094. Name : PWSTR;
  6095. Ext : PWSTR;
  6096. cbBuf : ULONG;
  6097. Buffer : PWSTR;
  6098. var Shortname : PWSTR
  6099. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6100. // Compatibility: WXP, 2K3
  6101. function RtlDowncaseUnicodeChar(
  6102. Source : WCHAR
  6103. ): WCHAR; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6104. // Compatibility: NT4, W2K, WXP, 2K3
  6105. function RtlDowncaseUnicodeString(
  6106. DestinationString : PUNICODE_STRING;
  6107. SourceString : PUNICODE_STRING;
  6108. AllocateDestinationString : BOOLEAN
  6109. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6110. // #->REVIEW First parameter must be 0..3, but details have to be
  6111. // investigated!!!
  6112. // Compatibility: WXP, 2K3
  6113. function RtlDuplicateUnicodeString(
  6114. AddTerminatingZero : ULONG;
  6115. Source : PUNICODE_STRING;
  6116. Destination : PUNICODE_STRING
  6117. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6118. // Compatibility: W2K, WXP, 2K3
  6119. procedure RtlEnableEarlyCriticalSectionEventCreation(); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6120. // Documented in the DDK.
  6121. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6122. function RtlEnlargedIntegerMultiply(
  6123. Multiplicand : LONG;
  6124. Multiplier : LONG
  6125. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6126. // Documented in the DDK.
  6127. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6128. function RtlEnlargedUnsignedDivide(
  6129. Dividend : ULARGE_INTEGER;
  6130. Divisor : ULONG;
  6131. Remainder : PULONG
  6132. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6133. // Documented in the DDK.
  6134. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6135. function RtlEnlargedUnsignedMultiply(
  6136. Multiplicand : ULONG;
  6137. Multiplier : ULONG
  6138. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6139. // The function EnterCriticalSection() from Kernel32.dll is an export
  6140. // forwarder to this function. This means you can refer to the
  6141. // documentation of EnterCriticalSection()!
  6142. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6143. procedure RtlEnterCriticalSection(
  6144. lpCriticalSection : PRTL_CRITICAL_SECTION
  6145. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6146. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6147. function RtlEqualComputerName(
  6148. String1 : PUNICODE_STRING;
  6149. String2 : PUNICODE_STRING
  6150. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6151. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6152. function RtlEqualDomainName(
  6153. String1 : PUNICODE_STRING;
  6154. String2 : PUNICODE_STRING
  6155. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6156. // Documented in the DDK.
  6157. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6158. function RtlEqualLuid(
  6159. Luid1 : PLUID;
  6160. Luid2 : PLUID
  6161. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6162. // This function is very similar to EqualPrefixSid() from Advapi32.dll.
  6163. // Refer to the PSDK for additional information. Usually the same flags
  6164. // apply.
  6165. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6166. function RtlEqualPrefixSid(
  6167. pSid1 : PSID;
  6168. pSid2 : PSID
  6169. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6170. // This function is very similar to EqualSid() from Advapi32.dll. Refer to
  6171. // the PSDK for additional information. Usually the same flags apply.
  6172. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6173. function RtlEqualSid(
  6174. pSid1 : PSID;
  6175. pSid2 : PSID
  6176. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6177. // Documented in the DDK.
  6178. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6179. function RtlEqualString(
  6180. String1 : PSTRING;
  6181. String2 : PSTRING;
  6182. CaseInsensitive : BOOLEAN
  6183. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6184. // Documented in the DDK.
  6185. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6186. function RtlEqualUnicodeString(
  6187. String1 : PUNICODE_STRING;
  6188. String2 : PUNICODE_STRING;
  6189. CaseInsensitive : BOOLEAN
  6190. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6191. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6192. procedure RtlEraseUnicodeString(
  6193. Str : PUNICODE_STRING
  6194. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6195. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6196. function RtlExpandEnvironmentStrings_U(
  6197. Environment : PVOID;
  6198. Source : PUNICODE_STRING;
  6199. Destination : PUNICODE_STRING;
  6200. ReturnedLength : PULONG
  6201. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6202. // Documented in the DDK.
  6203. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6204. function RtlExtendedIntegerMultiply(
  6205. Multiplicand : LARGE_INTEGER;
  6206. Multiplier : LONG
  6207. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6208. // Documented in the DDK.
  6209. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6210. function RtlExtendedLargeIntegerDivide(
  6211. Dividend : LARGE_INTEGER;
  6212. Divisor : ULONG;
  6213. Remainder : PULONG
  6214. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6215. // Documented in the DDK.
  6216. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6217. function RtlExtendedMagicDivide(
  6218. Dividend : LARGE_INTEGER;
  6219. MagicDivisor : LARGE_INTEGER;
  6220. ShiftCount : CCHAR
  6221. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6222. // The function RtlFillMemory() from Kernel32.dll is an export forwarder to
  6223. // this function. This means you can refer to the documentation of
  6224. // RtlFillMemory()!
  6225. // Documented in the DDK.
  6226. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6227. procedure RtlFillMemory(
  6228. Destination : PVOID;
  6229. Length : SIZE_T;
  6230. Fill : UCHAR
  6231. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6232. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6233. procedure RtlFillMemoryUlong(
  6234. Destination : PVOID;
  6235. Length : ULONG;
  6236. Fill : ULONG
  6237. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6238. // Finds characters out of the set contained in CharactersToFind inside
  6239. // UnicodeString - description of flags will follow. Only the lower 3 bits
  6240. // are valid!!!
  6241. // Compatibility: WXP, 2K3
  6242. function RtlFindCharInUnicodeString(
  6243. dwFlags : ULONG;
  6244. UnicodeString : PUNICODE_STRING;
  6245. CharactersToFind : PUNICODE_STRING;
  6246. Positions : PUSHORT
  6247. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6248. // Documented in the DDK.
  6249. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6250. function RtlFindClearBits(
  6251. BitMapHeader : PRTL_BITMAP;
  6252. NumberToFind : ULONG;
  6253. HintIndex : ULONG
  6254. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6255. // Documented in the DDK.
  6256. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6257. function RtlFindClearBitsAndSet(
  6258. BitMapHeader : PRTL_BITMAP;
  6259. NumberToFind : ULONG;
  6260. HintIndex : ULONG
  6261. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6262. // Documented in the DDK.
  6263. // Compatibility: W2K, WXP, 2K3
  6264. function RtlFindLastBackwardRunClear(
  6265. BitMapHeader : PRTL_BITMAP;
  6266. FromIndex : ULONG;
  6267. StartingRunIndex : PULONG
  6268. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6269. // Documented in the DDK.
  6270. // Compatibility: W2K, WXP, 2K3
  6271. function RtlFindLeastSignificantBit(
  6272. Set_ : ULONGLONG
  6273. ): CCHAR; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6274. // Documented in the DDK.
  6275. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6276. function RtlFindLongestRunClear(
  6277. BitMapHeader : PRTL_BITMAP;
  6278. StartingIndex : PULONG
  6279. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6280. // Compatibility: W2K, WXP, 2K3
  6281. function RtlFindMostSignificantBit(
  6282. Set_ : ULONGLONG
  6283. ): CCHAR; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6284. // Documented in the DDK.
  6285. // Compatibility: W2K, WXP, 2K3
  6286. function RtlFindNextForwardRunClear(
  6287. BitMapHeader : PRTL_BITMAP;
  6288. FromIndex : ULONG;
  6289. StartingRunIndex : PULONG
  6290. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6291. // Compatibility: W2K, WXP
  6292. function RtlFindRange(
  6293. RangeList : PRTL_RANGE_LIST;
  6294. Minimum : ULONGLONG;
  6295. Maximum : ULONGLONG;
  6296. Length : ULONG;
  6297. Alignment : ULONG;
  6298. Flags : ULONG;
  6299. AttributeAvailableMask : UCHAR;
  6300. Context : PVOID;
  6301. Callback : PRTL_CONFLICT_RANGE_CALLBACK;
  6302. Start : PULONGLONG
  6303. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6304. // Documented in the DDK.
  6305. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6306. function RtlFindSetBits(
  6307. BitMapHeader : PRTL_BITMAP;
  6308. NumberToFind : ULONG;
  6309. HintIndex : ULONG
  6310. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6311. // Documented in the DDK.
  6312. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6313. function RtlFindSetBitsAndClear(
  6314. BitMapHeader : PRTL_BITMAP;
  6315. NumberToFind : ULONG;
  6316. HintIndex : ULONG
  6317. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6318. // This function is very similar to FindFirstFreeAce() from Advapi32.dll.
  6319. // Refer to the PSDK for additional information. Usually the same flags
  6320. // apply.
  6321. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6322. function RtlFirstFreeAce(
  6323. pAcl : PACL;
  6324. var pAce : PVOID
  6325. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6326. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6327. function RtlFormatCurrentUserKeyPath(
  6328. CurrentUserKeyPath : PUNICODE_STRING
  6329. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6330. // Documented in the DDK.
  6331. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6332. procedure RtlFreeAnsiString(
  6333. AnsiString : PANSI_STRING
  6334. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6335. // The function HeapFree() from Kernel32.dll is an export forwarder to this
  6336. // function. This means you can refer to the documentation of HeapFree()!
  6337. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6338. function RtlFreeHeap(
  6339. hHeap : HANDLE;
  6340. dwFlags : ULONG;
  6341. MemoryPointer : PVOID
  6342. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6343. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6344. procedure RtlFreeOemString(
  6345. OemString : POEM_STRING
  6346. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6347. // Compatibility: W2K, WXP
  6348. procedure RtlFreeRangeList(
  6349. RangeList : PRTL_RANGE_LIST
  6350. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6351. // This function is very similar to FreeSid() from Advapi32.dll. Refer to
  6352. // the PSDK for additional information. Usually the same flags apply.
  6353. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6354. function RtlFreeSid(
  6355. pSid : PSID
  6356. ): PVOID; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6357. // Documented in the DDK.
  6358. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6359. procedure RtlFreeUnicodeString(
  6360. UnicodeString : PUNICODE_STRING
  6361. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6362. // This function is very similar to GetAce() from Advapi32.dll. Refer to
  6363. // the PSDK for additional information. Usually the same flags apply.
  6364. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6365. function RtlGetAce(
  6366. pAcl : PACL;
  6367. dwAceIndex : DWORD;
  6368. var pAce : PVOID
  6369. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6370. // Mentioned in the DDK.
  6371. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6372. procedure RtlGetCallersAddress(
  6373. CallersAddress : PPVOID;
  6374. CallersCaller : PPVOID
  6375. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6376. // This function is very similar to GetSecurityDescriptorControl() from
  6377. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  6378. // same flags apply.
  6379. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6380. function RtlGetControlSecurityDescriptor(
  6381. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  6382. var Control : SECURITY_DESCRIPTOR_CONTROL;
  6383. var dwRevision : DWORD
  6384. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6385. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6386. function RtlGetCurrentDirectory_U(
  6387. MaximumLength : ULONG;
  6388. Buffer : PWSTR
  6389. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6390. // Compatibility: WXP, 2K3
  6391. function RtlGetCurrentPeb(): PPEB; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6392. // This function is very similar to GetSecurityDescriptorDacl() from
  6393. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  6394. // same flags apply.
  6395. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6396. function RtlGetDaclSecurityDescriptor(
  6397. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  6398. var bDaclPresent : BOOLEAN;
  6399. var Dacl : PACL;
  6400. var bDaclDefaulted : BOOLEAN
  6401. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6402. // Compatibility: W2K, WXP
  6403. function RtlGetFirstRange(
  6404. RangeList : PRTL_RANGE_LIST;
  6405. Iterator : PRTL_RANGE_LIST_ITERATOR;
  6406. var Range : PRTL_RANGE
  6407. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6408. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6409. function RtlGetFullPathName_U(
  6410. DosName : PWSTR;
  6411. Size : ULONG;
  6412. Buf : PWSTR;
  6413. var Shortname : PWSTR
  6414. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6415. // This function is very similar to GetSecurityDescriptorGroup() from
  6416. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  6417. // same flags apply.
  6418. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6419. function RtlGetGroupSecurityDescriptor(
  6420. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  6421. var pGroup : PSID;
  6422. var bGroupDefaulted : BOOLEAN
  6423. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6424. // Compatibility: WXP, 2K3
  6425. function RtlGetLastNtStatus(): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6426. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6427. function RtlGetLongestNtPathLength(): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6428. // Compatibility: W2K, WXP
  6429. function RtlGetNextRange(
  6430. Iterator : PRTL_RANGE_LIST_ITERATOR;
  6431. var Range : PRTL_RANGE;
  6432. MoveForwards : BOOLEAN
  6433. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6434. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6435. function RtlGetNtGlobalFlags(): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6436. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6437. function RtlGetNtProductType(
  6438. var ProductType : ULONG
  6439. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6440. // #->REVIEW LAST PARAMETER
  6441. // Compatibility: WXP, 2K3
  6442. procedure RtlGetNtVersionNumbers(
  6443. var dwMajorVersion : ULONG;
  6444. var dwMinorVersion : ULONG;
  6445. UnknownCanBeNull : PDWORD
  6446. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6447. // This function is very similar to GetSecurityDescriptorOwner() from
  6448. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  6449. // same flags apply.
  6450. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6451. function RtlGetOwnerSecurityDescriptor(
  6452. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  6453. var pOwner : PSID;
  6454. var OwnerDefaulted : BOOLEAN
  6455. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6456. // This function is very similar to GetProcessHeaps() from Kernel32.dll.
  6457. // Refer to the PSDK for additional information. Usually the same flags
  6458. // apply.
  6459. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6460. function RtlGetProcessHeaps(
  6461. ArraySize : ULONG;
  6462. HeapArray : PHANDLE
  6463. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6464. // This function is very similar to GetSecurityDescriptorSacl() from
  6465. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  6466. // same flags apply.
  6467. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6468. function RtlGetSaclSecurityDescriptor(
  6469. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  6470. var bSaclPresent : BOOLEAN;
  6471. var Sacl : PACL;
  6472. var bSaclDefaulted : BOOLEAN
  6473. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6474. // This function is very similar to GetVersionEx() from Kernel32.dll. Refer
  6475. // to the PSDK for additional information. Usually the same flags apply.
  6476. // Documented in the DDK.
  6477. // Compatibility: W2K, WXP, 2K3
  6478. function RtlGetVersion(
  6479. lpVersionInformation : PRTL_OSVERSIONINFOW
  6480. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6481. // Documented in the DDK.
  6482. // Compatibility: W2K, WXP, 2K3
  6483. function RtlGUIDFromString(
  6484. GuidString : PUNICODE_STRING;
  6485. Guid : LPGUID
  6486. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6487. // This function is very similar to GetSidIdentifierAuthority() from
  6488. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  6489. // same flags apply.
  6490. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6491. function RtlIdentifierAuthoritySid(
  6492. Sid : PSID
  6493. ): PSID_IDENTIFIER_AUTHORITY; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6494. // This function is very similar to ImageDirectoryEntryToData() from
  6495. // Dbghelp.dll. Refer to the PSDK for additional information. Usually the
  6496. // same flags apply.
  6497. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6498. function RtlImageDirectoryEntryToData(
  6499. ImageBase : HMODULE;
  6500. MappedAsImage : BOOLEAN;
  6501. DirectoryEntry : USHORT;
  6502. Size : PULONG
  6503. ): PVOID; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6504. // This function is very similar to ImageNtHeader() from Dbghelp.dll. Refer
  6505. // to the PSDK for additional information. Usually the same flags apply.
  6506. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6507. function RtlImageNtHeader(
  6508. ImageBase : HMODULE
  6509. ): PIMAGE_NT_HEADERS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6510. // This function is very similar to ImageNtHeader() from Dbghelp.dll. Refer
  6511. // to the PSDK for additional information. Usually the same flags apply.
  6512. // With dwFlags equal 1 it shows the same behavior as RtlImageNtHeader()
  6513. // Compatibility: 2K3
  6514. function RtlImageNtHeaderEx(
  6515. dwFlags : DWORD;
  6516. ImageBase : HMODULE
  6517. ): PIMAGE_NT_HEADERS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6518. // This function is very similar to ImageRvaToSection() from Dbghelp.dll.
  6519. // Refer to the PSDK for additional information. Usually the same flags
  6520. // apply.
  6521. // Compatibility: NT4, W2K, WXP, 2K3
  6522. function RtlImageRvaToSection(
  6523. NtHeaders : PIMAGE_NT_HEADERS;
  6524. ImageBase : HMODULE;
  6525. Rva : ULONG
  6526. ): PIMAGE_SECTION_HEADER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6527. // This function is very similar to ImageRvaToVa() from Dbghelp.dll. Refer
  6528. // to the PSDK for additional information. Usually the same flags apply.
  6529. // Compatibility: NT4, W2K, WXP, 2K3
  6530. function RtlImageRvaToVa(
  6531. NtHeaders : PIMAGE_NT_HEADERS;
  6532. ImageBase : HMODULE;
  6533. Rva : ULONG;
  6534. var LastRvaSection : PIMAGE_SECTION_HEADER
  6535. ): PVOID; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6536. // This function is very similar to ImpersonateSelf() from Advapi32.dll.
  6537. // Refer to the PSDK for additional information. Usually the same flags
  6538. // apply.
  6539. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6540. function RtlImpersonateSelf(
  6541. ImpersonationLevel : SECURITY_IMPERSONATION_LEVEL
  6542. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6543. // Documented in the DDK.
  6544. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6545. procedure RtlInitAnsiString(
  6546. DestinationString : PANSI_STRING;
  6547. SourceString : PCSZ
  6548. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6549. // Compatibility: 2K3
  6550. function RtlInitAnsiStringEx(
  6551. DestinationString : PANSI_STRING;
  6552. SourceString : PCSZ
  6553. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6554. // Documented in the DDK.
  6555. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6556. procedure RtlInitializeBitMap(
  6557. BitMapHeader : PRTL_BITMAP;
  6558. BitMapBuffer : PULONG;
  6559. SizeOfBitMap : ULONG
  6560. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6561. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6562. function RtlInitializeCriticalSection(
  6563. lpCriticalSection : PRTL_CRITICAL_SECTION
  6564. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6565. // Compatibility: NT4, W2K, WXP, 2K3
  6566. function RtlInitializeCriticalSectionAndSpinCount(
  6567. lpCriticalSection : PRTL_CRITICAL_SECTION;
  6568. dwSpinCount : ULONG
  6569. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6570. // Compatibility: W2K, WXP
  6571. procedure RtlInitializeRangeList(
  6572. RangeList : PRTL_RANGE_LIST
  6573. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6574. // This function is very similar to InitializeSid() from Advapi32.dll.
  6575. // Refer to the PSDK for additional information. Usually the same flags
  6576. // apply.
  6577. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6578. function RtlInitializeSid(
  6579. pSid : PSID;
  6580. pIdentifierAuthority : PSID_IDENTIFIER_AUTHORITY;
  6581. nSubAuthorityCount : UCHAR
  6582. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6583. {$IFNDEF JWA_INCLUDEMODE}
  6584. // Compatibility: WXP, 2K3
  6585. procedure RtlInitializeSListHead(
  6586. ListHead : PSLIST_HEADER
  6587. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6588. {$ENDIF JWA_INCLUDEMODE}
  6589. // Documented in the DDK.
  6590. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6591. procedure RtlInitString(
  6592. DestinationString : PSTRING;
  6593. SourceString : PCSZ
  6594. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6595. // Documented in the DDK.
  6596. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6597. procedure RtlInitUnicodeString(
  6598. DestinationString : PUNICODE_STRING;
  6599. SourceString : LPCWSTR
  6600. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6601. // Compatibility: WXP, 2K3
  6602. function RtlInitUnicodeStringEx(
  6603. DestinationString : PUNICODE_STRING;
  6604. SourceString : LPCWSTR
  6605. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6606. // Documented in the DDK.
  6607. // Compatibility: W2K, WXP, 2K3
  6608. function RtlInt64ToUnicodeString(
  6609. Value : ULONGLONG;
  6610. Base : ULONG;
  6611. Str : PUNICODE_STRING
  6612. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6613. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6614. function RtlIntegerToChar(
  6615. Value : ULONG;
  6616. Base : ULONG;
  6617. Length : ULONG;
  6618. Str : PCHAR
  6619. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6620. // Documented in the DDK.
  6621. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6622. function RtlIntegerToUnicodeString(
  6623. Value : ULONG;
  6624. Base : ULONG;
  6625. Str : PUNICODE_STRING
  6626. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6627. {$IFNDEF JWA_INCLUDEMODE}
  6628. // Compatibility: WXP, 2K3
  6629. function RtlInterlockedFlushSList(
  6630. ListHead : PSLIST_HEADER
  6631. ): PSLIST_ENTRY; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6632. // Compatibility: WXP, 2K3
  6633. function RtlInterlockedPopEntrySList(
  6634. ListHead : PSLIST_HEADER
  6635. ): PSLIST_ENTRY; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6636. {$ENDIF JWA_INCLUDEMODE}
  6637. // Compatibility: WXP, 2K3
  6638. function RtlInterlockedPushEntrySList(
  6639. ListHead : PSLIST_HEADER;
  6640. ListEntry : PSLIST_ENTRY
  6641. ): PSLIST_ENTRY; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6642. // Compatibility: W2K, WXP
  6643. function RtlInvertRangeList(
  6644. InvertedRangeList : PRTL_RANGE_LIST;
  6645. RangeList : PRTL_RANGE_LIST
  6646. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6647. // Compatibility: WXP, 2K3
  6648. function RtlIpv4AddressToStringA(
  6649. IP : PULONG;
  6650. Buffer : LPSTR
  6651. ): LPSTR; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6652. // Compatibility: WXP, 2K3
  6653. function RtlIpv4AddressToStringW(
  6654. IP : PULONG;
  6655. Buffer : LPWSTR
  6656. ): LPWSTR; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6657. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6658. function RtlIsDosDeviceName_U(
  6659. TestString : LPCWSTR
  6660. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6661. {$IFNDEF JWA_INCLUDEMODE}
  6662. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6663. function RtlIsNameLegalDOS8Dot3(
  6664. Name : PUNICODE_STRING;
  6665. OemName : POEM_STRING;
  6666. NameContainsSpaces : PBOOLEAN
  6667. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6668. {$ENDIF JWA_INCLUDEMODE}
  6669. // Compatibility: W2K, WXP
  6670. function RtlIsRangeAvailable(
  6671. RangeList : PRTL_RANGE_LIST;
  6672. Start : ULONGLONG;
  6673. End_ : ULONGLONG;
  6674. Flags : ULONG;
  6675. AttributeAvailableMask : UCHAR;
  6676. Context : PVOID;
  6677. Callback : PRTL_CONFLICT_RANGE_CALLBACK;
  6678. Available : PBOOLEAN
  6679. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6680. // This function is very similar to IsTextUnicode() from Advapi32.dll.
  6681. // Refer to the PSDK for additional information. Usually the same flags
  6682. // apply.
  6683. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6684. function RtlIsTextUnicode(
  6685. lpBuffer : PVOID;
  6686. cb : Integer;
  6687. lpi : LPINT
  6688. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6689. // Documented in the DDK.
  6690. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6691. function RtlLargeIntegerAdd(
  6692. Addend1 : LARGE_INTEGER;
  6693. Addend2 : LARGE_INTEGER
  6694. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6695. // Documented in the DDK.
  6696. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6697. function RtlLargeIntegerArithmeticShift(
  6698. LargeInteger : LARGE_INTEGER;
  6699. ShiftCount : CCHAR
  6700. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6701. // Documented in the DDK.
  6702. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6703. function RtlLargeIntegerDivide(
  6704. Dividend : LARGE_INTEGER;
  6705. Divisor : LARGE_INTEGER;
  6706. Remainder : PLARGE_INTEGER
  6707. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6708. // Documented in the DDK.
  6709. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6710. function RtlLargeIntegerNegate(
  6711. NegateThis : LARGE_INTEGER
  6712. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6713. // Documented in the DDK.
  6714. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6715. function RtlLargeIntegerShiftLeft(
  6716. LargeInteger : LARGE_INTEGER;
  6717. ShiftCount : CCHAR
  6718. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6719. // Documented in the DDK.
  6720. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6721. function RtlLargeIntegerShiftRight(
  6722. LargeInteger : LARGE_INTEGER;
  6723. ShiftCount : CCHAR
  6724. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6725. // Documented in the DDK.
  6726. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6727. function RtlLargeIntegerSubtract(
  6728. Number : LARGE_INTEGER;
  6729. Subtrahend : LARGE_INTEGER
  6730. ): LARGE_INTEGER; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6731. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6732. function RtlLargeIntegerToChar(
  6733. Value : PLARGE_INTEGER;
  6734. Base : ULONG;
  6735. BufferLength : ULONG;
  6736. Buffer : PCHAR
  6737. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6738. // The function LeaveCriticalSection() from Kernel32.dll is an export
  6739. // forwarder to this function. This means you can refer to the
  6740. // documentation of LeaveCriticalSection()!
  6741. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6742. procedure RtlLeaveCriticalSection(
  6743. lpCriticalSection : PRTL_CRITICAL_SECTION
  6744. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6745. // This function is very similar to GetSidLengthRequired() from
  6746. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  6747. // same flags apply.
  6748. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6749. function RtlLengthRequiredSid(
  6750. nSubAuthorityCount : ULONG
  6751. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6752. // This function is very similar to GetSecurityDescriptorLength() from
  6753. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  6754. // same flags apply.
  6755. // Documented in the DDK.
  6756. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6757. function RtlLengthSecurityDescriptor(
  6758. SecurityDescriptor : PSECURITY_DESCRIPTOR
  6759. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6760. // This function is very similar to GetLengthSid() from Advapi32.dll. Refer
  6761. // to the PSDK for additional information. Usually the same flags apply.
  6762. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6763. function RtlLengthSid(
  6764. pSid : PSID
  6765. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6766. {$IFNDEF JWA_INCLUDEMODE}
  6767. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6768. function RtlLocalTimeToSystemTime(
  6769. LocalTime : PLARGE_INTEGER;
  6770. SystemTime : PLARGE_INTEGER
  6771. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6772. {$ENDIF JWA_INCLUDEMODE}
  6773. // This function is very similar to HeapLock() from Kernel32.dll. Refer to
  6774. // the PSDK for additional information. Usually the same flags apply.
  6775. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6776. function RtlLockHeap(
  6777. hHeap : PVOID
  6778. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6779. // This function is very similar to MakeSelfRelativeSD() from Advapi32.dll.
  6780. // Refer to the PSDK for additional information. Usually the same flags
  6781. // apply.
  6782. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6783. function RtlMakeSelfRelativeSD(
  6784. pAbsoluteSD : PSECURITY_DESCRIPTOR;
  6785. pSelfRelativeSD : PSECURITY_DESCRIPTOR;
  6786. lpdwBufferLength : LPDWORD
  6787. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6788. // This function is very similar to MapGenericMask() from Advapi32.dll.
  6789. // Refer to the PSDK for additional information. Usually the same flags
  6790. // apply.
  6791. // Documented in the DDK.
  6792. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6793. procedure RtlMapGenericMask(
  6794. AccessMask : PACCESS_MASK;
  6795. GenericMapping : PGENERIC_MAPPING
  6796. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6797. // Maps an error from the security subsystem to a native error status.
  6798. // Compatibility: WXP, 2K3
  6799. function RtlMapSecurityErrorToNtStatus(
  6800. SecurityError : DWORD
  6801. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6802. // Compatibility: W2K, WXP
  6803. function RtlMergeRangeLists(
  6804. MergedRangeList : PRTL_RANGE_LIST;
  6805. RangeList1 : PRTL_RANGE_LIST;
  6806. RangeList2 : PRTL_RANGE_LIST;
  6807. Flags : ULONG
  6808. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6809. // Documented in the DDK.
  6810. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6811. procedure RtlMoveMemory(
  6812. Destination : PVOID;
  6813. Source : PVOID;
  6814. Length : SIZE_T
  6815. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6816. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6817. function RtlNormalizeProcessParams(
  6818. ProcessParameters : PRTL_USER_PROCESS_PARAMETERS
  6819. ): PRTL_USER_PROCESS_PARAMETERS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6820. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6821. function RtlNtStatusToDosError(
  6822. Status : NTSTATUS
  6823. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6824. // Compatibility: WXP, 2K3
  6825. function RtlNtStatusToDosErrorNoTeb(
  6826. Status : NTSTATUS
  6827. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6828. // Documented in the DDK.
  6829. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6830. function RtlNumberOfClearBits(
  6831. BitMapHeader : PRTL_BITMAP
  6832. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6833. // Documented in the DDK.
  6834. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6835. function RtlNumberOfSetBits(
  6836. BitMapHeader : PRTL_BITMAP
  6837. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6838. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6839. function RtlOemStringToUnicodeSize(
  6840. AnsiString : POEM_STRING
  6841. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6842. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6843. function RtlOemStringToUnicodeString(
  6844. DestinationString : PUNICODE_STRING;
  6845. SourceString : POEM_STRING;
  6846. AllocateDestinationString : BOOLEAN
  6847. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6848. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6849. function RtlOemToUnicodeN(
  6850. UnicodeString : PWSTR;
  6851. UnicodeSize : ULONG;
  6852. var ResultSize : ULONG;
  6853. OemString : PCHAR;
  6854. OemSize : ULONG
  6855. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6856. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6857. function RtlOpenCurrentUser(
  6858. samDesired : ACCESS_MASK;
  6859. phkResult : PHKEY
  6860. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6861. // Either raises an exception of type STATUS_RESOURCE_NOT_OWNED or returns
  6862. // a BOOLEAN value.
  6863. // Should perhaps not be called explicitly.
  6864. // Compatibility: WXP, 2K3
  6865. function RtlpNotOwnerCriticalSection(
  6866. lpCriticalSection : PRTL_CRITICAL_SECTION
  6867. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6868. // This is a private wrapper for NtCreateKey().
  6869. // However, 2 of the parameters are not being used!
  6870. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6871. function RtlpNtCreateKey(
  6872. KeyHandle : PHANDLE;
  6873. DesiredAccess : ACCESS_MASK;
  6874. ObjectAttributes : POBJECT_ATTRIBUTES;
  6875. Unused1 : ULONG;
  6876. Unused2 : ULONG;
  6877. Disposition : PULONG
  6878. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6879. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6880. function RtlpNtEnumerateSubKey(
  6881. KeyHandle : HANDLE;
  6882. SubKeyName : PUNICODE_STRING;
  6883. Index : ULONG;
  6884. Unused1 : ULONG
  6885. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6886. // This function is very similar to NtCreateKey() from Ntdll.dll. Usually
  6887. // the same or similar flags apply.
  6888. // This is exactly the same as NtDeleteKey() by now!
  6889. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6890. function RtlpNtMakeTemporaryKey(
  6891. KeyHandle : HANDLE
  6892. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6893. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6894. function RtlpNtOpenKey(
  6895. KeyHandle : HANDLE;
  6896. DesiredAccess : ACCESS_MASK;
  6897. ObjectAttributes : POBJECT_ATTRIBUTES;
  6898. Unused : ULONG
  6899. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6900. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6901. function RtlpNtQueryValueKey(
  6902. KeyHandle : HANDLE;
  6903. Type_ : PULONG;
  6904. Data : PVOID;
  6905. DataSize : PULONG;
  6906. Unused : ULONG
  6907. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6908. // This is a private wrapper for NtSetValueKey().
  6909. // The parameters of TitleIndex and ValueName are not being passed, that is
  6910. // empty.
  6911. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6912. function RtlpNtSetValueKey(
  6913. KeyHandle : HANDLE;
  6914. Type_ : ULONG;
  6915. Data : PVOID;
  6916. DataSize : ULONG
  6917. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6918. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6919. function RtlPrefixString(
  6920. String1 : PANSI_STRING;
  6921. String2 : PANSI_STRING;
  6922. CaseInsensitive : BOOLEAN
  6923. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6924. // Documented in the DDK.
  6925. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6926. function RtlPrefixUnicodeString(
  6927. String1 : PUNICODE_STRING;
  6928. String2 : PUNICODE_STRING;
  6929. CaseInsensitive : BOOLEAN
  6930. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6931. {$IFNDEF JWA_INCLUDEMODE}
  6932. // Compatibility: WXP, 2K3
  6933. function RtlQueryDepthSList(
  6934. ListHead : PSLIST_HEADER
  6935. ): USHORT; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6936. {$ENDIF JWA_INCLUDEMODE}
  6937. // VarValue has to have a buffer assigned big enough to hold the value.
  6938. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6939. function RtlQueryEnvironmentVariable_U(
  6940. Environment : PVOID;
  6941. VarName : PUNICODE_STRING;
  6942. VarValue : PUNICODE_STRING
  6943. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6944. // This function is very similar to GetAclInformation() from Advapi32.dll.
  6945. // Refer to the PSDK for additional information. Usually the same flags
  6946. // apply.
  6947. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6948. function RtlQueryInformationAcl(
  6949. pAcl : PACL;
  6950. pAclInformation : PVOID;
  6951. nAclInformationLength : DWORD;
  6952. dwAclInformationClass : ACL_INFORMATION_CLASS
  6953. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6954. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6955. function RtlQueryProcessDebugInformation(
  6956. ProcessId : ULONG;
  6957. DebugInfoClassMask : ULONG;
  6958. DebugBuffer : PDEBUG_BUFFER
  6959. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6960. // Documented in the DDK.
  6961. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6962. function RtlQueryRegistryValues(
  6963. RelativeTo : ULONG;
  6964. Path : LPCWSTR;
  6965. QueryTable : PRTL_QUERY_REGISTRY_TABLE;
  6966. Context : PVOID;
  6967. Environment : PVOID
  6968. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6969. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6970. procedure RtlRaiseStatus(
  6971. Status : NTSTATUS
  6972. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6973. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6974. function RtlRandom(
  6975. Seed : PULONG
  6976. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6977. // Compatibility: WXP, 2K3
  6978. function RtlRandomEx(
  6979. Seed : PULONG
  6980. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6981. // The function HeapReAlloc() from Kernel32.dll is an export forwarder to
  6982. // this function. This means you can refer to the documentation of
  6983. // HeapReAlloc()!
  6984. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6985. function RtlReAllocateHeap(
  6986. hHeap : HANDLE;
  6987. dwFlags : ULONG;
  6988. lpMem : PVOID;
  6989. dwBytes : SIZE_T
  6990. ): PVOID; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6991. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  6992. procedure RtlReleasePebLock(); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6993. // Compatibility: WXP, 2K3
  6994. function RtlRemoveVectoredExceptionHandler(
  6995. VectoredHandlerHandle : PVOID
  6996. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  6997. // Compatibility: WXP, 2K3
  6998. procedure RtlRestoreLastWin32Error(
  6999. dwErrCode : DWORD
  7000. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7001. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7002. procedure RtlRunDecodeUnicodeString(
  7003. CodeSeed : UCHAR;
  7004. StringToDecode : PUNICODE_STRING
  7005. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7006. // If CodeSeed == 0 it will be assigned a value by the function. Use this
  7007. // very value in a call to RtlRunDecodeUnicodeString()! To decode the
  7008. // string afterwards.
  7009. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7010. procedure RtlRunEncodeUnicodeString(
  7011. var CodeSeed : UCHAR;
  7012. StringToEncode : PUNICODE_STRING
  7013. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7014. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7015. procedure RtlSecondsSince1970ToTime(
  7016. SecondsSince1970 : ULONG;
  7017. Time : PLARGE_INTEGER
  7018. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7019. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7020. procedure RtlSecondsSince1980ToTime(
  7021. SecondsSince1980 : ULONG;
  7022. Time : PLARGE_INTEGER
  7023. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7024. // This function is very similar to MakeAbsoluteSD() from Advapi32.dll.
  7025. // Refer to the PSDK for additional information. Usually the same flags
  7026. // apply.
  7027. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7028. function RtlSelfRelativeToAbsoluteSD(
  7029. pSelfRelativeSD : PSECURITY_DESCRIPTOR;
  7030. pAbsoluteSD : PSECURITY_DESCRIPTOR;
  7031. lpdwAbsoluteSDSize : LPDWORD;
  7032. pDacl : PACL;
  7033. lpdwDaclSize : LPDWORD;
  7034. pSacl : PACL;
  7035. lpdwSaclSize : LPDWORD;
  7036. pOwner : PSID;
  7037. lpdwOwnerSize : LPDWORD;
  7038. pPrimaryGroup : PSID;
  7039. lpdwPrimaryGroupSize : LPDWORD
  7040. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7041. // Documented in the DDK.
  7042. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7043. procedure RtlSetAllBits(
  7044. BitMapHeader : PRTL_BITMAP
  7045. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7046. // Documented in the DDK.
  7047. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7048. procedure RtlSetBits(
  7049. BitMapHeader : PRTL_BITMAP;
  7050. StartingIndex : ULONG;
  7051. NumberToSet : ULONG
  7052. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7053. // This function is very similar to SetSecurityDescriptorControl() from
  7054. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  7055. // same flags apply.
  7056. // Compatibility: W2K, WXP, 2K3
  7057. function RtlSetControlSecurityDescriptor(
  7058. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  7059. ControlBitsOfInterest : SECURITY_DESCRIPTOR_CONTROL;
  7060. ControlBitsToSet : SECURITY_DESCRIPTOR_CONTROL
  7061. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7062. // The function SetCriticalSectionSpinCount() from Kernel32.dll is an
  7063. // export forwarder to this function. This means you can refer to the
  7064. // documentation of SetCriticalSectionSpinCount()!
  7065. // Compatibility: NT4, W2K, WXP, 2K3
  7066. function RtlSetCriticalSectionSpinCount(
  7067. lpCriticalSection : PRTL_CRITICAL_SECTION;
  7068. dwSpinCount : ULONG
  7069. ): DWORD; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7070. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7071. function RtlSetCurrentDirectory_U(
  7072. NewCurrentDirectory : PUNICODE_STRING
  7073. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7074. // Documented in the DDK.
  7075. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7076. function RtlSetDaclSecurityDescriptor(
  7077. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  7078. DaclPresent : BOOLEAN;
  7079. Dacl : PACL;
  7080. DaclDefaulted : BOOLEAN
  7081. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7082. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7083. function RtlSetGroupSecurityDescriptor(
  7084. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  7085. pGroup : PSID;
  7086. bGroupDefaulted : BOOLEAN
  7087. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7088. // This function is very similar to SetAclInformation() from Advapi32.dll.
  7089. // Refer to the PSDK for additional information. Usually the same flags
  7090. // apply.
  7091. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7092. function RtlSetInformationAcl(
  7093. pAcl : PACL;
  7094. pAclInformation : PVOID;
  7095. nInformationLength : DWORD;
  7096. dwAclInformationClass : ACL_INFORMATION_CLASS
  7097. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7098. // Compatibility: WXP, 2K3
  7099. function RtlSetLastWin32ErrorAndNtStatusFromNtStatus(
  7100. Status : NTSTATUS
  7101. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7102. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7103. function RtlSetOwnerSecurityDescriptor(
  7104. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  7105. pOwner : PSID;
  7106. bOwnerDefaulted : BOOLEAN
  7107. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7108. // Compatibility: WXP, 2K3
  7109. function RtlSetProcessIsCritical(
  7110. bIsCritical : BOOLEAN;
  7111. pbOldIsCriticalValue : PBOOLEAN;
  7112. bUnknownCanBeFalse : BOOLEAN
  7113. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7114. // This function is very similar to SetSecurityDescriptorSacl() from
  7115. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  7116. // same flags apply.
  7117. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7118. function RtlSetSaclSecurityDescriptor(
  7119. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  7120. bSaclPresent : BOOLEAN;
  7121. pSacl : PACL;
  7122. SaclDefaulted : BOOLEAN
  7123. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7124. // Compatibility: WXP, 2K3
  7125. function RtlSetThreadIsCritical(
  7126. bIsCritical : BOOLEAN;
  7127. pbOldIsCriticalValue : PBOOLEAN;
  7128. bUnknownCanBeFalse : BOOLEAN
  7129. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7130. // The function HeapSize() from Kernel32.dll is an export forwarder to this
  7131. // function. This means you can refer to the documentation of HeapSize()!
  7132. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7133. function RtlSizeHeap(
  7134. hHeap : HANDLE;
  7135. dwFlags : ULONG;
  7136. lpMem : PVOID
  7137. ): SIZE_T; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7138. // Documented in the DDK.
  7139. // Compatibility: W2K, WXP, 2K3
  7140. function RtlStringFromGUID(
  7141. Guid : REFGUID;
  7142. GuidString : PUNICODE_STRING
  7143. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7144. // This function is very similar to GetSidSubAuthorityCount() from
  7145. // Advapi32.dll. Refer to the PSDK for additional information. Usually the
  7146. // same flags apply.
  7147. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7148. function RtlSubAuthorityCountSid(
  7149. pSid : PSID
  7150. ): PUCHAR; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7151. // This function is very similar to GetSidSubAuthority() from Advapi32.dll.
  7152. // Refer to the PSDK for additional information. Usually the same flags
  7153. // apply.
  7154. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7155. function RtlSubAuthoritySid(
  7156. pSid : PSID;
  7157. nSubAuthority : DWORD
  7158. ): PDWORD; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7159. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7160. function RtlSystemTimeToLocalTime(
  7161. SystemTime : PLARGE_INTEGER;
  7162. LocalTime : PLARGE_INTEGER
  7163. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7164. // Documented in the DDK.
  7165. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7166. function RtlTimeFieldsToTime(
  7167. TimeFields : PTIME_FIELDS;
  7168. Time : PLARGE_INTEGER
  7169. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7170. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7171. procedure RtlTimeToElapsedTimeFields(
  7172. Time : PLARGE_INTEGER;
  7173. TimeFields : PTIME_FIELDS
  7174. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7175. {$IFNDEF JWA_INCLUDEMODE}
  7176. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7177. function RtlTimeToSecondsSince1970(
  7178. Time : PLARGE_INTEGER;
  7179. ElapsedSeconds : PULONG
  7180. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7181. {$ENDIF JWA_INCLUDEMODE}
  7182. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7183. function RtlTimeToSecondsSince1980(
  7184. Time : PLARGE_INTEGER;
  7185. ElapsedSeconds : PULONG
  7186. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7187. // Documented in the DDK.
  7188. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7189. procedure RtlTimeToTimeFields(
  7190. Time : PLARGE_INTEGER;
  7191. TimeFields : PTIME_FIELDS
  7192. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7193. // The function TryEnterCriticalSection() from Kernel32.dll is an export
  7194. // forwarder to this function. This means you can refer to the
  7195. // documentation of TryEnterCriticalSection()!
  7196. // Compatibility: NT4, W2K, WXP, 2K3
  7197. function RtlTryEnterCriticalSection(
  7198. lpCriticalSection : PRTL_CRITICAL_SECTION
  7199. ): BOOL; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7200. // Documented in the DDK.
  7201. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7202. function RtlUnicodeStringToAnsiSize(
  7203. UnicodeString : PUNICODE_STRING
  7204. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7205. // Documented in the DDK.
  7206. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7207. {$IFNDEF JWA_INCLUDEMODE}
  7208. function RtlUnicodeStringToAnsiString(
  7209. DestinationString : PANSI_STRING;
  7210. SourceString : PUNICODE_STRING;
  7211. AllocateDestinationString : BOOLEAN
  7212. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7213. {$ENDIF JWA_INCLUDEMODE}
  7214. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7215. function RtlUnicodeStringToCountedOemString(
  7216. DestinationString : POEM_STRING;
  7217. SourceString : PUNICODE_STRING;
  7218. AllocateDestinationString : BOOLEAN
  7219. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7220. // Documented in the DDK.
  7221. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7222. function RtlUnicodeStringToInteger(
  7223. Str : PUNICODE_STRING;
  7224. Base : ULONG;
  7225. Value : PULONG
  7226. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7227. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7228. function RtlUnicodeStringToOemSize(
  7229. UnicodeString : PUNICODE_STRING
  7230. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7231. {$IFNDEF JWA_INCLUDEMODE}
  7232. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7233. function RtlUnicodeStringToOemString(
  7234. DestinationString : POEM_STRING;
  7235. SourceString : PCUNICODE_STRING;
  7236. AllocateDestinationString : BOOLEAN
  7237. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7238. {$ENDIF JWA_INCLUDEMODE}
  7239. {$IFNDEF JWA_INCLUDEMODE}
  7240. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7241. function RtlUnicodeToMultiByteSize(
  7242. BytesInMultiByteString : PULONG;
  7243. UnicodeString : PWSTR;
  7244. BytesInUnicodeString : ULONG
  7245. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7246. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7247. function RtlUniform(
  7248. Seed : PULONG
  7249. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7250. {$ENDIF JWA_INCLUDEMODE}
  7251. // The function RtlUnwind() from Kernel32.dll is an export forwarder to
  7252. // this function. This means you can refer to the documentation of
  7253. // RtlUnwind()!
  7254. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7255. procedure RtlUnwind(
  7256. TargetFrame : PVOID;
  7257. TargetIp : PVOID;
  7258. ExceptionRecord : PEXCEPTION_RECORD;
  7259. ReturnValue : PVOID
  7260. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7261. // Documented in the DDK.
  7262. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7263. function RtlUpcaseUnicodeChar(
  7264. SourceCharacter : WCHAR
  7265. ): WCHAR; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7266. // Documented in the DDK.
  7267. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7268. function RtlUpcaseUnicodeString(
  7269. DestinationString : PUNICODE_STRING;
  7270. SourceString : PUNICODE_STRING;
  7271. AllocateDestinationString : BOOLEAN
  7272. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7273. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7274. function RtlUpcaseUnicodeStringToAnsiString(
  7275. DestinationString : PSTRING;
  7276. SourceString : PUNICODE_STRING;
  7277. AllocateDestinationString : BOOLEAN
  7278. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7279. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7280. function RtlUpcaseUnicodeStringToCountedOemString(
  7281. DestinationString : PSTRING;
  7282. SourceString : PUNICODE_STRING;
  7283. AllocateDestinationString : BOOLEAN
  7284. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7285. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7286. function RtlUpcaseUnicodeStringToOemString(
  7287. DestinationString : PSTRING;
  7288. SourceString : PUNICODE_STRING;
  7289. AllocateDestinationString : BOOLEAN
  7290. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7291. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7292. function RtlUpcaseUnicodeToMultiByteN(
  7293. MbString : PCHAR;
  7294. MbSize : ULONG;
  7295. var ResultSize : ULONG;
  7296. UnicodeString : PWSTR;
  7297. UnicodeSize : ULONG
  7298. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7299. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7300. function RtlUpcaseUnicodeToOemN(
  7301. OemString : PCHAR;
  7302. OemSize : ULONG;
  7303. var ResultSize : ULONG;
  7304. UnicodeString : PWSTR;
  7305. UnicodeSize : ULONG
  7306. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7307. // Documented in the DDK.
  7308. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7309. function RtlUpperChar(
  7310. Character : CHAR
  7311. ): CHAR; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7312. // Documented in the DDK.
  7313. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7314. procedure RtlUpperString(
  7315. DestinationString : PSTRING;
  7316. SourceString : PSTRING
  7317. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7318. // #->REVIEW NUMBER OF PARAMETERS
  7319. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7320. function RtlValidAcl(
  7321. Acl : PACL
  7322. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7323. // This function is very similar to HeapValidate() from Kernel32.dll. Refer
  7324. // to the PSDK for additional information. Usually the same flags apply.
  7325. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7326. function RtlValidateHeap(
  7327. hHeap : HANDLE;
  7328. dwFlags : ULONG;
  7329. lpMem : LPCVOID
  7330. ): BOOL; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7331. // Compatibility: WXP, 2K3
  7332. function RtlValidateUnicodeString(
  7333. dwMustBeNull : ULONG;
  7334. ValidateThis : PUNICODE_STRING
  7335. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7336. // Compatibility: W2K, WXP, 2K3
  7337. function RtlValidRelativeSecurityDescriptor(
  7338. SecurityDescriptorInput : PSECURITY_DESCRIPTOR;
  7339. SecurityDescriptorLength : ULONG;
  7340. RequiredInformation : SECURITY_INFORMATION
  7341. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7342. // Documented in the DDK.
  7343. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7344. function RtlValidSecurityDescriptor(
  7345. SecurityDescriptor : PSECURITY_DESCRIPTOR
  7346. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7347. // #->REVIEW NUMBER OF PARAMETERS; XREF: see IsValidSid()!
  7348. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7349. function RtlValidSid(
  7350. pSid : PSID
  7351. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7352. // Documented in the DDK.
  7353. // Compatibility: W2K, WXP, 2K3
  7354. function RtlVerifyVersionInfo(
  7355. VersionInfo : PRTL_OSVERSIONINFOEXW;
  7356. TypeMask : ULONG;
  7357. ConditionMask : ULONGLONG
  7358. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7359. // Documented in the DDK.
  7360. function RtlVolumeDeviceToDosName(
  7361. VolumeDeviceObject : PVOID;
  7362. DosName : PUNICODE_STRING
  7363. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7364. // Documented in the DDK.
  7365. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7366. function RtlWriteRegistryValue(
  7367. RelativeTo : ULONG;
  7368. Path : LPCWSTR;
  7369. ValueName : LPCWSTR;
  7370. ValueType : ULONG;
  7371. ValueData : PVOID;
  7372. ValueLength : ULONG
  7373. ): NTSTATUS; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7374. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7375. function RtlxAnsiStringToUnicodeSize(
  7376. AnsiString : PANSI_STRING
  7377. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7378. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7379. function RtlxOemStringToUnicodeSize(
  7380. AnsiString : POEM_STRING
  7381. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7382. // Documented in the DDK.
  7383. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7384. function RtlxUnicodeStringToAnsiSize(
  7385. UnicodeString : PUNICODE_STRING
  7386. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7387. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7388. function RtlxUnicodeStringToOemSize(
  7389. UnicodeString : PUNICODE_STRING
  7390. ): ULONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7391. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7392. function RtlZeroHeap(
  7393. hHeap : HANDLE;
  7394. dwFlags : ULONG
  7395. ): BOOLEAN; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7396. // Documented in the DDK.
  7397. // Compatibility: NT3, NT4, W2K, WXP, 2K3
  7398. procedure RtlZeroMemory(
  7399. Destination : PVOID;
  7400. Length : SIZE_T
  7401. ); stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7402. {$IFNDEF JWA_INCLUDEMODE}
  7403. // This function is very similar to VerSetConditionMask() from
  7404. // Kernel32.dll. Refer to the PSDK for additional information. Usually the
  7405. // same flags apply.
  7406. // Compatibility: W2K, WXP, 2K3
  7407. function VerSetConditionMask(
  7408. ConditionMask : ULONGLONG;
  7409. dwTypeMask : DWORD;
  7410. Condition : BYTE
  7411. ): ULONGLONG; stdcall; {$IFNDEF RTDL}external ntdll;{$ENDIF}
  7412. {$ENDIF JWA_INCLUDEMODE}
  7413. //// 810 automatically created prototype entries.
  7414. //// END : Function prototypes
  7415. {$ENDIF JWA_IMPLEMENTATIONSECTION}
  7416. {$IFNDEF JWA_OMIT_SECTIONS}
  7417. implementation
  7418. {$ENDIF JWA_OMIT_SECTIONS}
  7419. {$IFNDEF JWA_INTERFACESECTION}
  7420. // This function is actually declared as a macro defined as memcpy()
  7421. procedure RtlCopyMemory(Destination: PVOID; Source: PVOID; Length: SIZE_T); stdcall;
  7422. begin
  7423. Move(Source^, Destination^, Length);
  7424. end;
  7425. // Own function to retrieve the process's heap handle
  7426. function NtpGetProcessHeap(): HANDLE;
  7427. asm
  7428. {$ifdef CPU386}
  7429. mov EAX, FS:[018h] // EAX now holds the TEB address
  7430. mov EAX, [EAX+030h] // TEB+$30 holds the PEB address
  7431. mov EAX, DWORD PTR [EAX+018h] // PEB+$30 holds the ProcessHeap's handle
  7432. {$endif}
  7433. {$ifdef cpux86_64}
  7434. mov RAX, GS:[48] // EAX now holds the TEB address
  7435. mov RAX, [RAX+060h] // TEB+$30 holds the PEB address
  7436. mov RAX, DWORD PTR [RAX+48] // PEB+$30 holds the ProcessHeap's handle
  7437. {$endif cpux86_64}
  7438. end;
  7439. // Own function to retrieve the thread environment block (TEB) pointer
  7440. function NtpCurrentTeb(): PTEB;
  7441. asm
  7442. {$ifdef cpu386}
  7443. mov EAX, FS:[018h]
  7444. {$endif cpu386}
  7445. {$ifdef cpux86_64}
  7446. mov RAX, GS:[48]
  7447. {$endif cpux86_64}
  7448. end;
  7449. // Own function to retrieve the process environment block (PEB) pointer
  7450. function RtlpGetCurrentPeb(): PPEB;
  7451. asm
  7452. {$ifdef cpu386}
  7453. mov EAX, FS:[018h]
  7454. mov EAX, [EAX+030h]
  7455. {$endif cpu386}
  7456. {$ifdef cpux86_64}
  7457. mov RAX, GS:[24]
  7458. mov RAX, [RAX+060h]
  7459. {$endif cpux86_64}
  7460. end;
  7461. (* Own function to swap bytes in 16bit values
  7462. The RtlUshortByteSwap routine converts a USHORT from
  7463. little-endian to big-endian, and vice versa. *)
  7464. function RtlUshortByteSwap(Source: USHORT): USHORT;
  7465. asm
  7466. {$ifdef cpux86_64}
  7467. mov CX, AX
  7468. {$endif cpux86_64}
  7469. rol AX, 08h
  7470. end;
  7471. (* Own function to swap bytes in 32bit values
  7472. The RtlUlongByteSwap routine converts a ULONG from little-endian to
  7473. big-endian, and vice versa. *)
  7474. function RtlUlongByteSwap(Source: ULONG): ULONG;
  7475. asm
  7476. {$ifndef FPC}
  7477. // This is not written as mnemonics to be compatible with D4!
  7478. db 0Fh, 0C8h // "bswap EAX" can only be executed on 486+!!!
  7479. {$else}
  7480. {$ifdef cpux86_64}
  7481. mov ECX, EAX
  7482. {$endif cpux86_64}
  7483. bswap EAX // .. but bswap EAX is also 64-bit!!! 0F C8 isn't.
  7484. {$endif}
  7485. (*
  7486. // Does the same but perhaps slower ...
  7487. // Source = $11223344
  7488. rol AX, 08h // Source = $11224433
  7489. rol EAX, 0Fh // Source = $44331122
  7490. rol AX, 08h // Source = $44332211
  7491. *)
  7492. end;
  7493. (* Own function to swap bytes in 64bit values
  7494. The RtlUlonglongByteSwap routine converts a ULONGLONG from
  7495. little-endian to big-endian, and vice versa. *)
  7496. function RtlUlonglongByteSwap(Source: ULONGLONG): ULONGLONG;
  7497. asm
  7498. {$ifdef cpu386}
  7499. mov EAX, [ESP+0Ch] // Get the high part of the ULONGLONG into EAX
  7500. mov EDX, [ESP+08h] // Get the low part of the ULONGLONG into EDX
  7501. // This is not written as mnemonics to be compatible with D4!
  7502. db 0Fh, 0C8h // "bswap EAX" can only be executed on 486+!!!
  7503. db 0Fh, 0CAh // "bswap EDX" can only be executed on 486+!!!
  7504. // High part returns in EDX, low part in EAX
  7505. {$endif}
  7506. {$ifdef cpux86_64}
  7507. MOV RCX,RAX
  7508. BSWAP EAX
  7509. {$endif cpux86_64}
  7510. end;
  7511. // Resembles the RtlValidateUnicodeString() function available from Windows XP
  7512. // on exactly as it is on this OS version, except for the calling convention.
  7513. function RtlpValidateUnicodeString(dwMustBeNull: DWORD; UnicodeString: PUNICODE_STRING): NTSTATUS;
  7514. begin
  7515. result := STATUS_INVALID_PARAMETER;
  7516. if (dwMustBeNull = 0) then
  7517. begin
  7518. result := STATUS_SUCCESS;
  7519. if (Assigned(UnicodeString)) then
  7520. begin
  7521. result := STATUS_INVALID_PARAMETER;
  7522. if ((UnicodeString^.Length mod 2 = 0) and (UnicodeString^.MaximumLength mod 2 = 0) and (UnicodeString^.Length <= UnicodeString^.MaximumLength)) then
  7523. if ((UnicodeString^.Length > 0) and (UnicodeString^.MaximumLength > 0)) then
  7524. if (Assigned(UnicodeString^.Buffer)) then
  7525. result := STATUS_SUCCESS;
  7526. end;
  7527. end;
  7528. end;
  7529. // Resembles the RtlValidateUnicodeString() function available from Windows XP
  7530. // on, but does not require the first parameter which anyway must be zero.
  7531. function RtlpValidateUnicodeString2(UnicodeString: PUNICODE_STRING): NTSTATUS;
  7532. begin
  7533. result := STATUS_SUCCESS;
  7534. if (Assigned(UnicodeString)) then
  7535. begin
  7536. result := STATUS_INVALID_PARAMETER;
  7537. if ((UnicodeString^.Length mod 2 = 0) and (UnicodeString^.MaximumLength mod 2 = 0) and (UnicodeString^.Length <= UnicodeString^.MaximumLength)) then
  7538. if ((UnicodeString^.Length > 0) and (UnicodeString^.MaximumLength > 0)) then
  7539. if (Assigned(UnicodeString^.Buffer)) then
  7540. result := STATUS_SUCCESS;
  7541. end;
  7542. end;
  7543. {$IFDEF RTDL}
  7544. /// Function types
  7545. type
  7546. TFNCsrGetProcessId = function (): DWORD; stdcall;
  7547. TFNDbgQueryDebugFilterState = function (ComponentId: ULONG; Level: ULONG): NTSTATUS; stdcall;
  7548. TFNDbgSetDebugFilterState = function (ComponentId: ULONG; Level: ULONG; State: BOOLEAN): NTSTATUS; stdcall;
  7549. TFNKiRaiseUserExceptionDispatcher = function (): ULONG; stdcall;
  7550. TFNLdrAccessResource = function (hModule: HANDLE; ResourceDataEntry: PIMAGE_RESOURCE_DATA_ENTRY; Address: PPVOID; dwSize: PULONG): NTSTATUS; stdcall;
  7551. TFNLdrAlternateResourcesEnabled = function (): BOOLEAN; stdcall;
  7552. TFNLdrDisableThreadCalloutsForDll = function (hModule: HANDLE): NTSTATUS; stdcall;
  7553. TFNLdrGetDllHandle = function (pwPath: PWORD; pReserved: PVOID; pusPath: PUNICODE_STRING; var phModule: HANDLE): NTSTATUS; stdcall;
  7554. TFNLdrGetProcedureAddress = function (hModule: HANDLE; dwOrdinal: ULONG; psName: PSTRING; var pProcedure: PVOID): NTSTATUS; stdcall;
  7555. TFNLdrLoadDll = function (pwPath: PWORD; pdwFlags: PDWORD; pusPath: PUNICODE_STRING; var phModule: HANDLE): NTSTATUS; stdcall;
  7556. TFNLdrQueryImageFileExecutionOptions = function (pusImagePath: PUNICODE_STRING; pwOptionName: PWORD; dwRequestedType: DWORD; pData: PVOID; dwSize: DWORD; pdwSize: PDWORD): NTSTATUS; stdcall;
  7557. TFNLdrQueryProcessModuleInformation = function (psmi: PSYSTEM_MODULE_INFORMATION; dwSize: DWORD; pdwSize: PDWORD): NTSTATUS; stdcall;
  7558. TFNLdrShutdownProcess = procedure(); stdcall;
  7559. TFNLdrShutdownThread = procedure(); stdcall;
  7560. TFNLdrUnloadDll = function (hModule: HANDLE): NTSTATUS; stdcall;
  7561. TFNNtAcceptConnectPort = function (PortHandle: PHANDLE; PortIdentifier: ULONG; Message: PPORT_MESSAGE; Accept: BOOLEAN; WriteSection: PPORT_SECTION_WRITE; ReadSection: PPORT_SECTION_READ): NTSTATUS; stdcall;
  7562. TFNNtAccessCheck = function (SecurityDescriptor: PSECURITY_DESCRIPTOR; TokenHandle: HANDLE; DesiredAccess: ACCESS_MASK; GenericMapping: PGENERIC_MAPPING; PrivilegeSet: PPRIVILEGE_SET; PrivilegeSetLength: PULONG;
  7563. GrantedAccess: PACCESS_MASK; AccessStatus: PBOOLEAN): NTSTATUS; stdcall;
  7564. TFNNtAccessCheckAndAuditAlarm = function (SubsystemName: PUNICODE_STRING; HandleId: PVOID; ObjectTypeName: PUNICODE_STRING; ObjectName: PUNICODE_STRING; SecurityDescriptor: PSECURITY_DESCRIPTOR; DesiredAccess: ACCESS_MASK;
  7565. GenericMapping: PGENERIC_MAPPING; ObjectCreation: BOOLEAN; GrantedAccess: PACCESS_MASK; AccessStatus: PBOOLEAN; GenerateOnClose: PBOOLEAN): NTSTATUS; stdcall;
  7566. TFNNtAccessCheckByType = function (SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID; TokenHandle: HANDLE; DesiredAccess: ACCESS_MASK; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: ULONG;
  7567. GenericMapping: PGENERIC_MAPPING; PrivilegeSet: PPRIVILEGE_SET; PrivilegeSetLength: PULONG; GrantedAccess: PACCESS_MASK; AccessStatus: PULONG): NTSTATUS; stdcall;
  7568. TFNNtAccessCheckByTypeAndAuditAlarm = function (SubsystemName: PUNICODE_STRING; HandleId: PVOID; ObjectTypeName: PUNICODE_STRING; ObjectName: PUNICODE_STRING; SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID;
  7569. DesiredAccess: ACCESS_MASK; AuditType: AUDIT_EVENT_TYPE; Flags: ULONG; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: ULONG; GenericMapping: PGENERIC_MAPPING; ObjectCreation: BOOLEAN; GrantedAccess: PACCESS_MASK;
  7570. AccessStatus: PULONG; GenerateOnClose: PBOOLEAN): NTSTATUS; stdcall;
  7571. TFNNtAccessCheckByTypeResultList = function (SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID; TokenHandle: HANDLE; DesiredAccess: ACCESS_MASK; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: ULONG;
  7572. GenericMapping: PGENERIC_MAPPING; PrivilegeSet: PPRIVILEGE_SET; PrivilegeSetLength: PULONG; GrantedAccessList: PACCESS_MASK; AccessStatusList: PULONG): NTSTATUS; stdcall;
  7573. TFNNtAccessCheckByTypeResultListAndAuditAlarm = function (SubsystemName: PUNICODE_STRING; HandleId: PVOID; ObjectTypeName: PUNICODE_STRING; ObjectName: PUNICODE_STRING; SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID;
  7574. DesiredAccess: ACCESS_MASK; AuditType: AUDIT_EVENT_TYPE; Flags: ULONG; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: ULONG; GenericMapping: PGENERIC_MAPPING; ObjectCreation: BOOLEAN; GrantedAccessList: PACCESS_MASK;
  7575. AccessStatusList: PULONG; GenerateOnClose: PULONG): NTSTATUS; stdcall;
  7576. TFNNtAccessCheckByTypeResultListAndAuditAlarmByHandle = function (SubsystemName: PUNICODE_STRING; HandleId: PVOID; TokenHandle: HANDLE; ObjectTypeName: PUNICODE_STRING; ObjectName: PUNICODE_STRING;
  7577. SecurityDescriptor: PSECURITY_DESCRIPTOR; PrincipalSelfSid: PSID; DesiredAccess: ACCESS_MASK; AuditType: AUDIT_EVENT_TYPE; Flags: ULONG; ObjectTypeList: POBJECT_TYPE_LIST; ObjectTypeListLength: ULONG; GenericMapping: PGENERIC_MAPPING;
  7578. ObjectCreation: BOOLEAN; GrantedAccessList: PACCESS_MASK; AccessStatusList: PULONG; GenerateOnClose: PULONG): NTSTATUS; stdcall;
  7579. TFNNtAddAtom = function (Str: PWSTR; StringLength: ULONG; Atom: PUSHORT): NTSTATUS; stdcall;
  7580. TFNNtAdjustGroupsToken = function (TokenHandle: HANDLE; ResetToDefault: BOOLEAN; NewState: PTOKEN_GROUPS; BufferLength: ULONG; PreviousState: PTOKEN_GROUPS; ReturnLength: PULONG): NTSTATUS; stdcall;
  7581. TFNNtAdjustPrivilegesToken = function (TokenHandle: HANDLE; DisableAllPrivileges: BOOLEAN; NewState: PTOKEN_PRIVILEGES; BufferLength: ULONG; PreviousState: PTOKEN_PRIVILEGES; ReturnLength: PULONG): NTSTATUS; stdcall;
  7582. TFNNtAlertResumeThread = function (ThreadHandle: HANDLE; PreviousSuspendCount: PULONG): NTSTATUS; stdcall;
  7583. TFNNtAlertThread = function (ThreadHandle: HANDLE): NTSTATUS; stdcall;
  7584. TFNNtAllocateLocallyUniqueId = function (Luid: PLUID): NTSTATUS; stdcall;
  7585. TFNNtAllocateUserPhysicalPages = function (ProcessHandle: HANDLE; NumberOfPages: PULONG; PageFrameNumbers: PULONG): NTSTATUS; stdcall;
  7586. TFNNtAllocateUuids = function (UuidLastTimeAllocated: PLARGE_INTEGER; UuidDeltaTime: PULONG; UuidSequenceNumber: PULONG; UuidSeed: PUCHAR): NTSTATUS; stdcall;
  7587. TFNNtAllocateVirtualMemory = function (ProcessHandle: HANDLE; BaseAddress: PPVOID; ZeroBits: ULONG; AllocationSize: PULONG; AllocationType: ULONG; Protect: ULONG): NTSTATUS; stdcall;
  7588. TFNNtAreMappedFilesTheSame = function (Address1: PVOID; Address2: PVOID): NTSTATUS; stdcall;
  7589. TFNNtAssignProcessToJobObject = function (JobHandle: HANDLE; ProcessHandle: HANDLE): NTSTATUS; stdcall;
  7590. TFNNtCallbackReturn = function (Result_: PVOID; ResultLength: ULONG; Status: NTSTATUS): NTSTATUS; stdcall;
  7591. TFNNtCancelDeviceWakeupRequest = function (DeviceHandle: HANDLE): NTSTATUS; stdcall;
  7592. TFNNtCancelIoFile = function (FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK): NTSTATUS; stdcall;
  7593. TFNNtCancelTimer = function (TimerHandle: HANDLE; PreviousState: PBOOLEAN): NTSTATUS; stdcall;
  7594. TFNNtClearEvent = function (EventHandle: HANDLE): NTSTATUS; stdcall;
  7595. TFNNtClose = function (Handle: HANDLE): NTSTATUS; stdcall;
  7596. TFNNtCloseObjectAuditAlarm = function (SubsystemName: PUNICODE_STRING; HandleId: PVOID; GenerateOnClose: BOOLEAN): NTSTATUS; stdcall;
  7597. TFNNtCompleteConnectPort = function (PortHandle: HANDLE): NTSTATUS; stdcall;
  7598. TFNNtConnectPort = function (PortHandle: PHANDLE; PortName: PUNICODE_STRING; SecurityQos: PSECURITY_QUALITY_OF_SERVICE; WriteSection: PPORT_SECTION_WRITE; ReadSection: PPORT_SECTION_READ; MaxMessageSize: PULONG; ConnectData: PVOID;
  7599. ConnectDataLength: PULONG): NTSTATUS; stdcall;
  7600. TFNNtContinue = function (Context: PCONTEXT; TestAlert: BOOLEAN): NTSTATUS; stdcall;
  7601. TFNNtCreateChannel = function (ChannelHandle: PHANDLE; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7602. TFNNtCreateDirectoryObject = function (DirectoryHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7603. TFNNtCreateEvent = function (EventHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; EventType: EVENT_TYPE; InitialState: BOOLEAN): NTSTATUS; stdcall;
  7604. TFNNtCreateEventPair = function (EventPairHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7605. TFNNtCreateFile = function (FileHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; IoStatusBlock: PIO_STATUS_BLOCK; AllocationSize: PLARGE_INTEGER; FileAttributes: ULONG; ShareAccess: ULONG;
  7606. CreateDisposition: ULONG; CreateOptions: ULONG; EaBuffer: PVOID; EaLength: ULONG): NTSTATUS; stdcall;
  7607. TFNNtCreateIoCompletion = function (IoCompletionHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; NumberOfConcurrentThreads: ULONG): NTSTATUS; stdcall;
  7608. TFNNtCreateJobObject = function (JobHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7609. TFNNtCreateKey = function (KeyHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; TitleIndex: ULONG; Class_: PUNICODE_STRING; CreateOptions: ULONG; Disposition: PULONG): NTSTATUS; stdcall;
  7610. TFNNtCreateMailslotFile = function (FileHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; IoStatusBlock: PIO_STATUS_BLOCK; CreateOptions: ULONG; Unknown: ULONG; MaxMessageSize: ULONG;
  7611. ReadTimeout: PLARGE_INTEGER): NTSTATUS; stdcall;
  7612. TFNNtCreateMutant = function (MutantHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; InitialOwner: BOOLEAN): NTSTATUS; stdcall;
  7613. TFNNtCreateNamedPipeFile = function (FileHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; IoStatusBlock: PIO_STATUS_BLOCK; ShareAccess: ULONG; CreateDisposition: ULONG; CreateOptions: ULONG;
  7614. TypeMessage: BOOLEAN; ReadmodeMessage: BOOLEAN; Nonblocking: BOOLEAN; MaxInstances: ULONG; InBufferSize: ULONG; OutBufferSize: ULONG; DefaultTimeout: PLARGE_INTEGER): NTSTATUS; stdcall;
  7615. TFNNtCreatePagingFile = function (FileName: PUNICODE_STRING; InitialSize: PULARGE_INTEGER; MaximumSize: PULARGE_INTEGER; Reserved: ULONG): NTSTATUS; stdcall;
  7616. TFNNtCreatePort = function (PortHandle: PHANDLE; ObjectAttributes: POBJECT_ATTRIBUTES; MaxDataSize: ULONG; MaxMessageSize: ULONG; Reserved: ULONG): NTSTATUS; stdcall;
  7617. TFNNtCreateProcess = function (ProcessHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; InheritFromProcessHandle: HANDLE; InheritHandles: BOOLEAN; SectionHandle: HANDLE; DebugPort: HANDLE;
  7618. ExceptionPort: HANDLE): NTSTATUS; stdcall;
  7619. TFNNtCreateProfile = function (ProfileHandle: PHANDLE; ProcessHandle: HANDLE; Base: PVOID; Size: ULONG; BucketShift: ULONG; Buffer: PULONG; BufferLength: ULONG; Source: KPROFILE_SOURCE; ProcessorMask: ULONG): NTSTATUS; stdcall;
  7620. TFNNtCreateSection = function (SectionHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; SectionSize: PLARGE_INTEGER; Protect: ULONG; Attributes: ULONG; FileHandle: HANDLE): NTSTATUS; stdcall;
  7621. TFNNtCreateSemaphore = function (SemaphoreHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; InitialCount: LONG; MaximumCount: LONG): NTSTATUS; stdcall;
  7622. TFNNtCreateSymbolicLinkObject = function (SymbolicLinkHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; TargetName: PUNICODE_STRING): NTSTATUS; stdcall;
  7623. TFNNtCreateThread = function (ThreadHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; ProcessHandle: HANDLE; ClientId: PCLIENT_ID; ThreadContext: PCONTEXT; UserStack: PUSER_STACK;
  7624. CreateSuspended: BOOLEAN): NTSTATUS; stdcall;
  7625. TFNNtCreateTimer = function (TimerHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; TimerType: TIMER_TYPE): NTSTATUS; stdcall;
  7626. TFNNtCreateToken = function (TokenHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; Type_: TOKEN_TYPE; AuthenticationId: PLUID; ExpirationTime: PLARGE_INTEGER; User: PTOKEN_USER; Groups: PTOKEN_GROUPS;
  7627. Privileges: PTOKEN_PRIVILEGES; Owner: PTOKEN_OWNER; PrimaryGroup: PTOKEN_PRIMARY_GROUP; DefaultDacl: PTOKEN_DEFAULT_DACL; Source: PTOKEN_SOURCE): NTSTATUS; stdcall;
  7628. TFNNtCreateWaitablePort = function (PortHandle: PHANDLE; ObjectAttributes: POBJECT_ATTRIBUTES; MaxDataSize: ULONG; MaxMessageSize: ULONG; Reserved: ULONG): NTSTATUS; stdcall;
  7629. TFNNtCurrentTeb = function (): PTEB; stdcall;
  7630. TFNNtDebugActiveProcess = function (hProcess: HANDLE; hDebugObject: HANDLE): NTSTATUS; stdcall;
  7631. TFNNtDelayExecution = function (Alertable: BOOLEAN; Interval: PLARGE_INTEGER): NTSTATUS; stdcall;
  7632. TFNNtDeleteAtom = function (Atom: USHORT): NTSTATUS; stdcall;
  7633. TFNNtDeleteFile = function (ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7634. TFNNtDeleteKey = function (KeyHandle: HANDLE): NTSTATUS; stdcall;
  7635. TFNNtDeleteObjectAuditAlarm = function (SubsystemName: PUNICODE_STRING; HandleId: PVOID; GenerateOnClose: BOOLEAN): NTSTATUS; stdcall;
  7636. TFNNtDeleteValueKey = function (KeyHandle: HANDLE; ValueName: PUNICODE_STRING): NTSTATUS; stdcall;
  7637. TFNNtDeviceIoControlFile = function (FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; IoControlCode: ULONG; InputBuffer: PVOID; InputBufferLength: ULONG;
  7638. OutputBuffer: PVOID; OutputBufferLength: ULONG): NTSTATUS; stdcall;
  7639. TFNNtDisplayString = function (Str: PUNICODE_STRING): NTSTATUS; stdcall;
  7640. TFNNtDuplicateObject = function (SourceProcessHandle: HANDLE; SourceHandle: HANDLE; TargetProcessHandle: HANDLE; TargetHandle: PHANDLE; DesiredAccess: ACCESS_MASK; Attributes: ULONG; Options: ULONG): NTSTATUS; stdcall;
  7641. TFNNtDuplicateToken = function (ExistingTokenHandle: HANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; EffectiveOnly: BOOLEAN; TokenType: TOKEN_TYPE; NewTokenHandle: PHANDLE): NTSTATUS; stdcall;
  7642. TFNNtEnumerateKey = function (KeyHandle: HANDLE; Index: ULONG; KeyInformationClass: KEY_INFORMATION_CLASS; KeyInformation: PVOID; KeyInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  7643. TFNNtEnumerateValueKey = function (KeyHandle: HANDLE; Index: ULONG; KeyValueInformationClass: KEY_VALUE_INFORMATION_CLASS; KeyValueInformation: PVOID; KeyValueInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  7644. TFNNtExtendSection = function (SectionHandle: HANDLE; SectionSize: PLARGE_INTEGER): NTSTATUS; stdcall;
  7645. TFNNtFilterToken = function (ExistingTokenHandle: HANDLE; Flags: ULONG; SidsToDisable: PTOKEN_GROUPS; PrivilegesToDelete: PTOKEN_PRIVILEGES; SidsToRestricted: PTOKEN_GROUPS; NewTokenHandle: PHANDLE): NTSTATUS; stdcall;
  7646. TFNNtFindAtom = function (Str: PWSTR; StringLength: ULONG; Atom: PUSHORT): NTSTATUS; stdcall;
  7647. TFNNtFlushBuffersFile = function (FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK): NTSTATUS; stdcall;
  7648. TFNNtFlushInstructionCache = function (ProcessHandle: HANDLE; BaseAddress: PVOID; FlushSize: ULONG): NTSTATUS; stdcall;
  7649. TFNNtFlushKey = function (KeyHandle: HANDLE): NTSTATUS; stdcall;
  7650. TFNNtFlushVirtualMemory = function (ProcessHandle: HANDLE; BaseAddress: PPVOID; FlushSize: PULONG; IoStatusBlock: PIO_STATUS_BLOCK): NTSTATUS; stdcall;
  7651. TFNNtFlushWriteBuffer = function (): NTSTATUS; stdcall;
  7652. TFNNtFreeUserPhysicalPages = function (ProcessHandle: HANDLE; NumberOfPages: PULONG; PageFrameNumbers: PULONG): NTSTATUS; stdcall;
  7653. TFNNtFreeVirtualMemory = function (ProcessHandle: HANDLE; BaseAddress: PPVOID; FreeSize: PULONG; FreeType: ULONG): NTSTATUS; stdcall;
  7654. TFNNtFsControlFile = function (FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; FsControlCode: ULONG; InputBuffer: PVOID; InputBufferLength: ULONG; OutputBuffer: PVOID;
  7655. OutputBufferLength: ULONG): NTSTATUS; stdcall;
  7656. TFNNtGetContextThread = function (ThreadHandle: HANDLE; Context: PCONTEXT): NTSTATUS; stdcall;
  7657. TFNNtGetCurrentProcessorNumber = function (): ULONG; stdcall;
  7658. TFNNtGetDevicePowerState = function (DeviceHandle: HANDLE; DevicePowerState: PDEVICE_POWER_STATE): NTSTATUS; stdcall;
  7659. TFNNtGetPlugPlayEvent = function (Reserved1: ULONG; Reserved2: ULONG; Buffer: PVOID; BufferLength: ULONG): NTSTATUS; stdcall;
  7660. TFNNtGetTickCount = function (): ULONG; stdcall;
  7661. TFNNtGetWriteWatch = function (ProcessHandle: HANDLE; Flags: ULONG; BaseAddress: PVOID; RegionSize: ULONG; Buffer: PULONG; BufferEntries: PULONG; Granularity: PULONG): NTSTATUS; stdcall;
  7662. TFNNtImpersonateAnonymousToken = function (ThreadHandle: HANDLE): NTSTATUS; stdcall;
  7663. TFNNtImpersonateClientOfPort = function (PortHandle: HANDLE; Message: PPORT_MESSAGE): NTSTATUS; stdcall;
  7664. TFNNtImpersonateThread = function (ThreadHandle: HANDLE; TargetThreadHandle: HANDLE; SecurityQos: PSECURITY_QUALITY_OF_SERVICE): NTSTATUS; stdcall;
  7665. TFNNtInitializeRegistry = function (Setup: BOOLEAN): NTSTATUS; stdcall;
  7666. TFNNtInitiatePowerAction = function (SystemAction: POWER_ACTION; MinSystemState: SYSTEM_POWER_STATE; Flags: ULONG; Asynchronous: BOOLEAN): NTSTATUS; stdcall;
  7667. TFNNtIsSystemResumeAutomatic = function (): BOOLEAN; stdcall;
  7668. TFNNtListenChannel = function (x: PVOID; y: PVOID): NTSTATUS; stdcall;
  7669. TFNNtListenPort = function (PortHandle: HANDLE; Message: PPORT_MESSAGE): NTSTATUS; stdcall;
  7670. TFNNtLoadDriver = function (DriverServiceName: PUNICODE_STRING): NTSTATUS; stdcall;
  7671. TFNNtLoadKey = function (KeyObjectAttributes: POBJECT_ATTRIBUTES; FileObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7672. TFNNtLoadKey2 = function (KeyObjectAttributes: POBJECT_ATTRIBUTES; FileObjectAttributes: POBJECT_ATTRIBUTES; Flags: ULONG): NTSTATUS; stdcall;
  7673. TFNNtLockFile = function (FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; LockOffset: PULARGE_INTEGER; LockLength: PULARGE_INTEGER; Key: ULONG; FailImmediately: BOOLEAN;
  7674. ExclusiveLock: BOOLEAN): NTSTATUS; stdcall;
  7675. TFNNtLockVirtualMemory = function (ProcessHandle: HANDLE; BaseAddress: PPVOID; LockSize: PULONG; LockType: ULONG): NTSTATUS; stdcall;
  7676. TFNNtMakePermanentObject = function (Handle: HANDLE): NTSTATUS; stdcall;
  7677. TFNNtMakeTemporaryObject = function (Handle: HANDLE): NTSTATUS; stdcall;
  7678. TFNNtMapUserPhysicalPages = function (BaseAddress: PVOID; NumberOfPages: PULONG; PageFrameNumbers: PULONG): NTSTATUS; stdcall;
  7679. TFNNtMapUserPhysicalPagesScatter = function (BaseAddresses: PPVOID; NumberOfPages: PULONG; PageFrameNumbers: PULONG): NTSTATUS; stdcall;
  7680. TFNNtMapViewOfSection = function (SectionHandle: HANDLE; ProcessHandle: HANDLE; BaseAddress: PPVOID; ZeroBits: ULONG; CommitSize: ULONG; SectionOffset: PLARGE_INTEGER; ViewSize: PULONG; InheritDisposition: SECTION_INHERIT;
  7681. AllocationType: ULONG; Protect: ULONG): NTSTATUS; stdcall;
  7682. TFNNtNotifyChangeDirectoryFile = function (FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_NOTIFY_INFORMATION; BufferLength: ULONG; NotifyFilter: ULONG;
  7683. WatchSubtree: BOOLEAN): NTSTATUS; stdcall;
  7684. TFNNtNotifyChangeKey = function (KeyHandle: HANDLE; EventHandle: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; NotifyFilter: ULONG; WatchSubtree: BOOLEAN; Buffer: PVOID; BufferLength: ULONG;
  7685. Asynchronous: BOOLEAN): NTSTATUS; stdcall;
  7686. TFNNtNotifyChangeMultipleKeys = function (KeyHandle: HANDLE; Flags: ULONG; KeyObjectAttributes: POBJECT_ATTRIBUTES; EventHandle: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; NotifyFilter: ULONG;
  7687. WatchSubtree: BOOLEAN; Buffer: PVOID; BufferLength: ULONG; Asynchronous: BOOLEAN): NTSTATUS; stdcall;
  7688. TFNNtOpenChannel = function (ChannelHandle: PHANDLE; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7689. TFNNtOpenDirectoryObject = function (DirectoryHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7690. TFNNtOpenEvent = function (EventHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7691. TFNNtOpenEventPair = function (EventPairHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7692. TFNNtOpenFile = function (FileHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; IoStatusBlock: PIO_STATUS_BLOCK; ShareAccess: ULONG; OpenOptions: ULONG): NTSTATUS; stdcall;
  7693. TFNNtOpenIoCompletion = function (IoCompletionHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7694. TFNNtOpenJobObject = function (JobHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7695. TFNNtOpenKey = function (KeyHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7696. TFNNtOpenMutant = function (MutantHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7697. TFNNtOpenObjectAuditAlarm = function (SubsystemName: PUNICODE_STRING; HandleId: PPVOID; ObjectTypeName: PUNICODE_STRING; ObjectName: PUNICODE_STRING; SecurityDescriptor: PSECURITY_DESCRIPTOR; TokenHandle: HANDLE;
  7698. DesiredAccess: ACCESS_MASK; GrantedAccess: ACCESS_MASK; Privileges: PPRIVILEGE_SET; ObjectCreation: BOOLEAN; AccessGranted: BOOLEAN; GenerateOnClose: PBOOLEAN): NTSTATUS; stdcall;
  7699. TFNNtOpenProcess = function (ProcessHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; ClientId: PCLIENT_ID): NTSTATUS; stdcall;
  7700. TFNNtOpenProcessToken = function (ProcessHandle: HANDLE; DesiredAccess: ACCESS_MASK; TokenHandle: PHANDLE): NTSTATUS; stdcall;
  7701. TFNNtOpenSection = function (SectionHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7702. TFNNtOpenSemaphore = function (SemaphoreHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7703. TFNNtOpenSymbolicLinkObject = function (SymbolicLinkHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7704. TFNNtOpenThread = function (ThreadHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; ClientId: PCLIENT_ID): NTSTATUS; stdcall;
  7705. TFNNtOpenThreadToken = function (ThreadHandle: HANDLE; DesiredAccess: ACCESS_MASK; OpenAsSelf: BOOLEAN; TokenHandle: PHANDLE): NTSTATUS; stdcall;
  7706. TFNNtOpenTimer = function (TimerHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7707. TFNNtPlugPlayControl = function (ControlCode: ULONG; Buffer: PVOID; BufferLength: ULONG): NTSTATUS; stdcall;
  7708. TFNNtPowerInformation = function (PowerInformationLevel: POWER_INFORMATION_LEVEL; InputBuffer: PVOID; InputBufferLength: ULONG; OutputBuffer: PVOID; OutputBufferLength: ULONG): NTSTATUS; stdcall;
  7709. TFNNtPrivilegeCheck = function (TokenHandle: HANDLE; RequiredPrivileges: PPRIVILEGE_SET; Result_: PBOOLEAN): NTSTATUS; stdcall;
  7710. TFNNtPrivilegeObjectAuditAlarm = function (SubsystemName: PUNICODE_STRING; HandleId: PVOID; TokenHandle: HANDLE; DesiredAccess: ACCESS_MASK; Privileges: PPRIVILEGE_SET; AccessGranted: BOOLEAN): NTSTATUS; stdcall;
  7711. TFNNtPrivilegedServiceAuditAlarm = function (SubsystemName: PUNICODE_STRING; ServiceName: PUNICODE_STRING; TokenHandle: HANDLE; Privileges: PPRIVILEGE_SET; AccessGranted: BOOLEAN): NTSTATUS; stdcall;
  7712. TFNNtProtectVirtualMemory = function (ProcessHandle: HANDLE; BaseAddress: PPVOID; ProtectSize: PULONG; NewProtect: ULONG; OldProtect: PULONG): NTSTATUS; stdcall;
  7713. TFNNtPulseEvent = function (EventHandle: HANDLE; PreviousState: PULONG): NTSTATUS; stdcall;
  7714. TFNNtQueryAttributesFile = function (ObjectAttributes: POBJECT_ATTRIBUTES; FileInformation: PFILE_BASIC_INFORMATION): NTSTATUS; stdcall;
  7715. TFNNtQueryDefaultLocale = function (ThreadOrSystem: BOOLEAN; Locale: PLCID): NTSTATUS; stdcall;
  7716. TFNNtQueryDefaultUILanguage = function (LanguageId: PLANGID): NTSTATUS; stdcall;
  7717. TFNNtQueryDirectoryFile = function (FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; FileInformation: PVOID; FileInformationLength: ULONG;
  7718. FileInformationClass: FILE_INFORMATION_CLASS; ReturnSingleEntry: BOOLEAN; FileName: PUNICODE_STRING; RestartScan: BOOLEAN): NTSTATUS; stdcall;
  7719. TFNNtQueryDirectoryObject = function (DirectoryHandle: HANDLE; Buffer: PVOID; BufferLength: ULONG; ReturnSingleEntry: BOOLEAN; RestartScan: BOOLEAN; Context: PULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7720. TFNNtQueryEaFile = function (FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_FULL_EA_INFORMATION; BufferLength: ULONG; ReturnSingleEntry: BOOLEAN; EaList: PFILE_GET_EA_INFORMATION; EaListLength: ULONG; EaIndex: PULONG;
  7721. RestartScan: BOOLEAN): NTSTATUS; stdcall;
  7722. TFNNtQueryEvent = function (EventHandle: HANDLE; EventInformationClass: EVENT_INFORMATION_CLASS; EventInformation: PVOID; EventInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  7723. TFNNtQueryFullAttributesFile = function (ObjectAttributes: POBJECT_ATTRIBUTES; FileInformation: PFILE_NETWORK_OPEN_INFORMATION): NTSTATUS; stdcall;
  7724. TFNNtQueryInformationAtom = function (Atom: USHORT; AtomInformationClass: ATOM_INFORMATION_CLASS; AtomInformation: PVOID; AtomInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7725. TFNNtQueryInformationFile = function (FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; FileInformation: PVOID; FileInformationLength: ULONG; FileInformationClass: FILE_INFORMATION_CLASS): NTSTATUS; stdcall;
  7726. TFNNtQueryInformationJobObject = function (JobHandle: HANDLE; JobInformationClass: JOBOBJECTINFOCLASS; JobInformation: PVOID; JobInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7727. TFNNtQueryInformationPort = function (PortHandle: HANDLE; PortInformationClass: PORT_INFORMATION_CLASS; PortInformation: PVOID; PortInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7728. TFNNtQueryInformationProcess = function (ProcessHandle: HANDLE; ProcessInformationClass: PROCESSINFOCLASS; ProcessInformation: PVOID; ProcessInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7729. TFNNtQueryInformationThread = function (ThreadHandle: HANDLE; ThreadInformationClass: THREADINFOCLASS; ThreadInformation: PVOID; ThreadInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7730. TFNNtQueryInformationToken = function (TokenHandle: HANDLE; TokenInformationClass: TOKEN_INFORMATION_CLASS; TokenInformation: PVOID; TokenInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7731. TFNNtQueryInstallUILanguage = function (LanguageId: PLANGID): NTSTATUS; stdcall;
  7732. TFNNtQueryIntervalProfile = function (Source: KPROFILE_SOURCE; Interval: PULONG): NTSTATUS; stdcall;
  7733. TFNNtQueryIoCompletion = function (IoCompletionHandle: HANDLE; IoCompletionInformationClass: IO_COMPLETION_INFORMATION_CLASS; IoCompletionInformation: PVOID; IoCompletionInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  7734. TFNNtQueryKey = function (KeyHandle: HANDLE; KeyInformationClass: KEY_INFORMATION_CLASS; KeyInformation: PVOID; KeyInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  7735. TFNNtQueryMultipleValueKey = function (KeyHandle: HANDLE; ValueList: PKEY_VALUE_ENTRY; NumberOfValues: ULONG; Buffer: PVOID; Length: PULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7736. TFNNtQueryMutant = function (MutantHandle: HANDLE; MutantInformationClass: MUTANT_INFORMATION_CLASS; MutantInformation: PVOID; MutantInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  7737. TFNNtQueryObject = function (ObjectHandle: HANDLE; ObjectInformationClass: OBJECT_INFORMATION_CLASS; ObjectInformation: PVOID; ObjectInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7738. TFNNtQueryOpenSubKeys = function (KeyObjectAttributes: POBJECT_ATTRIBUTES; NumberOfKey: PULONG): NTSTATUS; stdcall;
  7739. TFNNtQueryPerformanceCounter = function (PerformanceCount: PLARGE_INTEGER; PerformanceFrequency: PLARGE_INTEGER): NTSTATUS; stdcall;
  7740. TFNNtQueryPortInformationProcess = function (): ULONG; stdcall;
  7741. TFNNtQueryQuotaInformationFile = function (FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_USER_QUOTA_INFORMATION; BufferLength: ULONG; ReturnSingleEntry: BOOLEAN; QuotaList: PFILE_QUOTA_LIST_INFORMATION;
  7742. QuotaListLength: ULONG; ResumeSid: PSID; RestartScan: BOOLEAN): NTSTATUS; stdcall;
  7743. TFNNtQuerySection = function (SectionHandle: HANDLE; SectionInformationClass: SECTION_INFORMATION_CLASS; SectionInformation: PVOID; SectionInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  7744. TFNNtQuerySecurityObject = function (Handle: HANDLE; RequestedInformation: SECURITY_INFORMATION; SecurityDescriptor: PSECURITY_DESCRIPTOR; SecurityDescriptorLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7745. TFNNtQuerySemaphore = function (SemaphoreHandle: HANDLE; SemaphoreInformationClass: SEMAPHORE_INFORMATION_CLASS; SemaphoreInformation: PVOID; SemaphoreInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  7746. TFNNtQuerySymbolicLinkObject = function (SymbolicLinkHandle: HANDLE; TargetName: PUNICODE_STRING; ReturnLength: PULONG): NTSTATUS; stdcall;
  7747. TFNNtQuerySystemEnvironmentValue = function (Name: PUNICODE_STRING; Value: PVOID; ValueLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7748. TFNNtQuerySystemInformation = function (SystemInformationClass: SYSTEM_INFORMATION_CLASS; SystemInformation: PVOID; SystemInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7749. TFNNtQuerySystemTime = function (CurrentTime: PLARGE_INTEGER): NTSTATUS; stdcall;
  7750. TFNNtQueryTimer = function (TimerHandle: HANDLE; TimerInformationClass: TIMER_INFORMATION_CLASS; TimerInformation: PVOID; TimerInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  7751. TFNNtQueryTimerResolution = function (CoarsestResolution: PULONG; FinestResolution: PULONG; ActualResolution: PULONG): NTSTATUS; stdcall;
  7752. TFNNtQueryValueKey = function (KeyHandle: HANDLE; ValueName: PUNICODE_STRING; KeyValueInformationClass: KEY_VALUE_INFORMATION_CLASS; KeyValueInformation: PVOID; KeyValueInformationLength: ULONG; ResultLength: PULONG): NTSTATUS; stdcall;
  7753. TFNNtQueryVirtualMemory = function (ProcessHandle: HANDLE; BaseAddress: PVOID; MemoryInformationClass: MEMORY_INFORMATION_CLASS; MemoryInformation: PVOID; MemoryInformationLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7754. TFNNtQueryVolumeInformationFile = function (FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; VolumeInformation: PVOID; VolumeInformationLength: ULONG; VolumeInformationClass: FS_INFORMATION_CLASS): NTSTATUS; stdcall;
  7755. TFNNtQueueApcThread = function (ThreadHandle: HANDLE; ApcRoutine: PKNORMAL_ROUTINE; ApcContext: PVOID; Argument1: PVOID; Argument2: PVOID): NTSTATUS; stdcall;
  7756. TFNNtRaiseException = function (ExceptionRecord: PEXCEPTION_RECORD; Context: PCONTEXT; SearchFrames: BOOLEAN): NTSTATUS; stdcall;
  7757. TFNNtRaiseHardError = function (Status: NTSTATUS; NumberOfArguments: ULONG; StringArgumentsMask: ULONG; Arguments: PULONG; MessageBoxType: ULONG; MessageBoxResult: PULONG): NTSTATUS; stdcall;
  7758. TFNNtReadFile = function (FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PVOID; Length: ULONG; ByteOffset: PLARGE_INTEGER; Key: PULONG): NTSTATUS; stdcall;
  7759. TFNNtReadFileScatter = function (FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_SEGMENT_ELEMENT; Length: ULONG; ByteOffset: PLARGE_INTEGER;
  7760. Key: PULONG): NTSTATUS; stdcall;
  7761. TFNNtReadRequestData = function (PortHandle: HANDLE; Message: PPORT_MESSAGE; Index: ULONG; Buffer: PVOID; BufferLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7762. TFNNtReadVirtualMemory = function (ProcessHandle: HANDLE; BaseAddress: PVOID; Buffer: PVOID; BufferLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7763. TFNNtRegisterThreadTerminatePort = function (PortHandle: HANDLE): NTSTATUS; stdcall;
  7764. TFNNtReleaseMutant = function (MutantHandle: HANDLE; PreviousState: PULONG): NTSTATUS; stdcall;
  7765. TFNNtReleaseSemaphore = function (SemaphoreHandle: HANDLE; ReleaseCount: LONG; PreviousCount: PLONG): NTSTATUS; stdcall;
  7766. TFNNtRemoveIoCompletion = function (IoCompletionHandle: HANDLE; CompletionKey: PULONG; CompletionValue: PULONG; IoStatusBlock: PIO_STATUS_BLOCK; Timeout: PLARGE_INTEGER): NTSTATUS; stdcall;
  7767. TFNNtRemoveProcessDebug = function (hProcess: HANDLE; hDebugObject: HANDLE): NTSTATUS; stdcall;
  7768. TFNNtReplaceKey = function (NewFileObjectAttributes: POBJECT_ATTRIBUTES; KeyHandle: HANDLE; OldFileObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7769. TFNNtReplyPort = function (PortHandle: HANDLE; ReplyMessage: PPORT_MESSAGE): NTSTATUS; stdcall;
  7770. TFNNtReplyWaitReceivePort = function (PortHandle: HANDLE; PortIdentifier: PULONG; ReplyMessage: PPORT_MESSAGE; Message: PPORT_MESSAGE): NTSTATUS; stdcall;
  7771. TFNNtReplyWaitReceivePortEx = function (PortHandle: HANDLE; PortIdentifier: PULONG; ReplyMessage: PPORT_MESSAGE; Message: PPORT_MESSAGE; Timeout: PLARGE_INTEGER): NTSTATUS; stdcall;
  7772. TFNNtReplyWaitReplyPort = function (PortHandle: HANDLE; ReplyMessage: PPORT_MESSAGE): NTSTATUS; stdcall;
  7773. TFNNtReplyWaitSendChannel = function (x: PVOID; y: PVOID; z: PVOID): NTSTATUS; stdcall;
  7774. TFNNtRequestDeviceWakeup = function (DeviceHandle: HANDLE): NTSTATUS; stdcall;
  7775. TFNNtRequestPort = function (PortHandle: HANDLE; RequestMessage: PPORT_MESSAGE): NTSTATUS; stdcall;
  7776. TFNNtRequestWaitReplyPort = function (PortHandle: HANDLE; RequestMessage: PPORT_MESSAGE; ReplyMessage: PPORT_MESSAGE): NTSTATUS; stdcall;
  7777. TFNNtRequestWakeupLatency = function (Latency: LATENCY_TIME): NTSTATUS; stdcall;
  7778. TFNNtResetEvent = function (EventHandle: HANDLE; PreviousState: PULONG): NTSTATUS; stdcall;
  7779. TFNNtResetWriteWatch = function (ProcessHandle: HANDLE; BaseAddress: PVOID; RegionSize: ULONG): NTSTATUS; stdcall;
  7780. TFNNtRestoreKey = function (KeyHandle: HANDLE; FileHandle: HANDLE; Flags: ULONG): NTSTATUS; stdcall;
  7781. TFNNtResumeProcess = function (hProcess: HANDLE): NTSTATUS; stdcall;
  7782. TFNNtResumeThread = function (hThread: HANDLE; dwResumeCount: PULONG): NTSTATUS; stdcall;
  7783. TFNNtSaveKey = function (KeyHandle: HANDLE; FileHandle: HANDLE): NTSTATUS; stdcall;
  7784. TFNNtSaveKeyEx = function (KeyHandle: HANDLE; FileHandle: HANDLE; Flags: DWORD): NTSTATUS; stdcall;
  7785. TFNNtSaveMergedKeys = function (KeyHandle1: HANDLE; KeyHandle2: HANDLE; FileHandle: HANDLE): NTSTATUS; stdcall;
  7786. TFNNtSecureConnectPort = function (PortHandle: PHANDLE; PortName: PUNICODE_STRING; SecurityQos: PSECURITY_QUALITY_OF_SERVICE; WriteSection: PPORT_SECTION_WRITE; ServerSid: PSID; ReadSection: PPORT_SECTION_READ; MaxMessageSize: PULONG;
  7787. ConnectData: PVOID; ConnectDataLength: PULONG): NTSTATUS; stdcall;
  7788. TFNNtSendWaitReplyChannel = function (x: PVOID; y: PVOID; z: PVOID; z2: PVOID): NTSTATUS; stdcall;
  7789. TFNNtSetContextChannel = function (x: PVOID): NTSTATUS; stdcall;
  7790. TFNNtSetContextThread = function (ThreadHandle: HANDLE; Context: PCONTEXT): NTSTATUS; stdcall;
  7791. TFNNtSetDefaultHardErrorPort = function (PortHandle: HANDLE): NTSTATUS; stdcall;
  7792. TFNNtSetDefaultLocale = function (ThreadOrSystem: BOOLEAN; Locale: LCID): NTSTATUS; stdcall;
  7793. TFNNtSetDefaultUILanguage = function (LanguageId: LANGID): NTSTATUS; stdcall;
  7794. TFNNtSetEaFile = function (FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_FULL_EA_INFORMATION; BufferLength: ULONG): NTSTATUS; stdcall;
  7795. TFNNtSetEvent = function (EventHandle: HANDLE; PreviousState: PULONG): NTSTATUS; stdcall;
  7796. TFNNtSetHighEventPair = function (EventPairHandle: HANDLE): NTSTATUS; stdcall;
  7797. TFNNtSetHighWaitLowEventPair = function (EventPairHandle: HANDLE): NTSTATUS; stdcall;
  7798. TFNNtSetHighWaitLowThread = function (): NTSTATUS; stdcall;
  7799. TFNNtSetInformationFile = function (FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; FileInformation: PVOID; FileInformationLength: ULONG; FileInformationClass: FILE_INFORMATION_CLASS): NTSTATUS; stdcall;
  7800. TFNNtSetInformationJobObject = function (JobHandle: HANDLE; JobInformationClass: JOBOBJECTINFOCLASS; JobInformation: PVOID; JobInformationLength: ULONG): NTSTATUS; stdcall;
  7801. TFNNtSetInformationKey = function (KeyHandle: HANDLE; KeyInformationClass: KEY_SET_INFORMATION_CLASS; KeyInformation: PVOID; KeyInformationLength: ULONG): NTSTATUS; stdcall;
  7802. TFNNtSetInformationObject = function (ObjectHandle: HANDLE; ObjectInformationClass: OBJECT_INFORMATION_CLASS; ObjectInformation: PVOID; ObjectInformationLength: ULONG): NTSTATUS; stdcall;
  7803. TFNNtSetInformationProcess = function (ProcessHandle: HANDLE; ProcessInformationClass: PROCESSINFOCLASS; ProcessInformation: PVOID; ProcessInformationLength: ULONG): NTSTATUS; stdcall;
  7804. TFNNtSetInformationThread = function (ThreadHandle: HANDLE; ThreadInformationClass: THREADINFOCLASS; ThreadInformation: PVOID; ThreadInformationLength: ULONG): NTSTATUS; stdcall;
  7805. TFNNtSetInformationToken = function (TokenHandle: HANDLE; TokenInformationClass: TOKEN_INFORMATION_CLASS; TokenInformation: PVOID; TokenInformationLength: ULONG): NTSTATUS; stdcall;
  7806. TFNNtSetIntervalProfile = function (Interval: ULONG; Source: KPROFILE_SOURCE): NTSTATUS; stdcall;
  7807. TFNNtSetIoCompletion = function (IoCompletionHandle: HANDLE; CompletionKey: ULONG; CompletionValue: ULONG; Status: NTSTATUS; Information: ULONG): NTSTATUS; stdcall;
  7808. TFNNtSetLdtEntries = function (Selector1: ULONG; LdtEntry1: LDT_ENTRY; Selector2: ULONG; LdtEntry2: LDT_ENTRY): NTSTATUS; stdcall;
  7809. TFNNtSetLowEventPair = function (EventPairHandle: HANDLE): NTSTATUS; stdcall;
  7810. TFNNtSetLowWaitHighEventPair = function (EventPairHandle: HANDLE): NTSTATUS; stdcall;
  7811. TFNNtSetLowWaitHighThread = function (): NTSTATUS; stdcall;
  7812. TFNNtSetQuotaInformationFile = function (FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_USER_QUOTA_INFORMATION; BufferLength: ULONG): NTSTATUS; stdcall;
  7813. TFNNtSetSecurityObject = function (Handle: HANDLE; SecurityInformation: SECURITY_INFORMATION; SecurityDescriptor: PSECURITY_DESCRIPTOR): NTSTATUS; stdcall;
  7814. TFNNtSetSystemEnvironmentValue = function (Name: PUNICODE_STRING; Value: PUNICODE_STRING): NTSTATUS; stdcall;
  7815. TFNNtSetSystemInformation = function (SystemInformationClass: SYSTEM_INFORMATION_CLASS; SystemInformation: PVOID; SystemInformationLength: ULONG): NTSTATUS; stdcall;
  7816. TFNNtSetSystemPowerState = function (SystemAction: POWER_ACTION; MinSystemState: SYSTEM_POWER_STATE; Flags: ULONG): NTSTATUS; stdcall;
  7817. TFNNtSetSystemTime = function (NewTime: PLARGE_INTEGER; OldTime: PLARGE_INTEGER): NTSTATUS; stdcall;
  7818. TFNNtSetThreadExecutionState = function (ExecutionState: EXECUTION_STATE; PreviousExecutionState: PEXECUTION_STATE): NTSTATUS; stdcall;
  7819. TFNNtSetTimer = function (TimerHandle: HANDLE; DueTime: PLARGE_INTEGER; TimerApcRoutine: PTIMER_APC_ROUTINE; TimerContext: PVOID; Resume: BOOLEAN; Period: LONG; PreviousState: PBOOLEAN): NTSTATUS; stdcall;
  7820. TFNNtSetTimerResolution = function (RequestedResolution: ULONG; Set_: BOOLEAN; ActualResolution: PULONG): NTSTATUS; stdcall;
  7821. TFNNtSetUuidSeed = function (UuidSeed: PUCHAR): NTSTATUS; stdcall;
  7822. TFNNtSetValueKey = function (KeyHandle: HANDLE; ValueName: PUNICODE_STRING; TitleIndex: ULONG; Type_: ULONG; Data: PVOID; DataSize: ULONG): NTSTATUS; stdcall;
  7823. TFNNtSetVolumeInformationFile = function (FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PVOID; BufferLength: ULONG; VolumeInformationClass: FS_INFORMATION_CLASS): NTSTATUS; stdcall;
  7824. TFNNtShutdownSystem = function (Action: SHUTDOWN_ACTION): NTSTATUS; stdcall;
  7825. TFNNtSignalAndWaitForSingleObject = function (HandleToSignal: HANDLE; HandleToWait: HANDLE; Alertable: BOOLEAN; Timeout: PLARGE_INTEGER): NTSTATUS; stdcall;
  7826. TFNNtStartProfile = function (ProfileHandle: HANDLE): NTSTATUS; stdcall;
  7827. TFNNtStopProfile = function (ProfileHandle: HANDLE): NTSTATUS; stdcall;
  7828. TFNNtSuspendProcess = function (hProcess: HANDLE): NTSTATUS; stdcall;
  7829. TFNNtSuspendThread = function (hThread: HANDLE; dwLastResumeCount: PULONG): NTSTATUS; stdcall;
  7830. TFNNtSystemDebugControl = function (ControlCode: DEBUG_CONTROL_CODE; InputBuffer: PVOID; InputBufferLength: ULONG; OutputBuffer: PVOID; OutputBufferLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7831. TFNNtTerminateJobObject = function (JobHandle: HANDLE; ExitStatus: NTSTATUS): NTSTATUS; stdcall;
  7832. TFNNtTerminateProcess = function (ProcessHandle: HANDLE; ExitStatus: NTSTATUS): NTSTATUS; stdcall;
  7833. TFNNtTerminateThread = function (ThreadHandle: HANDLE; ExitStatus: NTSTATUS): NTSTATUS; stdcall;
  7834. TFNNtTestAlert = function (): NTSTATUS; stdcall;
  7835. TFNNtUnloadDriver = function (DriverServiceName: PUNICODE_STRING): NTSTATUS; stdcall;
  7836. TFNNtUnloadKey = function (KeyObjectAttributes: POBJECT_ATTRIBUTES): NTSTATUS; stdcall;
  7837. TFNNtUnlockFile = function (FileHandle: HANDLE; IoStatusBlock: PIO_STATUS_BLOCK; LockOffset: PULARGE_INTEGER; LockLength: PULARGE_INTEGER; Key: ULONG): NTSTATUS; stdcall;
  7838. TFNNtUnlockVirtualMemory = function (ProcessHandle: HANDLE; BaseAddress: PPVOID; LockSize: PULONG; LockType: ULONG): NTSTATUS; stdcall;
  7839. TFNNtUnmapViewOfSection = function (ProcessHandle: HANDLE; BaseAddress: PVOID): NTSTATUS; stdcall;
  7840. TFNNtVdmControl = function (ControlCode: ULONG; ControlData: PVOID): NTSTATUS; stdcall;
  7841. TFNNtW32Call = function (RoutineIndex: ULONG; Argument: PVOID; ArgumentLength: ULONG; Result_: PPVOID; ResultLength: PULONG): NTSTATUS; stdcall;
  7842. TFNNtWaitForMultipleObjects = function (HandleCount: ULONG; Handles: PHANDLE; WaitType: WAIT_TYPE; Alertable: BOOLEAN; Timeout: PLARGE_INTEGER): NTSTATUS; stdcall;
  7843. TFNNtWaitForSingleObject = function (Handle: HANDLE; Alertable: BOOLEAN; Timeout: PLARGE_INTEGER): NTSTATUS; stdcall;
  7844. TFNNtWaitHighEventPair = function (EventPairHandle: HANDLE): NTSTATUS; stdcall;
  7845. TFNNtWaitLowEventPair = function (EventPairHandle: HANDLE): NTSTATUS; stdcall;
  7846. TFNNtWriteFile = function (FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PVOID; Length: ULONG; ByteOffset: PLARGE_INTEGER; Key: PULONG): NTSTATUS; stdcall;
  7847. TFNNtWriteFileGather = function (FileHandle: HANDLE; Event: HANDLE; ApcRoutine: PIO_APC_ROUTINE; ApcContext: PVOID; IoStatusBlock: PIO_STATUS_BLOCK; Buffer: PFILE_SEGMENT_ELEMENT; Length: ULONG; ByteOffset: PLARGE_INTEGER;
  7848. Key: PULONG): NTSTATUS; stdcall;
  7849. TFNNtWriteRequestData = function (PortHandle: HANDLE; Message: PPORT_MESSAGE; Index: ULONG; Buffer: PVOID; BufferLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7850. TFNNtWriteVirtualMemory = function (ProcessHandle: HANDLE; BaseAddress: PVOID; Buffer: PVOID; BufferLength: ULONG; ReturnLength: PULONG): NTSTATUS; stdcall;
  7851. TFNNtYieldExecution = function (): NTSTATUS; stdcall;
  7852. TFNRtlAbsoluteToSelfRelativeSD = function (pAbsoluteSD: PSECURITY_DESCRIPTOR; pSelfRelativeSD: PSECURITY_DESCRIPTOR; lpdwBufferLength: LPDWORD): NTSTATUS; stdcall;
  7853. TFNRtlAcquirePebLock = procedure(); stdcall;
  7854. TFNRtlAddAccessAllowedAce = function (pAcl: PACL; dwAceRevision: DWORD; AccessMask: ACCESS_MASK; pSid: PSID): NTSTATUS; stdcall;
  7855. TFNRtlAddAccessAllowedAceEx = function (pAcl: PACL; dwAceRevision: DWORD; AceFlags: DWORD; AccessMask: ACCESS_MASK; pSid: PSID): NTSTATUS; stdcall;
  7856. TFNRtlAddAccessDeniedAce = function (pAcl: PACL; dwAceRevision: DWORD; AccessMask: ACCESS_MASK; pSid: PSID): NTSTATUS; stdcall;
  7857. TFNRtlAddAccessDeniedAceEx = function (pAcl: PACL; dwAceRevision: DWORD; AceFlags: DWORD; AccessMask: ACCESS_MASK; pSid: PSID): NTSTATUS; stdcall;
  7858. TFNRtlAddAce = function (pAcl: PACL; dwAceRevision: DWORD; dwStartingAceIndex: DWORD; pAceList: PVOID; nAceListLength: DWORD): NTSTATUS; stdcall;
  7859. TFNRtlAddAuditAccessAce = function (pAcl: PACL; dwAceRevision: DWORD; AccessMask: ACCESS_MASK; pSid: PSID; bAuditSuccess: BOOLEAN; bAuditFailure: BOOLEAN): NTSTATUS; stdcall;
  7860. TFNRtlAddAuditAccessAceEx = function (pAcl: PACL; dwAceRevision: DWORD; AceFlags: DWORD; AccessMask: ACCESS_MASK; pSid: PSID; bAuditSuccess: BOOLEAN; bAuditFailure: BOOLEAN): NTSTATUS; stdcall;
  7861. TFNRtlAddRange = function (RangeList: PRTL_RANGE_LIST; Start: ULONGLONG; End_: ULONGLONG; Attributes: UCHAR; Flags: ULONG; UserData: PVOID; Owner: PVOID): NTSTATUS; stdcall;
  7862. TFNRtlAddVectoredExceptionHandler = function (FirstHandler: ULONG; VectoredHandler: PVECTORED_EXCEPTION_HANDLER): PVOID; stdcall;
  7863. TFNRtlAdjustPrivilege = function (Privilege: ULONG; Enable: BOOLEAN; CurrentThread: BOOLEAN; Enabled: PBOOLEAN): NTSTATUS; stdcall;
  7864. TFNRtlAllocateAndInitializeSid = function (pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY; SubAuthorityCount: BYTE; nSubAuthority0: DWORD; nSubAuthority1: DWORD; nSubAuthority2: DWORD; nSubAuthority3: DWORD; nSubAuthority4: DWORD;
  7865. nSubAuthority5: DWORD; nSubAuthority6: DWORD; nSubAuthority7: DWORD; var pSid: PSID): BOOL; stdcall;
  7866. TFNRtlAllocateHeap = function (hHeap: HANDLE; dwFlags: ULONG; Size: ULONG): PVOID; stdcall;
  7867. TFNRtlAnsiCharToUnicodeChar = function (AnsiChar: CHAR): WCHAR; stdcall;
  7868. TFNRtlAnsiStringToUnicodeSize = function (AnsiString: PANSI_STRING): ULONG; stdcall;
  7869. TFNRtlAnsiStringToUnicodeString = function (DestinationString: PUNICODE_STRING; SourceString: PANSI_STRING; AllocateDestinationString: BOOLEAN): NTSTATUS; stdcall;
  7870. TFNRtlAppendAsciizToString = function (DestinationString: PSTRING; AppendThisString: LPCSTR): NTSTATUS; stdcall;
  7871. TFNRtlAppendStringToString = function (DestinationString: PSTRING; AppendThisString: PSTRING): NTSTATUS; stdcall;
  7872. TFNRtlAppendUnicodeStringToString = function (DestinationString: PUNICODE_STRING; SourceString: PUNICODE_STRING): NTSTATUS; stdcall;
  7873. TFNRtlAppendUnicodeToString = function (Destination: PUNICODE_STRING; Source: LPCWSTR): NTSTATUS; stdcall;
  7874. TFNRtlAreAllAccessesGranted = function (GrantedAccess: ACCESS_MASK; WantedAccess: ACCESS_MASK): BOOLEAN; stdcall;
  7875. TFNRtlAreAnyAccessesGranted = function (GrantedAccess: ACCESS_MASK; WantedAccess: ACCESS_MASK): BOOLEAN; stdcall;
  7876. TFNRtlAreBitsClear = function (BitMapHeader: PRTL_BITMAP; StartingIndex: ULONG; Length: ULONG): BOOLEAN; stdcall;
  7877. TFNRtlAreBitsSet = function (BitMapHeader: PRTL_BITMAP; StartingIndex: ULONG; Length: ULONG): BOOLEAN; stdcall;
  7878. TFNRtlAssert = procedure(FailedAssertion: PVOID; FileName: PVOID; LineNumber: ULONG; Message: PCHAR); stdcall;
  7879. TFNRtlCaptureContext = procedure(ContextRecord: PCONTEXT); stdcall;
  7880. TFNRtlCharToInteger = function (Str: PCSZ; Base: ULONG; Value: PULONG): NTSTATUS; stdcall;
  7881. TFNRtlCheckForOrphanedCriticalSections = procedure(hThread: HANDLE); stdcall;
  7882. TFNRtlCheckRegistryKey = function (RelativeTo: ULONG; Path: PWSTR): NTSTATUS; stdcall;
  7883. TFNRtlClearAllBits = procedure(BitMapHeader: PRTL_BITMAP); stdcall;
  7884. TFNRtlClearBits = procedure(BitMapHeader: PRTL_BITMAP; StartingIndex: ULONG; NumberToClear: ULONG); stdcall;
  7885. TFNRtlCompactHeap = function (hHeap: HANDLE; dwFlags: ULONG): ULONG; stdcall;
  7886. TFNRtlCompareMemory = function (Source1: PVOID; Source2: PVOID; Length: SIZE_T): SIZE_T; stdcall;
  7887. TFNRtlCompareMemoryUlong = function (Source: PVOID; Length: ULONG; Value: ULONG): ULONG; stdcall;
  7888. TFNRtlCompareString = function (String1: PSTRING; String2: PSTRING; CaseInsensitive: BOOLEAN): LONG; stdcall;
  7889. TFNRtlCompareUnicodeString = function (String1: PUNICODE_STRING; String2: PUNICODE_STRING; CaseInsensitive: BOOLEAN): LONG; stdcall;
  7890. TFNRtlConvertLongToLargeInteger = function (SignedInteger: LONG): LARGE_INTEGER; stdcall;
  7891. TFNRtlConvertSidToUnicodeString = function (UnicodeString: PUNICODE_STRING; Sid: PSID; AllocateDestinationString: BOOLEAN): NTSTATUS; stdcall;
  7892. TFNRtlConvertUlongToLargeInteger = function (UnsignedInteger: ULONG): LARGE_INTEGER; stdcall;
  7893. TFNRtlCopyLuid = procedure(Destination: PLUID; Source: PLUID); stdcall;
  7894. TFNRtlCopyRangeList = function (CopyRangeList: PRTL_RANGE_LIST; RangeList: PRTL_RANGE_LIST): NTSTATUS; stdcall;
  7895. TFNRtlCopySecurityDescriptor = function (Source: PSECURITY_DESCRIPTOR; var Destination: PSECURITY_DESCRIPTOR): NTSTATUS; stdcall;
  7896. TFNRtlCopySid = function (DestinationLength: ULONG; Destination: PSID; Source: PSID): NTSTATUS; stdcall;
  7897. TFNRtlCopyString = procedure(DestinationString: PSTRING; SourceString: PSTRING); stdcall;
  7898. TFNRtlCopyUnicodeString = procedure(DestinationString: PUNICODE_STRING; SourceString: PUNICODE_STRING); stdcall;
  7899. TFNRtlCreateAcl = function (pAcl: PACL; nAclLength: DWORD; dwAclRevision: DWORD): NTSTATUS; stdcall;
  7900. TFNRtlCreateHeap = function (dwOptions: ULONG; Base: PVOID; dwMaximumSize: SIZE_T; dwInitialSize: SIZE_T; UnknownOptional1: PVOID; UnknownOptional2: PVOID): HANDLE; stdcall;
  7901. TFNRtlCreateProcessParameters = function (ProcessParameters: PPRTL_USER_PROCESS_PARAMETERS; ImageFile: PUNICODE_STRING; DllPath: PUNICODE_STRING; CurrentDirectory: PUNICODE_STRING; CommandLine: PUNICODE_STRING; CreationFlags: ULONG;
  7902. WindowTitle: PUNICODE_STRING; Desktop: PUNICODE_STRING; Reserved: PUNICODE_STRING; Reserved2: PUNICODE_STRING): NTSTATUS; stdcall;
  7903. TFNRtlCreateQueryDebugBuffer = function (Size: ULONG; EventPair: BOOLEAN): PDEBUG_BUFFER; stdcall;
  7904. TFNRtlCreateRegistryKey = function (RelativeTo: ULONG; Path: PWSTR): NTSTATUS; stdcall;
  7905. TFNRtlCreateSecurityDescriptor = function (SecurityDescriptor: PSECURITY_DESCRIPTOR; Revision: ULONG): NTSTATUS; stdcall;
  7906. TFNRtlCreateUnicodeString = function (DestinationString: PUNICODE_STRING; SourceString: PWSTR): BOOLEAN; stdcall;
  7907. TFNRtlCreateUnicodeStringFromAsciiz = function (DestinationString: PUNICODE_STRING; SourceString: PCHAR): BOOLEAN; stdcall;
  7908. TFNRtlCreateUserProcess = function (ImageFileName: PUNICODE_STRING; Attributes: ULONG; ProcessParameters: PRTL_USER_PROCESS_PARAMETERS; ProcessSecurityDescriptor: PSECURITY_DESCRIPTOR; ThreadSecurityDescriptor: PSECURITY_DESCRIPTOR;
  7909. ParentProcess: HANDLE; InheritHandles: BOOLEAN; DebugPort: HANDLE; ExceptionPort: HANDLE; ProcessInfo: PRTL_PROCESS_INFORMATION): NTSTATUS; stdcall;
  7910. TFNRtlCreateUserThread = function (hProcess: HANDLE; SecurityDescriptor: PSECURITY_DESCRIPTOR; CreateSuspended: BOOLEAN; StackZeroBits: ULONG; StackReserve: ULONG; StackCommit: ULONG; lpStartAddress: PTHREAD_START_ROUTINE;
  7911. lpParameter: PVOID; phThread: PHANDLE; ClientId: PCLIENT_ID): NTSTATUS; stdcall;
  7912. TFNRtlCutoverTimeToSystemTime = function (TargetTimeFields: PTIME_FIELDS; Time: PLARGE_INTEGER; CurrentTime: PLARGE_INTEGER; bUnknown: BOOLEAN): BOOLEAN; stdcall;
  7913. TFNRtlDeNormalizeProcessParams = function (ProcessParameters: PRTL_USER_PROCESS_PARAMETERS): PRTL_USER_PROCESS_PARAMETERS; stdcall;
  7914. TFNRtlDeleteAce = function (pAcl: PACL; dwAceIndex: DWORD): NTSTATUS; stdcall;
  7915. TFNRtlDeleteCriticalSection = procedure(lpCriticalSection: PRTL_CRITICAL_SECTION); stdcall;
  7916. TFNRtlDeleteOwnersRanges = function (RangeList: PRTL_RANGE_LIST; Owner: PVOID): NTSTATUS; stdcall;
  7917. TFNRtlDeleteRange = function (RangeList: PRTL_RANGE_LIST; Start: ULONGLONG; End_: ULONGLONG; Owner: PVOID): NTSTATUS; stdcall;
  7918. TFNRtlDeleteRegistryValue = function (RelativeTo: ULONG; Path: LPCWSTR; ValueName: LPCWSTR): NTSTATUS; stdcall;
  7919. TFNRtlDestroyHeap = function (HeapHandle: HANDLE): HANDLE; stdcall;
  7920. TFNRtlDestroyProcessParameters = function (ProcessParameters: PRTL_USER_PROCESS_PARAMETERS): NTSTATUS; stdcall;
  7921. TFNRtlDestroyQueryDebugBuffer = function (DebugBuffer: PDEBUG_BUFFER): NTSTATUS; stdcall;
  7922. TFNRtlDetermineDosPathNameType_U = function (wcsPathNameType: PWSTR): ULONG; stdcall;
  7923. TFNRtlDnsHostNameToComputerName = function (ComputerName: PUNICODE_STRING; DnsName: PUNICODE_STRING; AllocateComputerNameString: BOOLEAN): NTSTATUS; stdcall;
  7924. TFNRtlDoesFileExists_U = function (FileName: PWSTR): BOOLEAN; stdcall;
  7925. TFNRtlDosPathNameToNtPathName_U = function (DosName: PWSTR; var NtName: UNICODE_STRING; DosFilePath: PPWSTR; NtFilePath: PUNICODE_STRING): BOOLEAN; stdcall;
  7926. TFNRtlDosSearchPath_U = function (SearchPath: PWSTR; Name: PWSTR; Ext: PWSTR; cbBuf: ULONG; Buffer: PWSTR; var Shortname: PWSTR): ULONG; stdcall;
  7927. TFNRtlDowncaseUnicodeChar = function (Source: WCHAR): WCHAR; stdcall;
  7928. TFNRtlDowncaseUnicodeString = function (DestinationString: PUNICODE_STRING; SourceString: PUNICODE_STRING; AllocateDestinationString: BOOLEAN): NTSTATUS; stdcall;
  7929. TFNRtlDuplicateUnicodeString = function (AddTerminatingZero: ULONG; Source: PUNICODE_STRING; Destination: PUNICODE_STRING): NTSTATUS; stdcall;
  7930. TFNRtlEnableEarlyCriticalSectionEventCreation = procedure(); stdcall;
  7931. TFNRtlEnlargedIntegerMultiply = function (Multiplicand: LONG; Multiplier: LONG): LARGE_INTEGER; stdcall;
  7932. TFNRtlEnlargedUnsignedDivide = function (Dividend: ULARGE_INTEGER; Divisor: ULONG; Remainder: PULONG): ULONG; stdcall;
  7933. TFNRtlEnlargedUnsignedMultiply = function (Multiplicand: ULONG; Multiplier: ULONG): LARGE_INTEGER; stdcall;
  7934. TFNRtlEnterCriticalSection = procedure(lpCriticalSection: PRTL_CRITICAL_SECTION); stdcall;
  7935. TFNRtlEqualComputerName = function (String1: PUNICODE_STRING; String2: PUNICODE_STRING): BOOLEAN; stdcall;
  7936. TFNRtlEqualDomainName = function (String1: PUNICODE_STRING; String2: PUNICODE_STRING): BOOLEAN; stdcall;
  7937. TFNRtlEqualLuid = function (Luid1: PLUID; Luid2: PLUID): BOOLEAN; stdcall;
  7938. TFNRtlEqualPrefixSid = function (pSid1: PSID; pSid2: PSID): BOOLEAN; stdcall;
  7939. TFNRtlEqualSid = function (pSid1: PSID; pSid2: PSID): BOOLEAN; stdcall;
  7940. TFNRtlEqualString = function (String1: PSTRING; String2: PSTRING; CaseInsensitive: BOOLEAN): BOOLEAN; stdcall;
  7941. TFNRtlEqualUnicodeString = function (String1: PUNICODE_STRING; String2: PUNICODE_STRING; CaseInsensitive: BOOLEAN): BOOLEAN; stdcall;
  7942. TFNRtlEraseUnicodeString = procedure(Str: PUNICODE_STRING); stdcall;
  7943. TFNRtlExpandEnvironmentStrings_U = function (Environment: PVOID; Source: PUNICODE_STRING; Destination: PUNICODE_STRING; ReturnedLength: PULONG): NTSTATUS; stdcall;
  7944. TFNRtlExtendedIntegerMultiply = function (Multiplicand: LARGE_INTEGER; Multiplier: LONG): LARGE_INTEGER; stdcall;
  7945. TFNRtlExtendedLargeIntegerDivide = function (Dividend: LARGE_INTEGER; Divisor: ULONG; Remainder: PULONG): LARGE_INTEGER; stdcall;
  7946. TFNRtlExtendedMagicDivide = function (Dividend: LARGE_INTEGER; MagicDivisor: LARGE_INTEGER; ShiftCount: CCHAR): LARGE_INTEGER; stdcall;
  7947. TFNRtlFillMemory = procedure(Destination: PVOID; Length: SIZE_T; Fill: UCHAR); stdcall;
  7948. TFNRtlFillMemoryUlong = procedure(Destination: PVOID; Length: ULONG; Fill: ULONG); stdcall;
  7949. TFNRtlFindCharInUnicodeString = function (dwFlags: ULONG; UnicodeString: PUNICODE_STRING; CharactersToFind: PUNICODE_STRING; Positions: PUSHORT): NTSTATUS; stdcall;
  7950. TFNRtlFindClearBits = function (BitMapHeader: PRTL_BITMAP; NumberToFind: ULONG; HintIndex: ULONG): ULONG; stdcall;
  7951. TFNRtlFindClearBitsAndSet = function (BitMapHeader: PRTL_BITMAP; NumberToFind: ULONG; HintIndex: ULONG): ULONG; stdcall;
  7952. TFNRtlFindLastBackwardRunClear = function (BitMapHeader: PRTL_BITMAP; FromIndex: ULONG; StartingRunIndex: PULONG): ULONG; stdcall;
  7953. TFNRtlFindLeastSignificantBit = function (Set_: ULONGLONG): CCHAR; stdcall;
  7954. TFNRtlFindLongestRunClear = function (BitMapHeader: PRTL_BITMAP; StartingIndex: PULONG): ULONG; stdcall;
  7955. TFNRtlFindMostSignificantBit = function (Set_: ULONGLONG): CCHAR; stdcall;
  7956. TFNRtlFindNextForwardRunClear = function (BitMapHeader: PRTL_BITMAP; FromIndex: ULONG; StartingRunIndex: PULONG): ULONG; stdcall;
  7957. TFNRtlFindRange = function (RangeList: PRTL_RANGE_LIST; Minimum: ULONGLONG; Maximum: ULONGLONG; Length: ULONG; Alignment: ULONG; Flags: ULONG; AttributeAvailableMask: UCHAR; Context: PVOID; Callback: PRTL_CONFLICT_RANGE_CALLBACK;
  7958. Start: PULONGLONG): NTSTATUS; stdcall;
  7959. TFNRtlFindSetBits = function (BitMapHeader: PRTL_BITMAP; NumberToFind: ULONG; HintIndex: ULONG): ULONG; stdcall;
  7960. TFNRtlFindSetBitsAndClear = function (BitMapHeader: PRTL_BITMAP; NumberToFind: ULONG; HintIndex: ULONG): ULONG; stdcall;
  7961. TFNRtlFirstFreeAce = function (pAcl: PACL; var pAce: PVOID): BOOLEAN; stdcall;
  7962. TFNRtlFormatCurrentUserKeyPath = function (CurrentUserKeyPath: PUNICODE_STRING): NTSTATUS; stdcall;
  7963. TFNRtlFreeAnsiString = procedure(AnsiString: PANSI_STRING); stdcall;
  7964. TFNRtlFreeHeap = function (hHeap: HANDLE; dwFlags: ULONG; MemoryPointer: PVOID): BOOLEAN; stdcall;
  7965. TFNRtlFreeOemString = procedure(OemString: POEM_STRING); stdcall;
  7966. TFNRtlFreeRangeList = procedure(RangeList: PRTL_RANGE_LIST); stdcall;
  7967. TFNRtlFreeSid = function (pSid: PSID): PVOID; stdcall;
  7968. TFNRtlFreeUnicodeString = procedure(UnicodeString: PUNICODE_STRING); stdcall;
  7969. TFNRtlGUIDFromString = function (GuidString: PUNICODE_STRING; Guid: LPGUID): NTSTATUS; stdcall;
  7970. TFNRtlGetAce = function (pAcl: PACL; dwAceIndex: DWORD; var pAce: PVOID): NTSTATUS; stdcall;
  7971. TFNRtlGetCallersAddress = procedure(CallersAddress: PPVOID; CallersCaller: PPVOID); stdcall;
  7972. TFNRtlGetControlSecurityDescriptor = function (pSecurityDescriptor: PSECURITY_DESCRIPTOR; var Control: SECURITY_DESCRIPTOR_CONTROL; var dwRevision: DWORD): NTSTATUS; stdcall;
  7973. TFNRtlGetCurrentDirectory_U = function (MaximumLength: ULONG; Buffer: PWSTR): ULONG; stdcall;
  7974. TFNRtlGetCurrentPeb = function (): PPEB; stdcall;
  7975. TFNRtlGetDaclSecurityDescriptor = function (pSecurityDescriptor: PSECURITY_DESCRIPTOR; var bDaclPresent: BOOLEAN; var Dacl: PACL; var bDaclDefaulted: BOOLEAN): NTSTATUS; stdcall;
  7976. TFNRtlGetFirstRange = function (RangeList: PRTL_RANGE_LIST; Iterator: PRTL_RANGE_LIST_ITERATOR; var Range: PRTL_RANGE): NTSTATUS; stdcall;
  7977. TFNRtlGetFullPathName_U = function (DosName: PWSTR; Size: ULONG; Buf: PWSTR; var Shortname: PWSTR): ULONG; stdcall;
  7978. TFNRtlGetGroupSecurityDescriptor = function (pSecurityDescriptor: PSECURITY_DESCRIPTOR; var pGroup: PSID; var bGroupDefaulted: BOOLEAN): NTSTATUS; stdcall;
  7979. TFNRtlGetLastNtStatus = function (): NTSTATUS; stdcall;
  7980. TFNRtlGetLongestNtPathLength = function (): ULONG; stdcall;
  7981. TFNRtlGetNextRange = function (Iterator: PRTL_RANGE_LIST_ITERATOR; var Range: PRTL_RANGE; MoveForwards: BOOLEAN): NTSTATUS; stdcall;
  7982. TFNRtlGetNtGlobalFlags = function (): ULONG; stdcall;
  7983. TFNRtlGetNtProductType = function (var ProductType: ULONG): BOOLEAN; stdcall;
  7984. TFNRtlGetNtVersionNumbers = procedure(var dwMajorVersion: ULONG; var dwMinorVersion: ULONG; UnknownCanBeNull: PDWORD); stdcall;
  7985. TFNRtlGetOwnerSecurityDescriptor = function (pSecurityDescriptor: PSECURITY_DESCRIPTOR; var pOwner: PSID; var OwnerDefaulted: BOOLEAN): NTSTATUS; stdcall;
  7986. TFNRtlGetProcessHeaps = function (ArraySize: ULONG; HeapArray: PHANDLE): ULONG; stdcall;
  7987. TFNRtlGetSaclSecurityDescriptor = function (pSecurityDescriptor: PSECURITY_DESCRIPTOR; var bSaclPresent: BOOLEAN; var Sacl: PACL; var bSaclDefaulted: BOOLEAN): NTSTATUS; stdcall;
  7988. TFNRtlGetVersion = function (lpVersionInformation: PRTL_OSVERSIONINFOW): NTSTATUS; stdcall;
  7989. TFNRtlIdentifierAuthoritySid = function (Sid: PSID): PSID_IDENTIFIER_AUTHORITY; stdcall;
  7990. TFNRtlImageDirectoryEntryToData = function (ImageBase: HMODULE; MappedAsImage: BOOLEAN; DirectoryEntry: USHORT; Size: PULONG): PVOID; stdcall;
  7991. TFNRtlImageNtHeader = function (ImageBase: HMODULE): PIMAGE_NT_HEADERS; stdcall;
  7992. TFNRtlImageNtHeaderEx = function (dwFlags: DWORD; ImageBase: HMODULE): PIMAGE_NT_HEADERS; stdcall;
  7993. TFNRtlImageRvaToSection = function (NtHeaders: PIMAGE_NT_HEADERS; ImageBase: HMODULE; Rva: ULONG): PIMAGE_SECTION_HEADER; stdcall;
  7994. TFNRtlImageRvaToVa = function (NtHeaders: PIMAGE_NT_HEADERS; ImageBase: HMODULE; Rva: ULONG; var LastRvaSection: PIMAGE_SECTION_HEADER): PVOID; stdcall;
  7995. TFNRtlImpersonateSelf = function (ImpersonationLevel: SECURITY_IMPERSONATION_LEVEL): NTSTATUS; stdcall;
  7996. TFNRtlInitAnsiString = procedure(DestinationString: PANSI_STRING; SourceString: PCSZ); stdcall;
  7997. TFNRtlInitAnsiStringEx = function (DestinationString: PANSI_STRING; SourceString: PCSZ): NTSTATUS; stdcall;
  7998. TFNRtlInitString = procedure(DestinationString: PSTRING; SourceString: PCSZ); stdcall;
  7999. TFNRtlInitUnicodeString = procedure(DestinationString: PUNICODE_STRING; SourceString: LPCWSTR); stdcall;
  8000. TFNRtlInitUnicodeStringEx = function (DestinationString: PUNICODE_STRING; SourceString: LPCWSTR): NTSTATUS; stdcall;
  8001. TFNRtlInitializeBitMap = procedure(BitMapHeader: PRTL_BITMAP; BitMapBuffer: PULONG; SizeOfBitMap: ULONG); stdcall;
  8002. TFNRtlInitializeCriticalSection = function (lpCriticalSection: PRTL_CRITICAL_SECTION): NTSTATUS; stdcall;
  8003. TFNRtlInitializeCriticalSectionAndSpinCount = function (lpCriticalSection: PRTL_CRITICAL_SECTION; dwSpinCount: ULONG): NTSTATUS; stdcall;
  8004. TFNRtlInitializeRangeList = procedure(RangeList: PRTL_RANGE_LIST); stdcall;
  8005. TFNRtlInitializeSListHead = procedure(ListHead: PSLIST_HEADER); stdcall;
  8006. TFNRtlInitializeSid = function (pSid: PSID; pIdentifierAuthority: PSID_IDENTIFIER_AUTHORITY; nSubAuthorityCount: UCHAR): NTSTATUS; stdcall;
  8007. TFNRtlInt64ToUnicodeString = function (Value: ULONGLONG; Base: ULONG; Str: PUNICODE_STRING): NTSTATUS; stdcall;
  8008. TFNRtlIntegerToChar = function (Value: ULONG; Base: ULONG; Length: ULONG; Str: PCHAR): NTSTATUS; stdcall;
  8009. TFNRtlIntegerToUnicodeString = function (Value: ULONG; Base: ULONG; Str: PUNICODE_STRING): NTSTATUS; stdcall;
  8010. TFNRtlInterlockedFlushSList = function (ListHead: PSLIST_HEADER): PSLIST_ENTRY; stdcall;
  8011. TFNRtlInterlockedPopEntrySList = function (ListHead: PSLIST_HEADER): PSLIST_ENTRY; stdcall;
  8012. TFNRtlInterlockedPushEntrySList = function (ListHead: PSLIST_HEADER; ListEntry: PSLIST_ENTRY): PSLIST_ENTRY; stdcall;
  8013. TFNRtlInvertRangeList = function (InvertedRangeList: PRTL_RANGE_LIST; RangeList: PRTL_RANGE_LIST): NTSTATUS; stdcall;
  8014. TFNRtlIpv4AddressToStringA = function (IP: PULONG; Buffer: LPSTR): LPSTR; stdcall;
  8015. TFNRtlIpv4AddressToStringW = function (IP: PULONG; Buffer: LPWSTR): LPWSTR; stdcall;
  8016. TFNRtlIsDosDeviceName_U = function (TestString: LPCWSTR): ULONG; stdcall;
  8017. TFNRtlIsNameLegalDOS8Dot3 = function (Name: PUNICODE_STRING; OemName: POEM_STRING; NameContainsSpaces: PBOOLEAN): BOOLEAN; stdcall;
  8018. TFNRtlIsRangeAvailable = function (RangeList: PRTL_RANGE_LIST; Start: ULONGLONG; End_: ULONGLONG; Flags: ULONG; AttributeAvailableMask: UCHAR; Context: PVOID; Callback: PRTL_CONFLICT_RANGE_CALLBACK; Available: PBOOLEAN): NTSTATUS;
  8019. stdcall;
  8020. TFNRtlIsTextUnicode = function (lpBuffer: PVOID; cb: Integer; lpi: LPINT): BOOLEAN; stdcall;
  8021. TFNRtlLargeIntegerAdd = function (Addend1: LARGE_INTEGER; Addend2: LARGE_INTEGER): LARGE_INTEGER; stdcall;
  8022. TFNRtlLargeIntegerArithmeticShift = function (LargeInteger: LARGE_INTEGER; ShiftCount: CCHAR): LARGE_INTEGER; stdcall;
  8023. TFNRtlLargeIntegerDivide = function (Dividend: LARGE_INTEGER; Divisor: LARGE_INTEGER; Remainder: PLARGE_INTEGER): LARGE_INTEGER; stdcall;
  8024. TFNRtlLargeIntegerNegate = function (NegateThis: LARGE_INTEGER): LARGE_INTEGER; stdcall;
  8025. TFNRtlLargeIntegerShiftLeft = function (LargeInteger: LARGE_INTEGER; ShiftCount: CCHAR): LARGE_INTEGER; stdcall;
  8026. TFNRtlLargeIntegerShiftRight = function (LargeInteger: LARGE_INTEGER; ShiftCount: CCHAR): LARGE_INTEGER; stdcall;
  8027. TFNRtlLargeIntegerSubtract = function (Number: LARGE_INTEGER; Subtrahend: LARGE_INTEGER): LARGE_INTEGER; stdcall;
  8028. TFNRtlLargeIntegerToChar = function (Value: PLARGE_INTEGER; Base: ULONG; BufferLength: ULONG; Buffer: PCHAR): NTSTATUS; stdcall;
  8029. TFNRtlLeaveCriticalSection = procedure(lpCriticalSection: PRTL_CRITICAL_SECTION); stdcall;
  8030. TFNRtlLengthRequiredSid = function (nSubAuthorityCount: ULONG): ULONG; stdcall;
  8031. TFNRtlLengthSecurityDescriptor = function (SecurityDescriptor: PSECURITY_DESCRIPTOR): ULONG; stdcall;
  8032. TFNRtlLengthSid = function (pSid: PSID): ULONG; stdcall;
  8033. TFNRtlLocalTimeToSystemTime = function (LocalTime: PLARGE_INTEGER; SystemTime: PLARGE_INTEGER): NTSTATUS; stdcall;
  8034. TFNRtlLockHeap = function (hHeap: PVOID): BOOLEAN; stdcall;
  8035. TFNRtlMakeSelfRelativeSD = function (pAbsoluteSD: PSECURITY_DESCRIPTOR; pSelfRelativeSD: PSECURITY_DESCRIPTOR; lpdwBufferLength: LPDWORD): NTSTATUS; stdcall;
  8036. TFNRtlMapGenericMask = procedure(AccessMask: PACCESS_MASK; GenericMapping: PGENERIC_MAPPING); stdcall;
  8037. TFNRtlMapSecurityErrorToNtStatus = function (SecurityError: DWORD): NTSTATUS; stdcall;
  8038. TFNRtlMergeRangeLists = function (MergedRangeList: PRTL_RANGE_LIST; RangeList1: PRTL_RANGE_LIST; RangeList2: PRTL_RANGE_LIST; Flags: ULONG): NTSTATUS; stdcall;
  8039. TFNRtlMoveMemory = procedure(Destination: PVOID; Source: PVOID; Length: SIZE_T); stdcall;
  8040. TFNRtlNormalizeProcessParams = function (ProcessParameters: PRTL_USER_PROCESS_PARAMETERS): PRTL_USER_PROCESS_PARAMETERS; stdcall;
  8041. TFNRtlNtStatusToDosError = function (Status: NTSTATUS): ULONG; stdcall;
  8042. TFNRtlNtStatusToDosErrorNoTeb = function (Status: NTSTATUS): ULONG; stdcall;
  8043. TFNRtlNumberOfClearBits = function (BitMapHeader: PRTL_BITMAP): ULONG; stdcall;
  8044. TFNRtlNumberOfSetBits = function (BitMapHeader: PRTL_BITMAP): ULONG; stdcall;
  8045. TFNRtlOemStringToUnicodeSize = function (AnsiString: POEM_STRING): ULONG; stdcall;
  8046. TFNRtlOemStringToUnicodeString = function (DestinationString: PUNICODE_STRING; SourceString: POEM_STRING; AllocateDestinationString: BOOLEAN): NTSTATUS; stdcall;
  8047. TFNRtlOemToUnicodeN = function (UnicodeString: PWSTR; UnicodeSize: ULONG; var ResultSize: ULONG; OemString: PCHAR; OemSize: ULONG): NTSTATUS; stdcall;
  8048. TFNRtlOpenCurrentUser = function (samDesired: ACCESS_MASK; phkResult: PHKEY): NTSTATUS; stdcall;
  8049. TFNRtlPrefixString = function (String1: PANSI_STRING; String2: PANSI_STRING; CaseInsensitive: BOOLEAN): BOOLEAN; stdcall;
  8050. TFNRtlPrefixUnicodeString = function (String1: PUNICODE_STRING; String2: PUNICODE_STRING; CaseInsensitive: BOOLEAN): BOOLEAN; stdcall;
  8051. TFNRtlQueryDepthSList = function (ListHead: PSLIST_HEADER): USHORT; stdcall;
  8052. TFNRtlQueryEnvironmentVariable_U = function (Environment: PVOID; VarName: PUNICODE_STRING; VarValue: PUNICODE_STRING): NTSTATUS; stdcall;
  8053. TFNRtlQueryInformationAcl = function (pAcl: PACL; pAclInformation: PVOID; nAclInformationLength: DWORD; dwAclInformationClass: ACL_INFORMATION_CLASS): NTSTATUS; stdcall;
  8054. TFNRtlQueryProcessDebugInformation = function (ProcessId: ULONG; DebugInfoClassMask: ULONG; DebugBuffer: PDEBUG_BUFFER): NTSTATUS; stdcall;
  8055. TFNRtlQueryRegistryValues = function (RelativeTo: ULONG; Path: LPCWSTR; QueryTable: PRTL_QUERY_REGISTRY_TABLE; Context: PVOID; Environment: PVOID): NTSTATUS; stdcall;
  8056. TFNRtlRaiseStatus = procedure(Status: NTSTATUS); stdcall;
  8057. TFNRtlRandom = function (Seed: PULONG): ULONG; stdcall;
  8058. TFNRtlRandomEx = function (Seed: PULONG): ULONG; stdcall;
  8059. TFNRtlReAllocateHeap = function (hHeap: HANDLE; dwFlags: ULONG; lpMem: PVOID; dwBytes: SIZE_T): PVOID; stdcall;
  8060. TFNRtlReleasePebLock = procedure(); stdcall;
  8061. TFNRtlRemoveVectoredExceptionHandler = function (VectoredHandlerHandle: PVOID): ULONG; stdcall;
  8062. TFNRtlRestoreLastWin32Error = procedure(dwErrCode: DWORD); stdcall;
  8063. TFNRtlRunDecodeUnicodeString = procedure(CodeSeed: UCHAR; StringToDecode: PUNICODE_STRING); stdcall;
  8064. TFNRtlRunEncodeUnicodeString = procedure(var CodeSeed: UCHAR; StringToEncode: PUNICODE_STRING); stdcall;
  8065. TFNRtlSecondsSince1970ToTime = procedure(SecondsSince1970: ULONG; Time: PLARGE_INTEGER); stdcall;
  8066. TFNRtlSecondsSince1980ToTime = procedure(SecondsSince1980: ULONG; Time: PLARGE_INTEGER); stdcall;
  8067. TFNRtlSelfRelativeToAbsoluteSD = function (pSelfRelativeSD: PSECURITY_DESCRIPTOR; pAbsoluteSD: PSECURITY_DESCRIPTOR; lpdwAbsoluteSDSize: LPDWORD; pDacl: PACL; lpdwDaclSize: LPDWORD; pSacl: PACL; lpdwSaclSize: LPDWORD; pOwner: PSID;
  8068. lpdwOwnerSize: LPDWORD; pPrimaryGroup: PSID; lpdwPrimaryGroupSize: LPDWORD): NTSTATUS; stdcall;
  8069. TFNRtlSetAllBits = procedure(BitMapHeader: PRTL_BITMAP); stdcall;
  8070. TFNRtlSetBits = procedure(BitMapHeader: PRTL_BITMAP; StartingIndex: ULONG; NumberToSet: ULONG); stdcall;
  8071. TFNRtlSetControlSecurityDescriptor = function (pSecurityDescriptor: PSECURITY_DESCRIPTOR; ControlBitsOfInterest: SECURITY_DESCRIPTOR_CONTROL; ControlBitsToSet: SECURITY_DESCRIPTOR_CONTROL): NTSTATUS; stdcall;
  8072. TFNRtlSetCriticalSectionSpinCount = function (lpCriticalSection: PRTL_CRITICAL_SECTION; dwSpinCount: ULONG): DWORD; stdcall;
  8073. TFNRtlSetCurrentDirectory_U = function (NewCurrentDirectory: PUNICODE_STRING): NTSTATUS; stdcall;
  8074. TFNRtlSetDaclSecurityDescriptor = function (SecurityDescriptor: PSECURITY_DESCRIPTOR; DaclPresent: BOOLEAN; Dacl: PACL; DaclDefaulted: BOOLEAN): NTSTATUS; stdcall;
  8075. TFNRtlSetGroupSecurityDescriptor = function (pSecurityDescriptor: PSECURITY_DESCRIPTOR; pGroup: PSID; bGroupDefaulted: BOOLEAN): NTSTATUS; stdcall;
  8076. TFNRtlSetInformationAcl = function (pAcl: PACL; pAclInformation: PVOID; nInformationLength: DWORD; dwAclInformationClass: ACL_INFORMATION_CLASS): NTSTATUS; stdcall;
  8077. TFNRtlSetLastWin32ErrorAndNtStatusFromNtStatus = function (Status: NTSTATUS): ULONG; stdcall;
  8078. TFNRtlSetOwnerSecurityDescriptor = function (pSecurityDescriptor: PSECURITY_DESCRIPTOR; pOwner: PSID; bOwnerDefaulted: BOOLEAN): NTSTATUS; stdcall;
  8079. TFNRtlSetProcessIsCritical = function (bIsCritical: BOOLEAN; pbOldIsCriticalValue: PBOOLEAN; bUnknownCanBeFalse: BOOLEAN): NTSTATUS; stdcall;
  8080. TFNRtlSetSaclSecurityDescriptor = function (pSecurityDescriptor: PSECURITY_DESCRIPTOR; bSaclPresent: BOOLEAN; pSacl: PACL; SaclDefaulted: BOOLEAN): NTSTATUS; stdcall;
  8081. TFNRtlSetThreadIsCritical = function (bIsCritical: BOOLEAN; pbOldIsCriticalValue: PBOOLEAN; bUnknownCanBeFalse: BOOLEAN): NTSTATUS; stdcall;
  8082. TFNRtlSizeHeap = function (hHeap: HANDLE; dwFlags: ULONG; lpMem: PVOID): SIZE_T; stdcall;
  8083. TFNRtlStringFromGUID = function (Guid: REFGUID; GuidString: PUNICODE_STRING): NTSTATUS; stdcall;
  8084. TFNRtlSubAuthorityCountSid = function (pSid: PSID): PUCHAR; stdcall;
  8085. TFNRtlSubAuthoritySid = function (pSid: PSID; nSubAuthority: DWORD): PDWORD; stdcall;
  8086. TFNRtlSystemTimeToLocalTime = function (SystemTime: PLARGE_INTEGER; LocalTime: PLARGE_INTEGER): NTSTATUS; stdcall;
  8087. TFNRtlTimeFieldsToTime = function (TimeFields: PTIME_FIELDS; Time: PLARGE_INTEGER): BOOLEAN; stdcall;
  8088. TFNRtlTimeToElapsedTimeFields = procedure(Time: PLARGE_INTEGER; TimeFields: PTIME_FIELDS); stdcall;
  8089. TFNRtlTimeToSecondsSince1970 = function (Time: PLARGE_INTEGER; ElapsedSeconds: PULONG): BOOLEAN; stdcall;
  8090. TFNRtlTimeToSecondsSince1980 = function (Time: PLARGE_INTEGER; ElapsedSeconds: PULONG): BOOLEAN; stdcall;
  8091. TFNRtlTimeToTimeFields = procedure(Time: PLARGE_INTEGER; TimeFields: PTIME_FIELDS); stdcall;
  8092. TFNRtlTryEnterCriticalSection = function (lpCriticalSection: PRTL_CRITICAL_SECTION): BOOL; stdcall;
  8093. TFNRtlUnicodeStringToAnsiSize = function (UnicodeString: PUNICODE_STRING): ULONG; stdcall;
  8094. TFNRtlUnicodeStringToAnsiString = function (DestinationString: PANSI_STRING; SourceString: PUNICODE_STRING; AllocateDestinationString: BOOLEAN): NTSTATUS; stdcall;
  8095. TFNRtlUnicodeStringToCountedOemString = function (DestinationString: POEM_STRING; SourceString: PUNICODE_STRING; AllocateDestinationString: BOOLEAN): NTSTATUS; stdcall;
  8096. TFNRtlUnicodeStringToInteger = function (Str: PUNICODE_STRING; Base: ULONG; Value: PULONG): NTSTATUS; stdcall;
  8097. TFNRtlUnicodeStringToOemSize = function (UnicodeString: PUNICODE_STRING): ULONG; stdcall;
  8098. TFNRtlUnicodeStringToOemString = function (DestinationString: POEM_STRING; SourceString: PCUNICODE_STRING; AllocateDestinationString: BOOLEAN): NTSTATUS; stdcall;
  8099. TFNRtlUnicodeToMultiByteSize = function (BytesInMultiByteString: PULONG; UnicodeString: PWSTR; BytesInUnicodeString: ULONG): NTSTATUS; stdcall;
  8100. TFNRtlUniform = function (Seed: PULONG): ULONG; stdcall;
  8101. TFNRtlUnwind = procedure(TargetFrame: PVOID; TargetIp: PVOID; ExceptionRecord: PEXCEPTION_RECORD; ReturnValue: PVOID); stdcall;
  8102. TFNRtlUpcaseUnicodeChar = function (SourceCharacter: WCHAR): WCHAR; stdcall;
  8103. TFNRtlUpcaseUnicodeString = function (DestinationString: PUNICODE_STRING; SourceString: PUNICODE_STRING; AllocateDestinationString: BOOLEAN): NTSTATUS; stdcall;
  8104. TFNRtlUpcaseUnicodeStringToAnsiString = function (DestinationString: PSTRING; SourceString: PUNICODE_STRING; AllocateDestinationString: BOOLEAN): NTSTATUS; stdcall;
  8105. TFNRtlUpcaseUnicodeStringToCountedOemString = function (DestinationString: PSTRING; SourceString: PUNICODE_STRING; AllocateDestinationString: BOOLEAN): NTSTATUS; stdcall;
  8106. TFNRtlUpcaseUnicodeStringToOemString = function (DestinationString: PSTRING; SourceString: PUNICODE_STRING; AllocateDestinationString: BOOLEAN): NTSTATUS; stdcall;
  8107. TFNRtlUpcaseUnicodeToMultiByteN = function (MbString: PCHAR; MbSize: ULONG; var ResultSize: ULONG; UnicodeString: PWSTR; UnicodeSize: ULONG): NTSTATUS; stdcall;
  8108. TFNRtlUpcaseUnicodeToOemN = function (OemString: PCHAR; OemSize: ULONG; var ResultSize: ULONG; UnicodeString: PWSTR; UnicodeSize: ULONG): NTSTATUS; stdcall;
  8109. TFNRtlUpperChar = function (Character: CHAR): CHAR; stdcall;
  8110. TFNRtlUpperString = procedure(DestinationString: PSTRING; SourceString: PSTRING); stdcall;
  8111. TFNRtlValidAcl = function (Acl: PACL): BOOLEAN; stdcall;
  8112. TFNRtlValidRelativeSecurityDescriptor = function (SecurityDescriptorInput: PSECURITY_DESCRIPTOR; SecurityDescriptorLength: ULONG; RequiredInformation: SECURITY_INFORMATION): BOOLEAN; stdcall;
  8113. TFNRtlValidSecurityDescriptor = function (SecurityDescriptor: PSECURITY_DESCRIPTOR): BOOLEAN; stdcall;
  8114. TFNRtlValidSid = function (pSid: PSID): BOOLEAN; stdcall;
  8115. TFNRtlValidateHeap = function (hHeap: HANDLE; dwFlags: ULONG; lpMem: LPCVOID): BOOL; stdcall;
  8116. TFNRtlValidateUnicodeString = function (dwMustBeNull: ULONG; ValidateThis: PUNICODE_STRING): NTSTATUS; stdcall;
  8117. TFNRtlVerifyVersionInfo = function (VersionInfo: PRTL_OSVERSIONINFOEXW; TypeMask: ULONG; ConditionMask: ULONGLONG): NTSTATUS; stdcall;
  8118. TFNRtlVolumeDeviceToDosName = function (VolumeDeviceObject: PVOID; DosName: PUNICODE_STRING): NTSTATUS; stdcall;
  8119. TFNRtlWriteRegistryValue = function (RelativeTo: ULONG; Path: LPCWSTR; ValueName: LPCWSTR; ValueType: ULONG; ValueData: PVOID; ValueLength: ULONG): NTSTATUS; stdcall;
  8120. TFNRtlZeroHeap = function (hHeap: HANDLE; dwFlags: ULONG): BOOLEAN; stdcall;
  8121. TFNRtlZeroMemory = procedure(Destination: PVOID; Length: SIZE_T); stdcall;
  8122. TFNRtlpNotOwnerCriticalSection = function (lpCriticalSection: PRTL_CRITICAL_SECTION): BOOLEAN; stdcall;
  8123. TFNRtlpNtCreateKey = function (KeyHandle: PHANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; Unused1: ULONG; Unused2: ULONG; Disposition: PULONG): NTSTATUS; stdcall;
  8124. TFNRtlpNtEnumerateSubKey = function (KeyHandle: HANDLE; SubKeyName: PUNICODE_STRING; Index: ULONG; Unused1: ULONG): NTSTATUS; stdcall;
  8125. TFNRtlpNtMakeTemporaryKey = function (KeyHandle: HANDLE): NTSTATUS; stdcall;
  8126. TFNRtlpNtOpenKey = function (KeyHandle: HANDLE; DesiredAccess: ACCESS_MASK; ObjectAttributes: POBJECT_ATTRIBUTES; Unused: ULONG): NTSTATUS; stdcall;
  8127. TFNRtlpNtQueryValueKey = function (KeyHandle: HANDLE; Type_: PULONG; Data: PVOID; DataSize: PULONG; Unused: ULONG): NTSTATUS; stdcall;
  8128. TFNRtlpNtSetValueKey = function (KeyHandle: HANDLE; Type_: ULONG; Data: PVOID; DataSize: ULONG): NTSTATUS; stdcall;
  8129. TFNRtlxAnsiStringToUnicodeSize = function (AnsiString: PANSI_STRING): ULONG; stdcall;
  8130. TFNRtlxOemStringToUnicodeSize = function (AnsiString: POEM_STRING): ULONG; stdcall;
  8131. TFNRtlxUnicodeStringToAnsiSize = function (UnicodeString: PUNICODE_STRING): ULONG; stdcall;
  8132. TFNRtlxUnicodeStringToOemSize = function (UnicodeString: PUNICODE_STRING): ULONG; stdcall;
  8133. TFNVerSetConditionMask = function (ConditionMask: ULONGLONG; dwTypeMask: DWORD; Condition: BYTE): ULONGLONG; stdcall;
  8134. TFNZwAcceptConnectPort = TFNNtAcceptConnectPort;
  8135. TFNZwAccessCheck = TFNNtAccessCheck;
  8136. TFNZwAccessCheckAndAuditAlarm = TFNNtAccessCheckAndAuditAlarm;
  8137. TFNZwAccessCheckByType = TFNNtAccessCheckByType;
  8138. TFNZwAccessCheckByTypeAndAuditAlarm = TFNNtAccessCheckByTypeAndAuditAlarm;
  8139. TFNZwAccessCheckByTypeResultList = TFNNtAccessCheckByTypeResultList;
  8140. TFNZwAccessCheckByTypeResultListAndAuditAlarm = TFNNtAccessCheckByTypeResultListAndAuditAlarm;
  8141. TFNZwAccessCheckByTypeResultListAndAuditAlarmByHandle = TFNNtAccessCheckByTypeResultListAndAuditAlarmByHandle;
  8142. TFNZwAddAtom = TFNNtAddAtom;
  8143. TFNZwAdjustGroupsToken = TFNNtAdjustGroupsToken;
  8144. TFNZwAdjustPrivilegesToken = TFNNtAdjustPrivilegesToken;
  8145. TFNZwAlertResumeThread = TFNNtAlertResumeThread;
  8146. TFNZwAlertThread = TFNNtAlertThread;
  8147. TFNZwAllocateLocallyUniqueId = TFNNtAllocateLocallyUniqueId;
  8148. TFNZwAllocateUserPhysicalPages = TFNNtAllocateUserPhysicalPages;
  8149. TFNZwAllocateUuids = TFNNtAllocateUuids;
  8150. TFNZwAllocateVirtualMemory = TFNNtAllocateVirtualMemory;
  8151. TFNZwAreMappedFilesTheSame = TFNNtAreMappedFilesTheSame;
  8152. TFNZwAssignProcessToJobObject = TFNNtAssignProcessToJobObject;
  8153. TFNZwCallbackReturn = TFNNtCallbackReturn;
  8154. TFNZwCancelDeviceWakeupRequest = TFNNtCancelDeviceWakeupRequest;
  8155. TFNZwCancelIoFile = TFNNtCancelIoFile;
  8156. TFNZwCancelTimer = TFNNtCancelTimer;
  8157. TFNZwClearEvent = TFNNtClearEvent;
  8158. TFNZwClose = TFNNtClose;
  8159. TFNZwCloseObjectAuditAlarm = TFNNtCloseObjectAuditAlarm;
  8160. TFNZwCompleteConnectPort = TFNNtCompleteConnectPort;
  8161. TFNZwConnectPort = TFNNtConnectPort;
  8162. TFNZwContinue = TFNNtContinue;
  8163. TFNZwCreateChannel = TFNNtCreateChannel;
  8164. TFNZwCreateDirectoryObject = TFNNtCreateDirectoryObject;
  8165. TFNZwCreateEvent = TFNNtCreateEvent;
  8166. TFNZwCreateEventPair = TFNNtCreateEventPair;
  8167. TFNZwCreateFile = TFNNtCreateFile;
  8168. TFNZwCreateIoCompletion = TFNNtCreateIoCompletion;
  8169. TFNZwCreateJobObject = TFNNtCreateJobObject;
  8170. TFNZwCreateKey = TFNNtCreateKey;
  8171. TFNZwCreateMailslotFile = TFNNtCreateMailslotFile;
  8172. TFNZwCreateMutant = TFNNtCreateMutant;
  8173. TFNZwCreateNamedPipeFile = TFNNtCreateNamedPipeFile;
  8174. TFNZwCreatePagingFile = TFNNtCreatePagingFile;
  8175. TFNZwCreatePort = TFNNtCreatePort;
  8176. TFNZwCreateProcess = TFNNtCreateProcess;
  8177. TFNZwCreateProfile = TFNNtCreateProfile;
  8178. TFNZwCreateSection = TFNNtCreateSection;
  8179. TFNZwCreateSemaphore = TFNNtCreateSemaphore;
  8180. TFNZwCreateSymbolicLinkObject = TFNNtCreateSymbolicLinkObject;
  8181. TFNZwCreateThread = TFNNtCreateThread;
  8182. TFNZwCreateTimer = TFNNtCreateTimer;
  8183. TFNZwCreateToken = TFNNtCreateToken;
  8184. TFNZwCreateWaitablePort = TFNNtCreateWaitablePort;
  8185. TFNZwCurrentTeb = TFNNtCurrentTeb;
  8186. TFNZwDebugActiveProcess = TFNNtDebugActiveProcess;
  8187. TFNZwDelayExecution = TFNNtDelayExecution;
  8188. TFNZwDeleteAtom = TFNNtDeleteAtom;
  8189. TFNZwDeleteFile = TFNNtDeleteFile;
  8190. TFNZwDeleteKey = TFNNtDeleteKey;
  8191. TFNZwDeleteObjectAuditAlarm = TFNNtDeleteObjectAuditAlarm;
  8192. TFNZwDeleteValueKey = TFNNtDeleteValueKey;
  8193. TFNZwDeviceIoControlFile = TFNNtDeviceIoControlFile;
  8194. TFNZwDisplayString = TFNNtDisplayString;
  8195. TFNZwDuplicateObject = TFNNtDuplicateObject;
  8196. TFNZwDuplicateToken = TFNNtDuplicateToken;
  8197. TFNZwEnumerateKey = TFNNtEnumerateKey;
  8198. TFNZwEnumerateValueKey = TFNNtEnumerateValueKey;
  8199. TFNZwExtendSection = TFNNtExtendSection;
  8200. TFNZwFilterToken = TFNNtFilterToken;
  8201. TFNZwFindAtom = TFNNtFindAtom;
  8202. TFNZwFlushBuffersFile = TFNNtFlushBuffersFile;
  8203. TFNZwFlushInstructionCache = TFNNtFlushInstructionCache;
  8204. TFNZwFlushKey = TFNNtFlushKey;
  8205. TFNZwFlushVirtualMemory = TFNNtFlushVirtualMemory;
  8206. TFNZwFlushWriteBuffer = TFNNtFlushWriteBuffer;
  8207. TFNZwFreeUserPhysicalPages = TFNNtFreeUserPhysicalPages;
  8208. TFNZwFreeVirtualMemory = TFNNtFreeVirtualMemory;
  8209. TFNZwFsControlFile = TFNNtFsControlFile;
  8210. TFNZwGetContextThread = TFNNtGetContextThread;
  8211. TFNZwGetCurrentProcessorNumber = TFNNtGetCurrentProcessorNumber;
  8212. TFNZwGetDevicePowerState = TFNNtGetDevicePowerState;
  8213. TFNZwGetPlugPlayEvent = TFNNtGetPlugPlayEvent;
  8214. TFNZwGetTickCount = TFNNtGetTickCount;
  8215. TFNZwGetWriteWatch = TFNNtGetWriteWatch;
  8216. TFNZwImpersonateAnonymousToken = TFNNtImpersonateAnonymousToken;
  8217. TFNZwImpersonateClientOfPort = TFNNtImpersonateClientOfPort;
  8218. TFNZwImpersonateThread = TFNNtImpersonateThread;
  8219. TFNZwInitializeRegistry = TFNNtInitializeRegistry;
  8220. TFNZwInitiatePowerAction = TFNNtInitiatePowerAction;
  8221. TFNZwIsSystemResumeAutomatic = TFNNtIsSystemResumeAutomatic;
  8222. TFNZwListenChannel = TFNNtListenChannel;
  8223. TFNZwListenPort = TFNNtListenPort;
  8224. TFNZwLoadDriver = TFNNtLoadDriver;
  8225. TFNZwLoadKey = TFNNtLoadKey;
  8226. TFNZwLoadKey2 = TFNNtLoadKey2;
  8227. TFNZwLockFile = TFNNtLockFile;
  8228. TFNZwLockVirtualMemory = TFNNtLockVirtualMemory;
  8229. TFNZwMakePermanentObject = TFNNtMakePermanentObject;
  8230. TFNZwMakeTemporaryObject = TFNNtMakeTemporaryObject;
  8231. TFNZwMapUserPhysicalPages = TFNNtMapUserPhysicalPages;
  8232. TFNZwMapUserPhysicalPagesScatter = TFNNtMapUserPhysicalPagesScatter;
  8233. TFNZwMapViewOfSection = TFNNtMapViewOfSection;
  8234. TFNZwNotifyChangeDirectoryFile = TFNNtNotifyChangeDirectoryFile;
  8235. TFNZwNotifyChangeKey = TFNNtNotifyChangeKey;
  8236. TFNZwNotifyChangeMultipleKeys = TFNNtNotifyChangeMultipleKeys;
  8237. TFNZwOpenChannel = TFNNtOpenChannel;
  8238. TFNZwOpenDirectoryObject = TFNNtOpenDirectoryObject;
  8239. TFNZwOpenEvent = TFNNtOpenEvent;
  8240. TFNZwOpenEventPair = TFNNtOpenEventPair;
  8241. TFNZwOpenFile = TFNNtOpenFile;
  8242. TFNZwOpenIoCompletion = TFNNtOpenIoCompletion;
  8243. TFNZwOpenJobObject = TFNNtOpenJobObject;
  8244. TFNZwOpenKey = TFNNtOpenKey;
  8245. TFNZwOpenMutant = TFNNtOpenMutant;
  8246. TFNZwOpenObjectAuditAlarm = TFNNtOpenObjectAuditAlarm;
  8247. TFNZwOpenProcess = TFNNtOpenProcess;
  8248. TFNZwOpenProcessToken = TFNNtOpenProcessToken;
  8249. TFNZwOpenSection = TFNNtOpenSection;
  8250. TFNZwOpenSemaphore = TFNNtOpenSemaphore;
  8251. TFNZwOpenSymbolicLinkObject = TFNNtOpenSymbolicLinkObject;
  8252. TFNZwOpenThread = TFNNtOpenThread;
  8253. TFNZwOpenThreadToken = TFNNtOpenThreadToken;
  8254. TFNZwOpenTimer = TFNNtOpenTimer;
  8255. TFNZwPlugPlayControl = TFNNtPlugPlayControl;
  8256. TFNZwPowerInformation = TFNNtPowerInformation;
  8257. TFNZwPrivilegeCheck = TFNNtPrivilegeCheck;
  8258. TFNZwPrivilegeObjectAuditAlarm = TFNNtPrivilegeObjectAuditAlarm;
  8259. TFNZwPrivilegedServiceAuditAlarm = TFNNtPrivilegedServiceAuditAlarm;
  8260. TFNZwProtectVirtualMemory = TFNNtProtectVirtualMemory;
  8261. TFNZwPulseEvent = TFNNtPulseEvent;
  8262. TFNZwQueryAttributesFile = TFNNtQueryAttributesFile;
  8263. TFNZwQueryDefaultLocale = TFNNtQueryDefaultLocale;
  8264. TFNZwQueryDefaultUILanguage = TFNNtQueryDefaultUILanguage;
  8265. TFNZwQueryDirectoryFile = TFNNtQueryDirectoryFile;
  8266. TFNZwQueryDirectoryObject = TFNNtQueryDirectoryObject;
  8267. TFNZwQueryEaFile = TFNNtQueryEaFile;
  8268. TFNZwQueryEvent = TFNNtQueryEvent;
  8269. TFNZwQueryFullAttributesFile = TFNNtQueryFullAttributesFile;
  8270. TFNZwQueryInformationAtom = TFNNtQueryInformationAtom;
  8271. TFNZwQueryInformationFile = TFNNtQueryInformationFile;
  8272. TFNZwQueryInformationJobObject = TFNNtQueryInformationJobObject;
  8273. TFNZwQueryInformationPort = TFNNtQueryInformationPort;
  8274. TFNZwQueryInformationProcess = TFNNtQueryInformationProcess;
  8275. TFNZwQueryInformationThread = TFNNtQueryInformationThread;
  8276. TFNZwQueryInformationToken = TFNNtQueryInformationToken;
  8277. TFNZwQueryInstallUILanguage = TFNNtQueryInstallUILanguage;
  8278. TFNZwQueryIntervalProfile = TFNNtQueryIntervalProfile;
  8279. TFNZwQueryIoCompletion = TFNNtQueryIoCompletion;
  8280. TFNZwQueryKey = TFNNtQueryKey;
  8281. TFNZwQueryMultipleValueKey = TFNNtQueryMultipleValueKey;
  8282. TFNZwQueryMutant = TFNNtQueryMutant;
  8283. TFNZwQueryObject = TFNNtQueryObject;
  8284. TFNZwQueryOpenSubKeys = TFNNtQueryOpenSubKeys;
  8285. TFNZwQueryPerformanceCounter = TFNNtQueryPerformanceCounter;
  8286. TFNZwQueryPortInformationProcess = TFNNtQueryPortInformationProcess;
  8287. TFNZwQueryQuotaInformationFile = TFNNtQueryQuotaInformationFile;
  8288. TFNZwQuerySection = TFNNtQuerySection;
  8289. TFNZwQuerySecurityObject = TFNNtQuerySecurityObject;
  8290. TFNZwQuerySemaphore = TFNNtQuerySemaphore;
  8291. TFNZwQuerySymbolicLinkObject = TFNNtQuerySymbolicLinkObject;
  8292. TFNZwQuerySystemEnvironmentValue = TFNNtQuerySystemEnvironmentValue;
  8293. TFNZwQuerySystemInformation = TFNNtQuerySystemInformation;
  8294. TFNZwQuerySystemTime = TFNNtQuerySystemTime;
  8295. TFNZwQueryTimer = TFNNtQueryTimer;
  8296. TFNZwQueryTimerResolution = TFNNtQueryTimerResolution;
  8297. TFNZwQueryValueKey = TFNNtQueryValueKey;
  8298. TFNZwQueryVirtualMemory = TFNNtQueryVirtualMemory;
  8299. TFNZwQueryVolumeInformationFile = TFNNtQueryVolumeInformationFile;
  8300. TFNZwQueueApcThread = TFNNtQueueApcThread;
  8301. TFNZwRaiseException = TFNNtRaiseException;
  8302. TFNZwRaiseHardError = TFNNtRaiseHardError;
  8303. TFNZwReadFile = TFNNtReadFile;
  8304. TFNZwReadFileScatter = TFNNtReadFileScatter;
  8305. TFNZwReadRequestData = TFNNtReadRequestData;
  8306. TFNZwReadVirtualMemory = TFNNtReadVirtualMemory;
  8307. TFNZwRegisterThreadTerminatePort = TFNNtRegisterThreadTerminatePort;
  8308. TFNZwReleaseMutant = TFNNtReleaseMutant;
  8309. TFNZwReleaseSemaphore = TFNNtReleaseSemaphore;
  8310. TFNZwRemoveIoCompletion = TFNNtRemoveIoCompletion;
  8311. TFNZwRemoveProcessDebug = TFNNtRemoveProcessDebug;
  8312. TFNZwReplaceKey = TFNNtReplaceKey;
  8313. TFNZwReplyPort = TFNNtReplyPort;
  8314. TFNZwReplyWaitReceivePort = TFNNtReplyWaitReceivePort;
  8315. TFNZwReplyWaitReceivePortEx = TFNNtReplyWaitReceivePortEx;
  8316. TFNZwReplyWaitReplyPort = TFNNtReplyWaitReplyPort;
  8317. TFNZwReplyWaitSendChannel = TFNNtReplyWaitSendChannel;
  8318. TFNZwRequestDeviceWakeup = TFNNtRequestDeviceWakeup;
  8319. TFNZwRequestPort = TFNNtRequestPort;
  8320. TFNZwRequestWaitReplyPort = TFNNtRequestWaitReplyPort;
  8321. TFNZwRequestWakeupLatency = TFNNtRequestWakeupLatency;
  8322. TFNZwResetEvent = TFNNtResetEvent;
  8323. TFNZwResetWriteWatch = TFNNtResetWriteWatch;
  8324. TFNZwRestoreKey = TFNNtRestoreKey;
  8325. TFNZwResumeProcess = TFNNtResumeProcess;
  8326. TFNZwResumeThread = TFNNtResumeThread;
  8327. TFNZwSaveKey = TFNNtSaveKey;
  8328. TFNZwSaveKeyEx = TFNNtSaveKeyEx;
  8329. TFNZwSaveMergedKeys = TFNNtSaveMergedKeys;
  8330. TFNZwSecureConnectPort = TFNNtSecureConnectPort;
  8331. TFNZwSendWaitReplyChannel = TFNNtSendWaitReplyChannel;
  8332. TFNZwSetContextChannel = TFNNtSetContextChannel;
  8333. TFNZwSetContextThread = TFNNtSetContextThread;
  8334. TFNZwSetDefaultHardErrorPort = TFNNtSetDefaultHardErrorPort;
  8335. TFNZwSetDefaultLocale = TFNNtSetDefaultLocale;
  8336. TFNZwSetDefaultUILanguage = TFNNtSetDefaultUILanguage;
  8337. TFNZwSetEaFile = TFNNtSetEaFile;
  8338. TFNZwSetEvent = TFNNtSetEvent;
  8339. TFNZwSetHighEventPair = TFNNtSetHighEventPair;
  8340. TFNZwSetHighWaitLowEventPair = TFNNtSetHighWaitLowEventPair;
  8341. TFNZwSetHighWaitLowThread = TFNNtSetHighWaitLowThread;
  8342. TFNZwSetInformationFile = TFNNtSetInformationFile;
  8343. TFNZwSetInformationJobObject = TFNNtSetInformationJobObject;
  8344. TFNZwSetInformationKey = TFNNtSetInformationKey;
  8345. TFNZwSetInformationObject = TFNNtSetInformationObject;
  8346. TFNZwSetInformationProcess = TFNNtSetInformationProcess;
  8347. TFNZwSetInformationThread = TFNNtSetInformationThread;
  8348. TFNZwSetInformationToken = TFNNtSetInformationToken;
  8349. TFNZwSetIntervalProfile = TFNNtSetIntervalProfile;
  8350. TFNZwSetIoCompletion = TFNNtSetIoCompletion;
  8351. TFNZwSetLdtEntries = TFNNtSetLdtEntries;
  8352. TFNZwSetLowEventPair = TFNNtSetLowEventPair;
  8353. TFNZwSetLowWaitHighEventPair = TFNNtSetLowWaitHighEventPair;
  8354. TFNZwSetLowWaitHighThread = TFNNtSetLowWaitHighThread;
  8355. TFNZwSetQuotaInformationFile = TFNNtSetQuotaInformationFile;
  8356. TFNZwSetSecurityObject = TFNNtSetSecurityObject;
  8357. TFNZwSetSystemEnvironmentValue = TFNNtSetSystemEnvironmentValue;
  8358. TFNZwSetSystemInformation = TFNNtSetSystemInformation;
  8359. TFNZwSetSystemPowerState = TFNNtSetSystemPowerState;
  8360. TFNZwSetSystemTime = TFNNtSetSystemTime;
  8361. TFNZwSetThreadExecutionState = TFNNtSetThreadExecutionState;
  8362. TFNZwSetTimer = TFNNtSetTimer;
  8363. TFNZwSetTimerResolution = TFNNtSetTimerResolution;
  8364. TFNZwSetUuidSeed = TFNNtSetUuidSeed;
  8365. TFNZwSetValueKey = TFNNtSetValueKey;
  8366. TFNZwSetVolumeInformationFile = TFNNtSetVolumeInformationFile;
  8367. TFNZwShutdownSystem = TFNNtShutdownSystem;
  8368. TFNZwSignalAndWaitForSingleObject = TFNNtSignalAndWaitForSingleObject;
  8369. TFNZwStartProfile = TFNNtStartProfile;
  8370. TFNZwStopProfile = TFNNtStopProfile;
  8371. TFNZwSuspendProcess = TFNNtSuspendProcess;
  8372. TFNZwSuspendThread = TFNNtSuspendThread;
  8373. TFNZwSystemDebugControl = TFNNtSystemDebugControl;
  8374. TFNZwTerminateJobObject = TFNNtTerminateJobObject;
  8375. TFNZwTerminateProcess = TFNNtTerminateProcess;
  8376. TFNZwTerminateThread = TFNNtTerminateThread;
  8377. TFNZwTestAlert = TFNNtTestAlert;
  8378. TFNZwUnloadDriver = TFNNtUnloadDriver;
  8379. TFNZwUnloadKey = TFNNtUnloadKey;
  8380. TFNZwUnlockFile = TFNNtUnlockFile;
  8381. TFNZwUnlockVirtualMemory = TFNNtUnlockVirtualMemory;
  8382. TFNZwUnmapViewOfSection = TFNNtUnmapViewOfSection;
  8383. TFNZwVdmControl = TFNNtVdmControl;
  8384. TFNZwW32Call = TFNNtW32Call;
  8385. TFNZwWaitForMultipleObjects = TFNNtWaitForMultipleObjects;
  8386. TFNZwWaitForSingleObject = TFNNtWaitForSingleObject;
  8387. TFNZwWaitHighEventPair = TFNNtWaitHighEventPair;
  8388. TFNZwWaitLowEventPair = TFNNtWaitLowEventPair;
  8389. TFNZwWriteFile = TFNNtWriteFile;
  8390. TFNZwWriteFileGather = TFNNtWriteFileGather;
  8391. TFNZwWriteRequestData = TFNNtWriteRequestData;
  8392. TFNZwWriteVirtualMemory = TFNNtWriteVirtualMemory;
  8393. TFNZwYieldExecution = TFNNtYieldExecution;
  8394. /// (Global) function pointers
  8395. var
  8396. _CsrGetProcessId : Pointer = nil;
  8397. _DbgQueryDebugFilterState : Pointer = nil;
  8398. _DbgSetDebugFilterState : Pointer = nil;
  8399. _KiRaiseUserExceptionDispatcher : Pointer = nil;
  8400. _LdrAccessResource : Pointer = nil;
  8401. _LdrAlternateResourcesEnabled : Pointer = nil;
  8402. _LdrDisableThreadCalloutsForDll : Pointer = nil;
  8403. _LdrGetDllHandle : Pointer = nil;
  8404. _LdrGetProcedureAddress : Pointer = nil;
  8405. _LdrLoadDll : Pointer = nil;
  8406. _LdrQueryImageFileExecutionOptions : Pointer = nil;
  8407. _LdrQueryProcessModuleInformation : Pointer = nil;
  8408. _LdrShutdownProcess : Pointer = nil;
  8409. _LdrShutdownThread : Pointer = nil;
  8410. _LdrUnloadDll : Pointer = nil;
  8411. _NtAcceptConnectPort : Pointer = nil;
  8412. _NtAccessCheck : Pointer = nil;
  8413. _NtAccessCheckAndAuditAlarm : Pointer = nil;
  8414. _NtAccessCheckByType : Pointer = nil;
  8415. _NtAccessCheckByTypeAndAuditAlarm : Pointer = nil;
  8416. _NtAccessCheckByTypeResultList : Pointer = nil;
  8417. _NtAccessCheckByTypeResultListAndAuditAlarm : Pointer = nil;
  8418. _NtAccessCheckByTypeResultListAndAuditAlarmByHandle : Pointer = nil;
  8419. _NtAddAtom : Pointer = nil;
  8420. _NtAdjustGroupsToken : Pointer = nil;
  8421. _NtAdjustPrivilegesToken : Pointer = nil;
  8422. _NtAlertResumeThread : Pointer = nil;
  8423. _NtAlertThread : Pointer = nil;
  8424. _NtAllocateLocallyUniqueId : Pointer = nil;
  8425. _NtAllocateUserPhysicalPages : Pointer = nil;
  8426. _NtAllocateUuids : Pointer = nil;
  8427. _NtAllocateVirtualMemory : Pointer = nil;
  8428. _NtAreMappedFilesTheSame : Pointer = nil;
  8429. _NtAssignProcessToJobObject : Pointer = nil;
  8430. _NtCallbackReturn : Pointer = nil;
  8431. _NtCancelDeviceWakeupRequest : Pointer = nil;
  8432. _NtCancelIoFile : Pointer = nil;
  8433. _NtCancelTimer : Pointer = nil;
  8434. _NtClearEvent : Pointer = nil;
  8435. _NtClose : Pointer = nil;
  8436. _NtCloseObjectAuditAlarm : Pointer = nil;
  8437. _NtCompleteConnectPort : Pointer = nil;
  8438. _NtConnectPort : Pointer = nil;
  8439. _NtContinue : Pointer = nil;
  8440. _NtCreateChannel : Pointer = nil;
  8441. _NtCreateDirectoryObject : Pointer = nil;
  8442. _NtCreateEvent : Pointer = nil;
  8443. _NtCreateEventPair : Pointer = nil;
  8444. _NtCreateFile : Pointer = nil;
  8445. _NtCreateIoCompletion : Pointer = nil;
  8446. _NtCreateJobObject : Pointer = nil;
  8447. _NtCreateKey : Pointer = nil;
  8448. _NtCreateMailslotFile : Pointer = nil;
  8449. _NtCreateMutant : Pointer = nil;
  8450. _NtCreateNamedPipeFile : Pointer = nil;
  8451. _NtCreatePagingFile : Pointer = nil;
  8452. _NtCreatePort : Pointer = nil;
  8453. _NtCreateProcess : Pointer = nil;
  8454. _NtCreateProfile : Pointer = nil;
  8455. _NtCreateSection : Pointer = nil;
  8456. _NtCreateSemaphore : Pointer = nil;
  8457. _NtCreateSymbolicLinkObject : Pointer = nil;
  8458. _NtCreateThread : Pointer = nil;
  8459. _NtCreateTimer : Pointer = nil;
  8460. _NtCreateToken : Pointer = nil;
  8461. _NtCreateWaitablePort : Pointer = nil;
  8462. _NtCurrentTeb : Pointer = nil;
  8463. _NtDebugActiveProcess : Pointer = nil;
  8464. _NtDelayExecution : Pointer = nil;
  8465. _NtDeleteAtom : Pointer = nil;
  8466. _NtDeleteFile : Pointer = nil;
  8467. _NtDeleteKey : Pointer = nil;
  8468. _NtDeleteObjectAuditAlarm : Pointer = nil;
  8469. _NtDeleteValueKey : Pointer = nil;
  8470. _NtDeviceIoControlFile : Pointer = nil;
  8471. _NtDisplayString : Pointer = nil;
  8472. _NtDuplicateObject : Pointer = nil;
  8473. _NtDuplicateToken : Pointer = nil;
  8474. _NtEnumerateKey : Pointer = nil;
  8475. _NtEnumerateValueKey : Pointer = nil;
  8476. _NtExtendSection : Pointer = nil;
  8477. _NtFilterToken : Pointer = nil;
  8478. _NtFindAtom : Pointer = nil;
  8479. _NtFlushBuffersFile : Pointer = nil;
  8480. _NtFlushInstructionCache : Pointer = nil;
  8481. _NtFlushKey : Pointer = nil;
  8482. _NtFlushVirtualMemory : Pointer = nil;
  8483. _NtFlushWriteBuffer : Pointer = nil;
  8484. _NtFreeUserPhysicalPages : Pointer = nil;
  8485. _NtFreeVirtualMemory : Pointer = nil;
  8486. _NtFsControlFile : Pointer = nil;
  8487. _NtGetContextThread : Pointer = nil;
  8488. _NtGetCurrentProcessorNumber : Pointer = nil;
  8489. _NtGetDevicePowerState : Pointer = nil;
  8490. _NtGetPlugPlayEvent : Pointer = nil;
  8491. _NtGetTickCount : Pointer = nil;
  8492. _NtGetWriteWatch : Pointer = nil;
  8493. _NtImpersonateAnonymousToken : Pointer = nil;
  8494. _NtImpersonateClientOfPort : Pointer = nil;
  8495. _NtImpersonateThread : Pointer = nil;
  8496. _NtInitializeRegistry : Pointer = nil;
  8497. _NtInitiatePowerAction : Pointer = nil;
  8498. _NtIsSystemResumeAutomatic : Pointer = nil;
  8499. _NtListenChannel : Pointer = nil;
  8500. _NtListenPort : Pointer = nil;
  8501. _NtLoadDriver : Pointer = nil;
  8502. _NtLoadKey : Pointer = nil;
  8503. _NtLoadKey2 : Pointer = nil;
  8504. _NtLockFile : Pointer = nil;
  8505. _NtLockVirtualMemory : Pointer = nil;
  8506. _NtMakePermanentObject : Pointer = nil;
  8507. _NtMakeTemporaryObject : Pointer = nil;
  8508. _NtMapUserPhysicalPages : Pointer = nil;
  8509. _NtMapUserPhysicalPagesScatter : Pointer = nil;
  8510. _NtMapViewOfSection : Pointer = nil;
  8511. _NtNotifyChangeDirectoryFile : Pointer = nil;
  8512. _NtNotifyChangeKey : Pointer = nil;
  8513. _NtNotifyChangeMultipleKeys : Pointer = nil;
  8514. _NtOpenChannel : Pointer = nil;
  8515. _NtOpenDirectoryObject : Pointer = nil;
  8516. _NtOpenEvent : Pointer = nil;
  8517. _NtOpenEventPair : Pointer = nil;
  8518. _NtOpenFile : Pointer = nil;
  8519. _NtOpenIoCompletion : Pointer = nil;
  8520. _NtOpenJobObject : Pointer = nil;
  8521. _NtOpenKey : Pointer = nil;
  8522. _NtOpenMutant : Pointer = nil;
  8523. _NtOpenObjectAuditAlarm : Pointer = nil;
  8524. _NtOpenProcess : Pointer = nil;
  8525. _NtOpenProcessToken : Pointer = nil;
  8526. _NtOpenSection : Pointer = nil;
  8527. _NtOpenSemaphore : Pointer = nil;
  8528. _NtOpenSymbolicLinkObject : Pointer = nil;
  8529. _NtOpenThread : Pointer = nil;
  8530. _NtOpenThreadToken : Pointer = nil;
  8531. _NtOpenTimer : Pointer = nil;
  8532. _NtPlugPlayControl : Pointer = nil;
  8533. _NtPowerInformation : Pointer = nil;
  8534. _NtPrivilegeCheck : Pointer = nil;
  8535. _NtPrivilegeObjectAuditAlarm : Pointer = nil;
  8536. _NtPrivilegedServiceAuditAlarm : Pointer = nil;
  8537. _NtProtectVirtualMemory : Pointer = nil;
  8538. _NtPulseEvent : Pointer = nil;
  8539. _NtQueryAttributesFile : Pointer = nil;
  8540. _NtQueryDefaultLocale : Pointer = nil;
  8541. _NtQueryDefaultUILanguage : Pointer = nil;
  8542. _NtQueryDirectoryFile : Pointer = nil;
  8543. _NtQueryDirectoryObject : Pointer = nil;
  8544. _NtQueryEaFile : Pointer = nil;
  8545. _NtQueryEvent : Pointer = nil;
  8546. _NtQueryFullAttributesFile : Pointer = nil;
  8547. _NtQueryInformationAtom : Pointer = nil;
  8548. _NtQueryInformationFile : Pointer = nil;
  8549. _NtQueryInformationJobObject : Pointer = nil;
  8550. _NtQueryInformationPort : Pointer = nil;
  8551. _NtQueryInformationProcess : Pointer = nil;
  8552. _NtQueryInformationThread : Pointer = nil;
  8553. _NtQueryInformationToken : Pointer = nil;
  8554. _NtQueryInstallUILanguage : Pointer = nil;
  8555. _NtQueryIntervalProfile : Pointer = nil;
  8556. _NtQueryIoCompletion : Pointer = nil;
  8557. _NtQueryKey : Pointer = nil;
  8558. _NtQueryMultipleValueKey : Pointer = nil;
  8559. _NtQueryMutant : Pointer = nil;
  8560. _NtQueryObject : Pointer = nil;
  8561. _NtQueryOpenSubKeys : Pointer = nil;
  8562. _NtQueryPerformanceCounter : Pointer = nil;
  8563. _NtQueryPortInformationProcess : Pointer = nil;
  8564. _NtQueryQuotaInformationFile : Pointer = nil;
  8565. _NtQuerySection : Pointer = nil;
  8566. _NtQuerySecurityObject : Pointer = nil;
  8567. _NtQuerySemaphore : Pointer = nil;
  8568. _NtQuerySymbolicLinkObject : Pointer = nil;
  8569. _NtQuerySystemEnvironmentValue : Pointer = nil;
  8570. _NtQuerySystemInformation : Pointer = nil;
  8571. _NtQuerySystemTime : Pointer = nil;
  8572. _NtQueryTimer : Pointer = nil;
  8573. _NtQueryTimerResolution : Pointer = nil;
  8574. _NtQueryValueKey : Pointer = nil;
  8575. _NtQueryVirtualMemory : Pointer = nil;
  8576. _NtQueryVolumeInformationFile : Pointer = nil;
  8577. _NtQueueApcThread : Pointer = nil;
  8578. _NtRaiseException : Pointer = nil;
  8579. _NtRaiseHardError : Pointer = nil;
  8580. _NtReadFile : Pointer = nil;
  8581. _NtReadFileScatter : Pointer = nil;
  8582. _NtReadRequestData : Pointer = nil;
  8583. _NtReadVirtualMemory : Pointer = nil;
  8584. _NtRegisterThreadTerminatePort : Pointer = nil;
  8585. _NtReleaseMutant : Pointer = nil;
  8586. _NtReleaseSemaphore : Pointer = nil;
  8587. _NtRemoveIoCompletion : Pointer = nil;
  8588. _NtRemoveProcessDebug : Pointer = nil;
  8589. _NtReplaceKey : Pointer = nil;
  8590. _NtReplyPort : Pointer = nil;
  8591. _NtReplyWaitReceivePort : Pointer = nil;
  8592. _NtReplyWaitReceivePortEx : Pointer = nil;
  8593. _NtReplyWaitReplyPort : Pointer = nil;
  8594. _NtReplyWaitSendChannel : Pointer = nil;
  8595. _NtRequestDeviceWakeup : Pointer = nil;
  8596. _NtRequestPort : Pointer = nil;
  8597. _NtRequestWaitReplyPort : Pointer = nil;
  8598. _NtRequestWakeupLatency : Pointer = nil;
  8599. _NtResetEvent : Pointer = nil;
  8600. _NtResetWriteWatch : Pointer = nil;
  8601. _NtRestoreKey : Pointer = nil;
  8602. _NtResumeProcess : Pointer = nil;
  8603. _NtResumeThread : Pointer = nil;
  8604. _NtSaveKey : Pointer = nil;
  8605. _NtSaveKeyEx : Pointer = nil;
  8606. _NtSaveMergedKeys : Pointer = nil;
  8607. _NtSecureConnectPort : Pointer = nil;
  8608. _NtSendWaitReplyChannel : Pointer = nil;
  8609. _NtSetContextChannel : Pointer = nil;
  8610. _NtSetContextThread : Pointer = nil;
  8611. _NtSetDefaultHardErrorPort : Pointer = nil;
  8612. _NtSetDefaultLocale : Pointer = nil;
  8613. _NtSetDefaultUILanguage : Pointer = nil;
  8614. _NtSetEaFile : Pointer = nil;
  8615. _NtSetEvent : Pointer = nil;
  8616. _NtSetHighEventPair : Pointer = nil;
  8617. _NtSetHighWaitLowEventPair : Pointer = nil;
  8618. _NtSetHighWaitLowThread : Pointer = nil;
  8619. _NtSetInformationFile : Pointer = nil;
  8620. _NtSetInformationJobObject : Pointer = nil;
  8621. _NtSetInformationKey : Pointer = nil;
  8622. _NtSetInformationObject : Pointer = nil;
  8623. _NtSetInformationProcess : Pointer = nil;
  8624. _NtSetInformationThread : Pointer = nil;
  8625. _NtSetInformationToken : Pointer = nil;
  8626. _NtSetIntervalProfile : Pointer = nil;
  8627. _NtSetIoCompletion : Pointer = nil;
  8628. _NtSetLdtEntries : Pointer = nil;
  8629. _NtSetLowEventPair : Pointer = nil;
  8630. _NtSetLowWaitHighEventPair : Pointer = nil;
  8631. _NtSetLowWaitHighThread : Pointer = nil;
  8632. _NtSetQuotaInformationFile : Pointer = nil;
  8633. _NtSetSecurityObject : Pointer = nil;
  8634. _NtSetSystemEnvironmentValue : Pointer = nil;
  8635. _NtSetSystemInformation : Pointer = nil;
  8636. _NtSetSystemPowerState : Pointer = nil;
  8637. _NtSetSystemTime : Pointer = nil;
  8638. _NtSetThreadExecutionState : Pointer = nil;
  8639. _NtSetTimer : Pointer = nil;
  8640. _NtSetTimerResolution : Pointer = nil;
  8641. _NtSetUuidSeed : Pointer = nil;
  8642. _NtSetValueKey : Pointer = nil;
  8643. _NtSetVolumeInformationFile : Pointer = nil;
  8644. _NtShutdownSystem : Pointer = nil;
  8645. _NtSignalAndWaitForSingleObject : Pointer = nil;
  8646. _NtStartProfile : Pointer = nil;
  8647. _NtStopProfile : Pointer = nil;
  8648. _NtSuspendProcess : Pointer = nil;
  8649. _NtSuspendThread : Pointer = nil;
  8650. _NtSystemDebugControl : Pointer = nil;
  8651. _NtTerminateJobObject : Pointer = nil;
  8652. _NtTerminateProcess : Pointer = nil;
  8653. _NtTerminateThread : Pointer = nil;
  8654. _NtTestAlert : Pointer = nil;
  8655. _NtUnloadDriver : Pointer = nil;
  8656. _NtUnloadKey : Pointer = nil;
  8657. _NtUnlockFile : Pointer = nil;
  8658. _NtUnlockVirtualMemory : Pointer = nil;
  8659. _NtUnmapViewOfSection : Pointer = nil;
  8660. _NtVdmControl : Pointer = nil;
  8661. _NtW32Call : Pointer = nil;
  8662. _NtWaitForMultipleObjects : Pointer = nil;
  8663. _NtWaitForSingleObject : Pointer = nil;
  8664. _NtWaitHighEventPair : Pointer = nil;
  8665. _NtWaitLowEventPair : Pointer = nil;
  8666. _NtWriteFile : Pointer = nil;
  8667. _NtWriteFileGather : Pointer = nil;
  8668. _NtWriteRequestData : Pointer = nil;
  8669. _NtWriteVirtualMemory : Pointer = nil;
  8670. _NtYieldExecution : Pointer = nil;
  8671. _RtlAbsoluteToSelfRelativeSD : Pointer = nil;
  8672. _RtlAcquirePebLock : Pointer = nil;
  8673. _RtlAddAccessAllowedAce : Pointer = nil;
  8674. _RtlAddAccessAllowedAceEx : Pointer = nil;
  8675. _RtlAddAccessDeniedAce : Pointer = nil;
  8676. _RtlAddAccessDeniedAceEx : Pointer = nil;
  8677. _RtlAddAce : Pointer = nil;
  8678. _RtlAddAuditAccessAce : Pointer = nil;
  8679. _RtlAddAuditAccessAceEx : Pointer = nil;
  8680. _RtlAddRange : Pointer = nil;
  8681. _RtlAddVectoredExceptionHandler : Pointer = nil;
  8682. _RtlAdjustPrivilege : Pointer = nil;
  8683. _RtlAllocateAndInitializeSid : Pointer = nil;
  8684. _RtlAllocateHeap : Pointer = nil;
  8685. _RtlAnsiCharToUnicodeChar : Pointer = nil;
  8686. _RtlAnsiStringToUnicodeSize : Pointer = nil;
  8687. _RtlAnsiStringToUnicodeString : Pointer = nil;
  8688. _RtlAppendAsciizToString : Pointer = nil;
  8689. _RtlAppendStringToString : Pointer = nil;
  8690. _RtlAppendUnicodeStringToString : Pointer = nil;
  8691. _RtlAppendUnicodeToString : Pointer = nil;
  8692. _RtlAreAllAccessesGranted : Pointer = nil;
  8693. _RtlAreAnyAccessesGranted : Pointer = nil;
  8694. _RtlAreBitsClear : Pointer = nil;
  8695. _RtlAreBitsSet : Pointer = nil;
  8696. _RtlAssert : Pointer = nil;
  8697. {$IFNDEF JWA_INCLUDEMODE}
  8698. _RtlCaptureContext : Pointer = nil;
  8699. _RtlCharToInteger : Pointer = nil;
  8700. {$ENDIF JWA_INCLUDEMODE}
  8701. _RtlCheckForOrphanedCriticalSections : Pointer = nil;
  8702. _RtlCheckRegistryKey : Pointer = nil;
  8703. _RtlClearAllBits : Pointer = nil;
  8704. _RtlClearBits : Pointer = nil;
  8705. _RtlCompactHeap : Pointer = nil;
  8706. {$IFNDEF JWA_INCLUDEMODE}
  8707. _RtlCompareMemory : Pointer = nil;
  8708. {$ENDIF JWA_INCLUDEMODE}
  8709. _RtlCompareMemoryUlong : Pointer = nil;
  8710. _RtlCompareString : Pointer = nil;
  8711. _RtlCompareUnicodeString : Pointer = nil;
  8712. _RtlConvertLongToLargeInteger : Pointer = nil;
  8713. _RtlConvertSidToUnicodeString : Pointer = nil;
  8714. _RtlConvertUlongToLargeInteger : Pointer = nil;
  8715. _RtlCopyLuid : Pointer = nil;
  8716. _RtlCopyRangeList : Pointer = nil;
  8717. _RtlCopySecurityDescriptor : Pointer = nil;
  8718. _RtlCopySid : Pointer = nil;
  8719. _RtlCopyString : Pointer = nil;
  8720. _RtlCopyUnicodeString : Pointer = nil;
  8721. _RtlCreateAcl : Pointer = nil;
  8722. _RtlCreateHeap : Pointer = nil;
  8723. _RtlCreateProcessParameters : Pointer = nil;
  8724. _RtlCreateQueryDebugBuffer : Pointer = nil;
  8725. _RtlCreateRegistryKey : Pointer = nil;
  8726. _RtlCreateSecurityDescriptor : Pointer = nil;
  8727. _RtlCreateUnicodeString : Pointer = nil;
  8728. _RtlCreateUnicodeStringFromAsciiz : Pointer = nil;
  8729. _RtlCreateUserProcess : Pointer = nil;
  8730. _RtlCreateUserThread : Pointer = nil;
  8731. _RtlCutoverTimeToSystemTime : Pointer = nil;
  8732. _RtlDeNormalizeProcessParams : Pointer = nil;
  8733. _RtlDeleteAce : Pointer = nil;
  8734. _RtlDeleteCriticalSection : Pointer = nil;
  8735. _RtlDeleteOwnersRanges : Pointer = nil;
  8736. _RtlDeleteRange : Pointer = nil;
  8737. _RtlDeleteRegistryValue : Pointer = nil;
  8738. _RtlDestroyHeap : Pointer = nil;
  8739. _RtlDestroyProcessParameters : Pointer = nil;
  8740. _RtlDestroyQueryDebugBuffer : Pointer = nil;
  8741. _RtlDetermineDosPathNameType_U : Pointer = nil;
  8742. _RtlDnsHostNameToComputerName : Pointer = nil;
  8743. _RtlDoesFileExists_U : Pointer = nil;
  8744. _RtlDosPathNameToNtPathName_U : Pointer = nil;
  8745. _RtlDosSearchPath_U : Pointer = nil;
  8746. _RtlDowncaseUnicodeChar : Pointer = nil;
  8747. _RtlDowncaseUnicodeString : Pointer = nil;
  8748. _RtlDuplicateUnicodeString : Pointer = nil;
  8749. _RtlEnableEarlyCriticalSectionEventCreation : Pointer = nil;
  8750. _RtlEnlargedIntegerMultiply : Pointer = nil;
  8751. _RtlEnlargedUnsignedDivide : Pointer = nil;
  8752. _RtlEnlargedUnsignedMultiply : Pointer = nil;
  8753. _RtlEnterCriticalSection : Pointer = nil;
  8754. _RtlEqualComputerName : Pointer = nil;
  8755. _RtlEqualDomainName : Pointer = nil;
  8756. _RtlEqualLuid : Pointer = nil;
  8757. _RtlEqualPrefixSid : Pointer = nil;
  8758. _RtlEqualSid : Pointer = nil;
  8759. _RtlEqualString : Pointer = nil;
  8760. _RtlEqualUnicodeString : Pointer = nil;
  8761. _RtlEraseUnicodeString : Pointer = nil;
  8762. _RtlExpandEnvironmentStrings_U : Pointer = nil;
  8763. _RtlExtendedIntegerMultiply : Pointer = nil;
  8764. _RtlExtendedLargeIntegerDivide : Pointer = nil;
  8765. _RtlExtendedMagicDivide : Pointer = nil;
  8766. _RtlFillMemory : Pointer = nil;
  8767. _RtlFillMemoryUlong : Pointer = nil;
  8768. _RtlFindCharInUnicodeString : Pointer = nil;
  8769. _RtlFindClearBits : Pointer = nil;
  8770. _RtlFindClearBitsAndSet : Pointer = nil;
  8771. _RtlFindLastBackwardRunClear : Pointer = nil;
  8772. _RtlFindLeastSignificantBit : Pointer = nil;
  8773. _RtlFindLongestRunClear : Pointer = nil;
  8774. _RtlFindMostSignificantBit : Pointer = nil;
  8775. _RtlFindNextForwardRunClear : Pointer = nil;
  8776. _RtlFindRange : Pointer = nil;
  8777. _RtlFindSetBits : Pointer = nil;
  8778. _RtlFindSetBitsAndClear : Pointer = nil;
  8779. _RtlFirstFreeAce : Pointer = nil;
  8780. _RtlFormatCurrentUserKeyPath : Pointer = nil;
  8781. _RtlFreeAnsiString : Pointer = nil;
  8782. _RtlFreeHeap : Pointer = nil;
  8783. _RtlFreeOemString : Pointer = nil;
  8784. _RtlFreeRangeList : Pointer = nil;
  8785. _RtlFreeSid : Pointer = nil;
  8786. _RtlFreeUnicodeString : Pointer = nil;
  8787. _RtlGUIDFromString : Pointer = nil;
  8788. _RtlGetAce : Pointer = nil;
  8789. _RtlGetCallersAddress : Pointer = nil;
  8790. _RtlGetControlSecurityDescriptor : Pointer = nil;
  8791. _RtlGetCurrentDirectory_U : Pointer = nil;
  8792. _RtlGetCurrentPeb : Pointer = nil;
  8793. _RtlGetDaclSecurityDescriptor : Pointer = nil;
  8794. _RtlGetFirstRange : Pointer = nil;
  8795. _RtlGetFullPathName_U : Pointer = nil;
  8796. _RtlGetGroupSecurityDescriptor : Pointer = nil;
  8797. _RtlGetLastNtStatus : Pointer = nil;
  8798. _RtlGetLongestNtPathLength : Pointer = nil;
  8799. _RtlGetNextRange : Pointer = nil;
  8800. _RtlGetNtGlobalFlags : Pointer = nil;
  8801. _RtlGetNtProductType : Pointer = nil;
  8802. _RtlGetNtVersionNumbers : Pointer = nil;
  8803. _RtlGetOwnerSecurityDescriptor : Pointer = nil;
  8804. _RtlGetProcessHeaps : Pointer = nil;
  8805. _RtlGetSaclSecurityDescriptor : Pointer = nil;
  8806. _RtlGetVersion : Pointer = nil;
  8807. _RtlIdentifierAuthoritySid : Pointer = nil;
  8808. _RtlImageDirectoryEntryToData : Pointer = nil;
  8809. _RtlImageNtHeader : Pointer = nil;
  8810. _RtlImageNtHeaderEx : Pointer = nil;
  8811. _RtlImageRvaToSection : Pointer = nil;
  8812. _RtlImageRvaToVa : Pointer = nil;
  8813. _RtlImpersonateSelf : Pointer = nil;
  8814. _RtlInitAnsiString : Pointer = nil;
  8815. _RtlInitAnsiStringEx : Pointer = nil;
  8816. _RtlInitString : Pointer = nil;
  8817. _RtlInitUnicodeString : Pointer = nil;
  8818. _RtlInitUnicodeStringEx : Pointer = nil;
  8819. _RtlInitializeBitMap : Pointer = nil;
  8820. _RtlInitializeCriticalSection : Pointer = nil;
  8821. _RtlInitializeCriticalSectionAndSpinCount : Pointer = nil;
  8822. _RtlInitializeRangeList : Pointer = nil;
  8823. {$IFNDEF JWA_INCLUDEMODE}
  8824. _RtlInitializeSListHead : Pointer = nil;
  8825. {$ENDIF JWA_INCLUDEMODE}
  8826. _RtlInitializeSid : Pointer = nil;
  8827. _RtlInt64ToUnicodeString : Pointer = nil;
  8828. _RtlIntegerToChar : Pointer = nil;
  8829. _RtlIntegerToUnicodeString : Pointer = nil;
  8830. {$IFNDEF JWA_INCLUDEMODE}
  8831. _RtlInterlockedFlushSList : Pointer = nil;
  8832. _RtlInterlockedPopEntrySList : Pointer = nil;
  8833. {$ENDIF JWA_INCLUDEMODE}
  8834. _RtlInterlockedPushEntrySList : Pointer = nil;
  8835. _RtlInvertRangeList : Pointer = nil;
  8836. _RtlIpv4AddressToStringA : Pointer = nil;
  8837. _RtlIpv4AddressToStringW : Pointer = nil;
  8838. _RtlIsDosDeviceName_U : Pointer = nil;
  8839. {$IFNDEF JWA_INCLUDEMODE}
  8840. _RtlIsNameLegalDOS8Dot3 : Pointer = nil;
  8841. {$ENDIF JWA_INCLUDEMODE}
  8842. _RtlIsRangeAvailable : Pointer = nil;
  8843. _RtlIsTextUnicode : Pointer = nil;
  8844. _RtlLargeIntegerAdd : Pointer = nil;
  8845. _RtlLargeIntegerArithmeticShift : Pointer = nil;
  8846. _RtlLargeIntegerDivide : Pointer = nil;
  8847. _RtlLargeIntegerNegate : Pointer = nil;
  8848. _RtlLargeIntegerShiftLeft : Pointer = nil;
  8849. _RtlLargeIntegerShiftRight : Pointer = nil;
  8850. _RtlLargeIntegerSubtract : Pointer = nil;
  8851. _RtlLargeIntegerToChar : Pointer = nil;
  8852. _RtlLeaveCriticalSection : Pointer = nil;
  8853. _RtlLengthRequiredSid : Pointer = nil;
  8854. _RtlLengthSecurityDescriptor : Pointer = nil;
  8855. _RtlLengthSid : Pointer = nil;
  8856. {$IFNDEF JWA_INCLUDEMODE}
  8857. _RtlLocalTimeToSystemTime : Pointer = nil;
  8858. {$ENDIF JWA_INCLUDEMODE}
  8859. _RtlLockHeap : Pointer = nil;
  8860. _RtlMakeSelfRelativeSD : Pointer = nil;
  8861. _RtlMapGenericMask : Pointer = nil;
  8862. _RtlMapSecurityErrorToNtStatus : Pointer = nil;
  8863. _RtlMergeRangeLists : Pointer = nil;
  8864. _RtlMoveMemory : Pointer = nil;
  8865. _RtlNormalizeProcessParams : Pointer = nil;
  8866. _RtlNtStatusToDosError : Pointer = nil;
  8867. _RtlNtStatusToDosErrorNoTeb : Pointer = nil;
  8868. _RtlNumberOfClearBits : Pointer = nil;
  8869. _RtlNumberOfSetBits : Pointer = nil;
  8870. _RtlOemStringToUnicodeSize : Pointer = nil;
  8871. _RtlOemStringToUnicodeString : Pointer = nil;
  8872. _RtlOemToUnicodeN : Pointer = nil;
  8873. _RtlOpenCurrentUser : Pointer = nil;
  8874. _RtlPrefixString : Pointer = nil;
  8875. _RtlPrefixUnicodeString : Pointer = nil;
  8876. _RtlQueryDepthSList : Pointer = nil;
  8877. _RtlQueryEnvironmentVariable_U : Pointer = nil;
  8878. _RtlQueryInformationAcl : Pointer = nil;
  8879. _RtlQueryProcessDebugInformation : Pointer = nil;
  8880. _RtlQueryRegistryValues : Pointer = nil;
  8881. _RtlRaiseStatus : Pointer = nil;
  8882. _RtlRandom : Pointer = nil;
  8883. _RtlRandomEx : Pointer = nil;
  8884. _RtlReAllocateHeap : Pointer = nil;
  8885. _RtlReleasePebLock : Pointer = nil;
  8886. _RtlRemoveVectoredExceptionHandler : Pointer = nil;
  8887. _RtlRestoreLastWin32Error : Pointer = nil;
  8888. _RtlRunDecodeUnicodeString : Pointer = nil;
  8889. _RtlRunEncodeUnicodeString : Pointer = nil;
  8890. _RtlSecondsSince1970ToTime : Pointer = nil;
  8891. _RtlSecondsSince1980ToTime : Pointer = nil;
  8892. _RtlSelfRelativeToAbsoluteSD : Pointer = nil;
  8893. _RtlSetAllBits : Pointer = nil;
  8894. _RtlSetBits : Pointer = nil;
  8895. _RtlSetControlSecurityDescriptor : Pointer = nil;
  8896. _RtlSetCriticalSectionSpinCount : Pointer = nil;
  8897. _RtlSetCurrentDirectory_U : Pointer = nil;
  8898. _RtlSetDaclSecurityDescriptor : Pointer = nil;
  8899. _RtlSetGroupSecurityDescriptor : Pointer = nil;
  8900. _RtlSetInformationAcl : Pointer = nil;
  8901. _RtlSetLastWin32ErrorAndNtStatusFromNtStatus : Pointer = nil;
  8902. _RtlSetOwnerSecurityDescriptor : Pointer = nil;
  8903. _RtlSetProcessIsCritical : Pointer = nil;
  8904. _RtlSetSaclSecurityDescriptor : Pointer = nil;
  8905. _RtlSetThreadIsCritical : Pointer = nil;
  8906. _RtlSizeHeap : Pointer = nil;
  8907. _RtlStringFromGUID : Pointer = nil;
  8908. _RtlSubAuthorityCountSid : Pointer = nil;
  8909. _RtlSubAuthoritySid : Pointer = nil;
  8910. _RtlSystemTimeToLocalTime : Pointer = nil;
  8911. _RtlTimeFieldsToTime : Pointer = nil;
  8912. _RtlTimeToElapsedTimeFields : Pointer = nil;
  8913. {$IFNDEF JWA_INCLUDEMODE}
  8914. _RtlTimeToSecondsSince1970 : Pointer = nil;
  8915. {$ENDIF JWA_INCLUDEMODE}
  8916. _RtlTimeToSecondsSince1980 : Pointer = nil;
  8917. _RtlTimeToTimeFields : Pointer = nil;
  8918. _RtlTryEnterCriticalSection : Pointer = nil;
  8919. _RtlUnicodeStringToAnsiSize : Pointer = nil;
  8920. {$IFNDEF JWA_INCLUDEMODE}
  8921. _RtlUnicodeStringToAnsiString : Pointer = nil;
  8922. {$ENDIF JWA_INCLUDEMODE}
  8923. _RtlUnicodeStringToCountedOemString : Pointer = nil;
  8924. _RtlUnicodeStringToInteger : Pointer = nil;
  8925. _RtlUnicodeStringToOemSize : Pointer = nil;
  8926. {$IFNDEF JWA_INCLUDEMODE}
  8927. _RtlUnicodeStringToOemString : Pointer = nil;
  8928. _RtlUnicodeToMultiByteSize : Pointer = nil;
  8929. {$ENDIF JWA_INCLUDEMODE}
  8930. _RtlUniform : Pointer = nil;
  8931. _RtlUnwind : Pointer = nil;
  8932. _RtlUpcaseUnicodeChar : Pointer = nil;
  8933. _RtlUpcaseUnicodeString : Pointer = nil;
  8934. _RtlUpcaseUnicodeStringToAnsiString : Pointer = nil;
  8935. _RtlUpcaseUnicodeStringToCountedOemString : Pointer = nil;
  8936. _RtlUpcaseUnicodeStringToOemString : Pointer = nil;
  8937. _RtlUpcaseUnicodeToMultiByteN : Pointer = nil;
  8938. _RtlUpcaseUnicodeToOemN : Pointer = nil;
  8939. _RtlUpperChar : Pointer = nil;
  8940. _RtlUpperString : Pointer = nil;
  8941. _RtlValidAcl : Pointer = nil;
  8942. _RtlValidRelativeSecurityDescriptor : Pointer = nil;
  8943. _RtlValidSecurityDescriptor : Pointer = nil;
  8944. _RtlValidSid : Pointer = nil;
  8945. _RtlValidateHeap : Pointer = nil;
  8946. _RtlValidateUnicodeString : Pointer = nil;
  8947. _RtlVerifyVersionInfo : Pointer = nil;
  8948. _RtlVolumeDeviceToDosName : Pointer = nil;
  8949. _RtlWriteRegistryValue : Pointer = nil;
  8950. _RtlZeroHeap : Pointer = nil;
  8951. _RtlZeroMemory : Pointer = nil;
  8952. _RtlpNotOwnerCriticalSection : Pointer = nil;
  8953. _RtlpNtCreateKey : Pointer = nil;
  8954. _RtlpNtEnumerateSubKey : Pointer = nil;
  8955. _RtlpNtMakeTemporaryKey : Pointer = nil;
  8956. _RtlpNtOpenKey : Pointer = nil;
  8957. _RtlpNtQueryValueKey : Pointer = nil;
  8958. _RtlpNtSetValueKey : Pointer = nil;
  8959. _RtlxAnsiStringToUnicodeSize : Pointer = nil;
  8960. _RtlxOemStringToUnicodeSize : Pointer = nil;
  8961. _RtlxUnicodeStringToAnsiSize : Pointer = nil;
  8962. _RtlxUnicodeStringToOemSize : Pointer = nil;
  8963. {$IFNDEF JWA_INCLUDEMODE}
  8964. _VerSetConditionMask : Pointer = nil;
  8965. {$ENDIF JWA_INCLUDEMODE}
  8966. // Dynamic version of CsrGetProcessId
  8967. function CsrGetProcessId(): DWORD; stdcall;
  8968. begin
  8969. GetProcedureAddress(_CsrGetProcessId, ntdll, 'CsrGetProcessId');
  8970. Result := TFNCsrGetProcessId(_CsrGetProcessId)();
  8971. end;
  8972. // Dynamic version of DbgQueryDebugFilterState
  8973. function DbgQueryDebugFilterState(
  8974. ComponentId : ULONG;
  8975. Level : ULONG
  8976. ): NTSTATUS; stdcall;
  8977. begin
  8978. GetProcedureAddress(_DbgQueryDebugFilterState, ntdll, 'DbgQueryDebugFilterState');
  8979. Result := TFNDbgQueryDebugFilterState(_DbgQueryDebugFilterState)(
  8980. ComponentId, Level
  8981. );
  8982. end;
  8983. // Dynamic version of DbgSetDebugFilterState
  8984. function DbgSetDebugFilterState(
  8985. ComponentId : ULONG;
  8986. Level : ULONG;
  8987. State : BOOLEAN
  8988. ): NTSTATUS; stdcall;
  8989. begin
  8990. GetProcedureAddress(_DbgSetDebugFilterState, ntdll, 'DbgSetDebugFilterState');
  8991. Result := TFNDbgSetDebugFilterState(_DbgSetDebugFilterState)(
  8992. ComponentId, Level, State
  8993. );
  8994. end;
  8995. // Dynamic version of KiRaiseUserExceptionDispatcher
  8996. function KiRaiseUserExceptionDispatcher(): ULONG; stdcall;
  8997. begin
  8998. GetProcedureAddress(_KiRaiseUserExceptionDispatcher, ntdll, 'KiRaiseUserExceptionDispatcher');
  8999. Result := TFNKiRaiseUserExceptionDispatcher(_KiRaiseUserExceptionDispatcher)();
  9000. end;
  9001. // Dynamic version of LdrAccessResource
  9002. function LdrAccessResource(
  9003. hModule : HANDLE;
  9004. ResourceDataEntry : PIMAGE_RESOURCE_DATA_ENTRY;
  9005. Address : PPVOID;
  9006. dwSize : PULONG
  9007. ): NTSTATUS; stdcall;
  9008. begin
  9009. GetProcedureAddress(_LdrAccessResource, ntdll, 'LdrAccessResource');
  9010. Result := TFNLdrAccessResource(_LdrAccessResource)(
  9011. hModule, ResourceDataEntry, Address, dwSize
  9012. );
  9013. end;
  9014. // Dynamic version of LdrAlternateResourcesEnabled
  9015. function LdrAlternateResourcesEnabled(): BOOLEAN; stdcall;
  9016. begin
  9017. GetProcedureAddress(_LdrAlternateResourcesEnabled, ntdll, 'LdrAlternateResourcesEnabled');
  9018. Result := TFNLdrAlternateResourcesEnabled(_LdrAlternateResourcesEnabled)();
  9019. end;
  9020. // Dynamic version of LdrDisableThreadCalloutsForDll
  9021. function LdrDisableThreadCalloutsForDll(
  9022. hModule : HANDLE
  9023. ): NTSTATUS; stdcall;
  9024. begin
  9025. GetProcedureAddress(_LdrDisableThreadCalloutsForDll, ntdll, 'LdrDisableThreadCalloutsForDll');
  9026. Result := TFNLdrDisableThreadCalloutsForDll(_LdrDisableThreadCalloutsForDll)(
  9027. hModule
  9028. );
  9029. end;
  9030. // Dynamic version of LdrGetDllHandle
  9031. function LdrGetDllHandle(
  9032. pwPath : PWORD;
  9033. pReserved : PVOID;
  9034. pusPath : PUNICODE_STRING;
  9035. var phModule : HANDLE
  9036. ): NTSTATUS; stdcall;
  9037. begin
  9038. GetProcedureAddress(_LdrGetDllHandle, ntdll, 'LdrGetDllHandle');
  9039. Result := TFNLdrGetDllHandle(_LdrGetDllHandle)(
  9040. pwPath, pReserved, pusPath, phModule
  9041. );
  9042. end;
  9043. // Dynamic version of LdrGetProcedureAddress
  9044. function LdrGetProcedureAddress(
  9045. hModule : HANDLE;
  9046. dwOrdinal : ULONG;
  9047. psName : PSTRING;
  9048. var pProcedure : PVOID
  9049. ): NTSTATUS; stdcall;
  9050. begin
  9051. GetProcedureAddress(_LdrGetProcedureAddress, ntdll, 'LdrGetProcedureAddress');
  9052. Result := TFNLdrGetProcedureAddress(_LdrGetProcedureAddress)(
  9053. hModule, dwOrdinal, psName, pProcedure
  9054. );
  9055. end;
  9056. // Dynamic version of LdrLoadDll
  9057. function LdrLoadDll(
  9058. pwPath : PWORD;
  9059. pdwFlags : PDWORD;
  9060. pusPath : PUNICODE_STRING;
  9061. var phModule : HANDLE
  9062. ): NTSTATUS; stdcall;
  9063. begin
  9064. GetProcedureAddress(_LdrLoadDll, ntdll, 'LdrLoadDll');
  9065. Result := TFNLdrLoadDll(_LdrLoadDll)(
  9066. pwPath, pdwFlags, pusPath, phModule
  9067. );
  9068. end;
  9069. // Dynamic version of LdrQueryImageFileExecutionOptions
  9070. function LdrQueryImageFileExecutionOptions(
  9071. pusImagePath : PUNICODE_STRING;
  9072. pwOptionName : PWORD;
  9073. dwRequestedType : DWORD;
  9074. pData : PVOID;
  9075. dwSize : DWORD;
  9076. pdwSize : PDWORD
  9077. ): NTSTATUS; stdcall;
  9078. begin
  9079. GetProcedureAddress(_LdrQueryImageFileExecutionOptions, ntdll, 'LdrQueryImageFileExecutionOptions');
  9080. Result := TFNLdrQueryImageFileExecutionOptions(_LdrQueryImageFileExecutionOptions)(
  9081. pusImagePath, pwOptionName, dwRequestedType, pData, dwSize, pdwSize
  9082. );
  9083. end;
  9084. // Dynamic version of LdrQueryProcessModuleInformation
  9085. function LdrQueryProcessModuleInformation(
  9086. psmi : PSYSTEM_MODULE_INFORMATION;
  9087. dwSize : DWORD;
  9088. pdwSize : PDWORD
  9089. ): NTSTATUS; stdcall;
  9090. begin
  9091. GetProcedureAddress(_LdrQueryProcessModuleInformation, ntdll, 'LdrQueryProcessModuleInformation');
  9092. Result := TFNLdrQueryProcessModuleInformation(_LdrQueryProcessModuleInformation)(
  9093. psmi, dwSize, pdwSize
  9094. );
  9095. end;
  9096. // Dynamic version of LdrShutdownProcess
  9097. procedure LdrShutdownProcess(); stdcall;
  9098. begin
  9099. GetProcedureAddress(_LdrShutdownProcess, ntdll, 'LdrShutdownProcess');
  9100. TFNLdrShutdownProcess(_LdrShutdownProcess)();
  9101. end;
  9102. // Dynamic version of LdrShutdownThread
  9103. procedure LdrShutdownThread(); stdcall;
  9104. begin
  9105. GetProcedureAddress(_LdrShutdownThread, ntdll, 'LdrShutdownThread');
  9106. TFNLdrShutdownThread(_LdrShutdownThread)();
  9107. end;
  9108. // Dynamic version of LdrUnloadDll
  9109. function LdrUnloadDll(
  9110. hModule : HANDLE
  9111. ): NTSTATUS; stdcall;
  9112. begin
  9113. GetProcedureAddress(_LdrUnloadDll, ntdll, 'LdrUnloadDll');
  9114. Result := TFNLdrUnloadDll(_LdrUnloadDll)(
  9115. hModule
  9116. );
  9117. end;
  9118. // Dynamic version of NtAcceptConnectPort
  9119. function NtAcceptConnectPort(
  9120. PortHandle : PHANDLE;
  9121. PortIdentifier : ULONG;
  9122. Message : PPORT_MESSAGE;
  9123. Accept : BOOLEAN;
  9124. WriteSection : PPORT_SECTION_WRITE;
  9125. ReadSection : PPORT_SECTION_READ
  9126. ): NTSTATUS; stdcall;
  9127. begin
  9128. GetProcedureAddress(_NtAcceptConnectPort, ntdll, 'NtAcceptConnectPort');
  9129. Result := TFNNtAcceptConnectPort(_NtAcceptConnectPort)(
  9130. PortHandle, PortIdentifier, Message, Accept, WriteSection, ReadSection
  9131. );
  9132. end;
  9133. // Dynamic version of NtAcceptConnectPort
  9134. function ZwAcceptConnectPort(
  9135. PortHandle : PHANDLE;
  9136. PortIdentifier : ULONG;
  9137. Message : PPORT_MESSAGE;
  9138. Accept : BOOLEAN;
  9139. WriteSection : PPORT_SECTION_WRITE;
  9140. ReadSection : PPORT_SECTION_READ
  9141. ): NTSTATUS; stdcall;
  9142. begin
  9143. GetProcedureAddress(_NtAcceptConnectPort, ntdll, 'NtAcceptConnectPort');
  9144. Result := TFNNtAcceptConnectPort(_NtAcceptConnectPort)(
  9145. PortHandle, PortIdentifier, Message, Accept, WriteSection, ReadSection
  9146. );
  9147. end;
  9148. // Dynamic version of NtAccessCheck
  9149. function NtAccessCheck(
  9150. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9151. TokenHandle : HANDLE;
  9152. DesiredAccess : ACCESS_MASK;
  9153. GenericMapping : PGENERIC_MAPPING;
  9154. PrivilegeSet : PPRIVILEGE_SET;
  9155. PrivilegeSetLength : PULONG;
  9156. GrantedAccess : PACCESS_MASK;
  9157. AccessStatus : PBOOLEAN
  9158. ): NTSTATUS; stdcall;
  9159. begin
  9160. GetProcedureAddress(_NtAccessCheck, ntdll, 'NtAccessCheck');
  9161. Result := TFNNtAccessCheck(_NtAccessCheck)(
  9162. SecurityDescriptor, TokenHandle, DesiredAccess, GenericMapping, PrivilegeSet, PrivilegeSetLength, GrantedAccess, AccessStatus
  9163. );
  9164. end;
  9165. // Dynamic version of NtAccessCheck
  9166. function ZwAccessCheck(
  9167. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9168. TokenHandle : HANDLE;
  9169. DesiredAccess : ACCESS_MASK;
  9170. GenericMapping : PGENERIC_MAPPING;
  9171. PrivilegeSet : PPRIVILEGE_SET;
  9172. PrivilegeSetLength : PULONG;
  9173. GrantedAccess : PACCESS_MASK;
  9174. AccessStatus : PBOOLEAN
  9175. ): NTSTATUS; stdcall;
  9176. begin
  9177. GetProcedureAddress(_NtAccessCheck, ntdll, 'NtAccessCheck');
  9178. Result := TFNNtAccessCheck(_NtAccessCheck)(
  9179. SecurityDescriptor, TokenHandle, DesiredAccess, GenericMapping, PrivilegeSet, PrivilegeSetLength, GrantedAccess, AccessStatus
  9180. );
  9181. end;
  9182. // Dynamic version of NtAccessCheckAndAuditAlarm
  9183. function NtAccessCheckAndAuditAlarm(
  9184. SubsystemName : PUNICODE_STRING;
  9185. HandleId : PVOID;
  9186. ObjectTypeName : PUNICODE_STRING;
  9187. ObjectName : PUNICODE_STRING;
  9188. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9189. DesiredAccess : ACCESS_MASK;
  9190. GenericMapping : PGENERIC_MAPPING;
  9191. ObjectCreation : BOOLEAN;
  9192. GrantedAccess : PACCESS_MASK;
  9193. AccessStatus : PBOOLEAN;
  9194. GenerateOnClose : PBOOLEAN
  9195. ): NTSTATUS; stdcall;
  9196. begin
  9197. GetProcedureAddress(_NtAccessCheckAndAuditAlarm, ntdll, 'NtAccessCheckAndAuditAlarm');
  9198. Result := TFNNtAccessCheckAndAuditAlarm(_NtAccessCheckAndAuditAlarm)(
  9199. SubsystemName, HandleId, ObjectTypeName, ObjectName, SecurityDescriptor, DesiredAccess, GenericMapping, ObjectCreation, GrantedAccess, AccessStatus, GenerateOnClose
  9200. );
  9201. end;
  9202. // Dynamic version of NtAccessCheckAndAuditAlarm
  9203. function ZwAccessCheckAndAuditAlarm(
  9204. SubsystemName : PUNICODE_STRING;
  9205. HandleId : PVOID;
  9206. ObjectTypeName : PUNICODE_STRING;
  9207. ObjectName : PUNICODE_STRING;
  9208. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9209. DesiredAccess : ACCESS_MASK;
  9210. GenericMapping : PGENERIC_MAPPING;
  9211. ObjectCreation : BOOLEAN;
  9212. GrantedAccess : PACCESS_MASK;
  9213. AccessStatus : PBOOLEAN;
  9214. GenerateOnClose : PBOOLEAN
  9215. ): NTSTATUS; stdcall;
  9216. begin
  9217. GetProcedureAddress(_NtAccessCheckAndAuditAlarm, ntdll, 'NtAccessCheckAndAuditAlarm');
  9218. Result := TFNNtAccessCheckAndAuditAlarm(_NtAccessCheckAndAuditAlarm)(
  9219. SubsystemName, HandleId, ObjectTypeName, ObjectName, SecurityDescriptor, DesiredAccess, GenericMapping, ObjectCreation, GrantedAccess, AccessStatus, GenerateOnClose
  9220. );
  9221. end;
  9222. // Dynamic version of NtAccessCheckByType
  9223. function NtAccessCheckByType(
  9224. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9225. PrincipalSelfSid : PSID;
  9226. TokenHandle : HANDLE;
  9227. DesiredAccess : ACCESS_MASK;
  9228. ObjectTypeList : POBJECT_TYPE_LIST;
  9229. ObjectTypeListLength : ULONG;
  9230. GenericMapping : PGENERIC_MAPPING;
  9231. PrivilegeSet : PPRIVILEGE_SET;
  9232. PrivilegeSetLength : PULONG;
  9233. GrantedAccess : PACCESS_MASK;
  9234. AccessStatus : PULONG
  9235. ): NTSTATUS; stdcall;
  9236. begin
  9237. GetProcedureAddress(_NtAccessCheckByType, ntdll, 'NtAccessCheckByType');
  9238. Result := TFNNtAccessCheckByType(_NtAccessCheckByType)(
  9239. SecurityDescriptor, PrincipalSelfSid, TokenHandle, DesiredAccess, ObjectTypeList, ObjectTypeListLength, GenericMapping, PrivilegeSet, PrivilegeSetLength, GrantedAccess, AccessStatus
  9240. );
  9241. end;
  9242. // Dynamic version of NtAccessCheckByType
  9243. function ZwAccessCheckByType(
  9244. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9245. PrincipalSelfSid : PSID;
  9246. TokenHandle : HANDLE;
  9247. DesiredAccess : ACCESS_MASK;
  9248. ObjectTypeList : POBJECT_TYPE_LIST;
  9249. ObjectTypeListLength : ULONG;
  9250. GenericMapping : PGENERIC_MAPPING;
  9251. PrivilegeSet : PPRIVILEGE_SET;
  9252. PrivilegeSetLength : PULONG;
  9253. GrantedAccess : PACCESS_MASK;
  9254. AccessStatus : PULONG
  9255. ): NTSTATUS; stdcall;
  9256. begin
  9257. GetProcedureAddress(_NtAccessCheckByType, ntdll, 'NtAccessCheckByType');
  9258. Result := TFNNtAccessCheckByType(_NtAccessCheckByType)(
  9259. SecurityDescriptor, PrincipalSelfSid, TokenHandle, DesiredAccess, ObjectTypeList, ObjectTypeListLength, GenericMapping, PrivilegeSet, PrivilegeSetLength, GrantedAccess, AccessStatus
  9260. );
  9261. end;
  9262. // Dynamic version of NtAccessCheckByTypeAndAuditAlarm
  9263. function NtAccessCheckByTypeAndAuditAlarm(
  9264. SubsystemName : PUNICODE_STRING;
  9265. HandleId : PVOID;
  9266. ObjectTypeName : PUNICODE_STRING;
  9267. ObjectName : PUNICODE_STRING;
  9268. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9269. PrincipalSelfSid : PSID;
  9270. DesiredAccess : ACCESS_MASK;
  9271. AuditType : AUDIT_EVENT_TYPE;
  9272. Flags : ULONG;
  9273. ObjectTypeList : POBJECT_TYPE_LIST;
  9274. ObjectTypeListLength : ULONG;
  9275. GenericMapping : PGENERIC_MAPPING;
  9276. ObjectCreation : BOOLEAN;
  9277. GrantedAccess : PACCESS_MASK;
  9278. AccessStatus : PULONG;
  9279. GenerateOnClose : PBOOLEAN
  9280. ): NTSTATUS; stdcall;
  9281. begin
  9282. GetProcedureAddress(_NtAccessCheckByTypeAndAuditAlarm, ntdll, 'NtAccessCheckByTypeAndAuditAlarm');
  9283. Result := TFNNtAccessCheckByTypeAndAuditAlarm(_NtAccessCheckByTypeAndAuditAlarm)(
  9284. SubsystemName, HandleId, ObjectTypeName, ObjectName, SecurityDescriptor, PrincipalSelfSid, DesiredAccess, AuditType, Flags, ObjectTypeList, ObjectTypeListLength, GenericMapping, ObjectCreation, GrantedAccess, AccessStatus,
  9285. GenerateOnClose
  9286. );
  9287. end;
  9288. // Dynamic version of NtAccessCheckByTypeAndAuditAlarm
  9289. function ZwAccessCheckByTypeAndAuditAlarm(
  9290. SubsystemName : PUNICODE_STRING;
  9291. HandleId : PVOID;
  9292. ObjectTypeName : PUNICODE_STRING;
  9293. ObjectName : PUNICODE_STRING;
  9294. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9295. PrincipalSelfSid : PSID;
  9296. DesiredAccess : ACCESS_MASK;
  9297. AuditType : AUDIT_EVENT_TYPE;
  9298. Flags : ULONG;
  9299. ObjectTypeList : POBJECT_TYPE_LIST;
  9300. ObjectTypeListLength : ULONG;
  9301. GenericMapping : PGENERIC_MAPPING;
  9302. ObjectCreation : BOOLEAN;
  9303. GrantedAccess : PACCESS_MASK;
  9304. AccessStatus : PULONG;
  9305. GenerateOnClose : PBOOLEAN
  9306. ): NTSTATUS; stdcall;
  9307. begin
  9308. GetProcedureAddress(_NtAccessCheckByTypeAndAuditAlarm, ntdll, 'NtAccessCheckByTypeAndAuditAlarm');
  9309. Result := TFNNtAccessCheckByTypeAndAuditAlarm(_NtAccessCheckByTypeAndAuditAlarm)(
  9310. SubsystemName, HandleId, ObjectTypeName, ObjectName, SecurityDescriptor, PrincipalSelfSid, DesiredAccess, AuditType, Flags, ObjectTypeList, ObjectTypeListLength, GenericMapping, ObjectCreation, GrantedAccess, AccessStatus,
  9311. GenerateOnClose
  9312. );
  9313. end;
  9314. // Dynamic version of NtAccessCheckByTypeResultList
  9315. function NtAccessCheckByTypeResultList(
  9316. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9317. PrincipalSelfSid : PSID;
  9318. TokenHandle : HANDLE;
  9319. DesiredAccess : ACCESS_MASK;
  9320. ObjectTypeList : POBJECT_TYPE_LIST;
  9321. ObjectTypeListLength : ULONG;
  9322. GenericMapping : PGENERIC_MAPPING;
  9323. PrivilegeSet : PPRIVILEGE_SET;
  9324. PrivilegeSetLength : PULONG;
  9325. GrantedAccessList : PACCESS_MASK;
  9326. AccessStatusList : PULONG
  9327. ): NTSTATUS; stdcall;
  9328. begin
  9329. GetProcedureAddress(_NtAccessCheckByTypeResultList, ntdll, 'NtAccessCheckByTypeResultList');
  9330. Result := TFNNtAccessCheckByTypeResultList(_NtAccessCheckByTypeResultList)(
  9331. SecurityDescriptor, PrincipalSelfSid, TokenHandle, DesiredAccess, ObjectTypeList, ObjectTypeListLength, GenericMapping, PrivilegeSet, PrivilegeSetLength, GrantedAccessList, AccessStatusList
  9332. );
  9333. end;
  9334. // Dynamic version of NtAccessCheckByTypeResultList
  9335. function ZwAccessCheckByTypeResultList(
  9336. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9337. PrincipalSelfSid : PSID;
  9338. TokenHandle : HANDLE;
  9339. DesiredAccess : ACCESS_MASK;
  9340. ObjectTypeList : POBJECT_TYPE_LIST;
  9341. ObjectTypeListLength : ULONG;
  9342. GenericMapping : PGENERIC_MAPPING;
  9343. PrivilegeSet : PPRIVILEGE_SET;
  9344. PrivilegeSetLength : PULONG;
  9345. GrantedAccessList : PACCESS_MASK;
  9346. AccessStatusList : PULONG
  9347. ): NTSTATUS; stdcall;
  9348. begin
  9349. GetProcedureAddress(_NtAccessCheckByTypeResultList, ntdll, 'NtAccessCheckByTypeResultList');
  9350. Result := TFNNtAccessCheckByTypeResultList(_NtAccessCheckByTypeResultList)(
  9351. SecurityDescriptor, PrincipalSelfSid, TokenHandle, DesiredAccess, ObjectTypeList, ObjectTypeListLength, GenericMapping, PrivilegeSet, PrivilegeSetLength, GrantedAccessList, AccessStatusList
  9352. );
  9353. end;
  9354. // Dynamic version of NtAccessCheckByTypeResultListAndAuditAlarm
  9355. function NtAccessCheckByTypeResultListAndAuditAlarm(
  9356. SubsystemName : PUNICODE_STRING;
  9357. HandleId : PVOID;
  9358. ObjectTypeName : PUNICODE_STRING;
  9359. ObjectName : PUNICODE_STRING;
  9360. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9361. PrincipalSelfSid : PSID;
  9362. DesiredAccess : ACCESS_MASK;
  9363. AuditType : AUDIT_EVENT_TYPE;
  9364. Flags : ULONG;
  9365. ObjectTypeList : POBJECT_TYPE_LIST;
  9366. ObjectTypeListLength : ULONG;
  9367. GenericMapping : PGENERIC_MAPPING;
  9368. ObjectCreation : BOOLEAN;
  9369. GrantedAccessList : PACCESS_MASK;
  9370. AccessStatusList : PULONG;
  9371. GenerateOnClose : PULONG
  9372. ): NTSTATUS; stdcall;
  9373. begin
  9374. GetProcedureAddress(_NtAccessCheckByTypeResultListAndAuditAlarm, ntdll, 'NtAccessCheckByTypeResultListAndAuditAlarm');
  9375. Result := TFNNtAccessCheckByTypeResultListAndAuditAlarm(_NtAccessCheckByTypeResultListAndAuditAlarm)(
  9376. SubsystemName, HandleId, ObjectTypeName, ObjectName, SecurityDescriptor, PrincipalSelfSid, DesiredAccess, AuditType, Flags, ObjectTypeList, ObjectTypeListLength, GenericMapping, ObjectCreation, GrantedAccessList, AccessStatusList,
  9377. GenerateOnClose
  9378. );
  9379. end;
  9380. // Dynamic version of NtAccessCheckByTypeResultListAndAuditAlarm
  9381. function ZwAccessCheckByTypeResultListAndAuditAlarm(
  9382. SubsystemName : PUNICODE_STRING;
  9383. HandleId : PVOID;
  9384. ObjectTypeName : PUNICODE_STRING;
  9385. ObjectName : PUNICODE_STRING;
  9386. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9387. PrincipalSelfSid : PSID;
  9388. DesiredAccess : ACCESS_MASK;
  9389. AuditType : AUDIT_EVENT_TYPE;
  9390. Flags : ULONG;
  9391. ObjectTypeList : POBJECT_TYPE_LIST;
  9392. ObjectTypeListLength : ULONG;
  9393. GenericMapping : PGENERIC_MAPPING;
  9394. ObjectCreation : BOOLEAN;
  9395. GrantedAccessList : PACCESS_MASK;
  9396. AccessStatusList : PULONG;
  9397. GenerateOnClose : PULONG
  9398. ): NTSTATUS; stdcall;
  9399. begin
  9400. GetProcedureAddress(_NtAccessCheckByTypeResultListAndAuditAlarm, ntdll, 'NtAccessCheckByTypeResultListAndAuditAlarm');
  9401. Result := TFNNtAccessCheckByTypeResultListAndAuditAlarm(_NtAccessCheckByTypeResultListAndAuditAlarm)(
  9402. SubsystemName, HandleId, ObjectTypeName, ObjectName, SecurityDescriptor, PrincipalSelfSid, DesiredAccess, AuditType, Flags, ObjectTypeList, ObjectTypeListLength, GenericMapping, ObjectCreation, GrantedAccessList, AccessStatusList,
  9403. GenerateOnClose
  9404. );
  9405. end;
  9406. // Dynamic version of NtAccessCheckByTypeResultListAndAuditAlarmByHandle
  9407. function NtAccessCheckByTypeResultListAndAuditAlarmByHandle(
  9408. SubsystemName : PUNICODE_STRING;
  9409. HandleId : PVOID;
  9410. TokenHandle : HANDLE;
  9411. ObjectTypeName : PUNICODE_STRING;
  9412. ObjectName : PUNICODE_STRING;
  9413. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9414. PrincipalSelfSid : PSID;
  9415. DesiredAccess : ACCESS_MASK;
  9416. AuditType : AUDIT_EVENT_TYPE;
  9417. Flags : ULONG;
  9418. ObjectTypeList : POBJECT_TYPE_LIST;
  9419. ObjectTypeListLength : ULONG;
  9420. GenericMapping : PGENERIC_MAPPING;
  9421. ObjectCreation : BOOLEAN;
  9422. GrantedAccessList : PACCESS_MASK;
  9423. AccessStatusList : PULONG;
  9424. GenerateOnClose : PULONG
  9425. ): NTSTATUS; stdcall;
  9426. begin
  9427. GetProcedureAddress(_NtAccessCheckByTypeResultListAndAuditAlarmByHandle, ntdll, 'NtAccessCheckByTypeResultListAndAuditAlarmByHandle');
  9428. Result := TFNNtAccessCheckByTypeResultListAndAuditAlarmByHandle(_NtAccessCheckByTypeResultListAndAuditAlarmByHandle)(
  9429. SubsystemName, HandleId, TokenHandle, ObjectTypeName, ObjectName, SecurityDescriptor, PrincipalSelfSid, DesiredAccess, AuditType, Flags, ObjectTypeList, ObjectTypeListLength, GenericMapping, ObjectCreation, GrantedAccessList,
  9430. AccessStatusList, GenerateOnClose
  9431. );
  9432. end;
  9433. // Dynamic version of NtAccessCheckByTypeResultListAndAuditAlarmByHandle
  9434. function ZwAccessCheckByTypeResultListAndAuditAlarmByHandle(
  9435. SubsystemName : PUNICODE_STRING;
  9436. HandleId : PVOID;
  9437. TokenHandle : HANDLE;
  9438. ObjectTypeName : PUNICODE_STRING;
  9439. ObjectName : PUNICODE_STRING;
  9440. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  9441. PrincipalSelfSid : PSID;
  9442. DesiredAccess : ACCESS_MASK;
  9443. AuditType : AUDIT_EVENT_TYPE;
  9444. Flags : ULONG;
  9445. ObjectTypeList : POBJECT_TYPE_LIST;
  9446. ObjectTypeListLength : ULONG;
  9447. GenericMapping : PGENERIC_MAPPING;
  9448. ObjectCreation : BOOLEAN;
  9449. GrantedAccessList : PACCESS_MASK;
  9450. AccessStatusList : PULONG;
  9451. GenerateOnClose : PULONG
  9452. ): NTSTATUS; stdcall;
  9453. begin
  9454. GetProcedureAddress(_NtAccessCheckByTypeResultListAndAuditAlarmByHandle, ntdll, 'NtAccessCheckByTypeResultListAndAuditAlarmByHandle');
  9455. Result := TFNNtAccessCheckByTypeResultListAndAuditAlarmByHandle(_NtAccessCheckByTypeResultListAndAuditAlarmByHandle)(
  9456. SubsystemName, HandleId, TokenHandle, ObjectTypeName, ObjectName, SecurityDescriptor, PrincipalSelfSid, DesiredAccess, AuditType, Flags, ObjectTypeList, ObjectTypeListLength, GenericMapping, ObjectCreation, GrantedAccessList,
  9457. AccessStatusList, GenerateOnClose
  9458. );
  9459. end;
  9460. // Dynamic version of NtAddAtom
  9461. function NtAddAtom(
  9462. Str : PWSTR;
  9463. StringLength : ULONG;
  9464. Atom : PUSHORT
  9465. ): NTSTATUS; stdcall;
  9466. begin
  9467. GetProcedureAddress(_NtAddAtom, ntdll, 'NtAddAtom');
  9468. Result := TFNNtAddAtom(_NtAddAtom)(
  9469. Str, StringLength, Atom
  9470. );
  9471. end;
  9472. // Dynamic version of NtAddAtom
  9473. function ZwAddAtom(
  9474. Str : PWSTR;
  9475. StringLength : ULONG;
  9476. Atom : PUSHORT
  9477. ): NTSTATUS; stdcall;
  9478. begin
  9479. GetProcedureAddress(_NtAddAtom, ntdll, 'NtAddAtom');
  9480. Result := TFNNtAddAtom(_NtAddAtom)(
  9481. Str, StringLength, Atom
  9482. );
  9483. end;
  9484. // Dynamic version of NtAdjustGroupsToken
  9485. function NtAdjustGroupsToken(
  9486. TokenHandle : HANDLE;
  9487. ResetToDefault : BOOLEAN;
  9488. NewState : PTOKEN_GROUPS;
  9489. BufferLength : ULONG;
  9490. PreviousState : PTOKEN_GROUPS;
  9491. ReturnLength : PULONG
  9492. ): NTSTATUS; stdcall;
  9493. begin
  9494. GetProcedureAddress(_NtAdjustGroupsToken, ntdll, 'NtAdjustGroupsToken');
  9495. Result := TFNNtAdjustGroupsToken(_NtAdjustGroupsToken)(
  9496. TokenHandle, ResetToDefault, NewState, BufferLength, PreviousState, ReturnLength
  9497. );
  9498. end;
  9499. // Dynamic version of NtAdjustGroupsToken
  9500. function ZwAdjustGroupsToken(
  9501. TokenHandle : HANDLE;
  9502. ResetToDefault : BOOLEAN;
  9503. NewState : PTOKEN_GROUPS;
  9504. BufferLength : ULONG;
  9505. PreviousState : PTOKEN_GROUPS;
  9506. ReturnLength : PULONG
  9507. ): NTSTATUS; stdcall;
  9508. begin
  9509. GetProcedureAddress(_NtAdjustGroupsToken, ntdll, 'NtAdjustGroupsToken');
  9510. Result := TFNNtAdjustGroupsToken(_NtAdjustGroupsToken)(
  9511. TokenHandle, ResetToDefault, NewState, BufferLength, PreviousState, ReturnLength
  9512. );
  9513. end;
  9514. // Dynamic version of NtAdjustPrivilegesToken
  9515. function NtAdjustPrivilegesToken(
  9516. TokenHandle : HANDLE;
  9517. DisableAllPrivileges : BOOLEAN;
  9518. NewState : PTOKEN_PRIVILEGES;
  9519. BufferLength : ULONG;
  9520. PreviousState : PTOKEN_PRIVILEGES;
  9521. ReturnLength : PULONG
  9522. ): NTSTATUS; stdcall;
  9523. begin
  9524. GetProcedureAddress(_NtAdjustPrivilegesToken, ntdll, 'NtAdjustPrivilegesToken');
  9525. Result := TFNNtAdjustPrivilegesToken(_NtAdjustPrivilegesToken)(
  9526. TokenHandle, DisableAllPrivileges, NewState, BufferLength, PreviousState, ReturnLength
  9527. );
  9528. end;
  9529. // Dynamic version of NtAdjustPrivilegesToken
  9530. function ZwAdjustPrivilegesToken(
  9531. TokenHandle : HANDLE;
  9532. DisableAllPrivileges : BOOLEAN;
  9533. NewState : PTOKEN_PRIVILEGES;
  9534. BufferLength : ULONG;
  9535. PreviousState : PTOKEN_PRIVILEGES;
  9536. ReturnLength : PULONG
  9537. ): NTSTATUS; stdcall;
  9538. begin
  9539. GetProcedureAddress(_NtAdjustPrivilegesToken, ntdll, 'NtAdjustPrivilegesToken');
  9540. Result := TFNNtAdjustPrivilegesToken(_NtAdjustPrivilegesToken)(
  9541. TokenHandle, DisableAllPrivileges, NewState, BufferLength, PreviousState, ReturnLength
  9542. );
  9543. end;
  9544. // Dynamic version of NtAlertResumeThread
  9545. function NtAlertResumeThread(
  9546. ThreadHandle : HANDLE;
  9547. PreviousSuspendCount : PULONG
  9548. ): NTSTATUS; stdcall;
  9549. begin
  9550. GetProcedureAddress(_NtAlertResumeThread, ntdll, 'NtAlertResumeThread');
  9551. Result := TFNNtAlertResumeThread(_NtAlertResumeThread)(
  9552. ThreadHandle, PreviousSuspendCount
  9553. );
  9554. end;
  9555. // Dynamic version of NtAlertResumeThread
  9556. function ZwAlertResumeThread(
  9557. ThreadHandle : HANDLE;
  9558. PreviousSuspendCount : PULONG
  9559. ): NTSTATUS; stdcall;
  9560. begin
  9561. GetProcedureAddress(_NtAlertResumeThread, ntdll, 'NtAlertResumeThread');
  9562. Result := TFNNtAlertResumeThread(_NtAlertResumeThread)(
  9563. ThreadHandle, PreviousSuspendCount
  9564. );
  9565. end;
  9566. // Dynamic version of NtAlertThread
  9567. function NtAlertThread(
  9568. ThreadHandle : HANDLE
  9569. ): NTSTATUS; stdcall;
  9570. begin
  9571. GetProcedureAddress(_NtAlertThread, ntdll, 'NtAlertThread');
  9572. Result := TFNNtAlertThread(_NtAlertThread)(
  9573. ThreadHandle
  9574. );
  9575. end;
  9576. // Dynamic version of NtAlertThread
  9577. function ZwAlertThread(
  9578. ThreadHandle : HANDLE
  9579. ): NTSTATUS; stdcall;
  9580. begin
  9581. GetProcedureAddress(_NtAlertThread, ntdll, 'NtAlertThread');
  9582. Result := TFNNtAlertThread(_NtAlertThread)(
  9583. ThreadHandle
  9584. );
  9585. end;
  9586. // Dynamic version of NtAllocateLocallyUniqueId
  9587. function NtAllocateLocallyUniqueId(
  9588. Luid : PLUID
  9589. ): NTSTATUS; stdcall;
  9590. begin
  9591. GetProcedureAddress(_NtAllocateLocallyUniqueId, ntdll, 'NtAllocateLocallyUniqueId');
  9592. Result := TFNNtAllocateLocallyUniqueId(_NtAllocateLocallyUniqueId)(
  9593. Luid
  9594. );
  9595. end;
  9596. // Dynamic version of NtAllocateLocallyUniqueId
  9597. function ZwAllocateLocallyUniqueId(
  9598. Luid : PLUID
  9599. ): NTSTATUS; stdcall;
  9600. begin
  9601. GetProcedureAddress(_NtAllocateLocallyUniqueId, ntdll, 'NtAllocateLocallyUniqueId');
  9602. Result := TFNNtAllocateLocallyUniqueId(_NtAllocateLocallyUniqueId)(
  9603. Luid
  9604. );
  9605. end;
  9606. // Dynamic version of NtAllocateUserPhysicalPages
  9607. function NtAllocateUserPhysicalPages(
  9608. ProcessHandle : HANDLE;
  9609. NumberOfPages : PULONG;
  9610. PageFrameNumbers : PULONG
  9611. ): NTSTATUS; stdcall;
  9612. begin
  9613. GetProcedureAddress(_NtAllocateUserPhysicalPages, ntdll, 'NtAllocateUserPhysicalPages');
  9614. Result := TFNNtAllocateUserPhysicalPages(_NtAllocateUserPhysicalPages)(
  9615. ProcessHandle, NumberOfPages, PageFrameNumbers
  9616. );
  9617. end;
  9618. // Dynamic version of NtAllocateUserPhysicalPages
  9619. function ZwAllocateUserPhysicalPages(
  9620. ProcessHandle : HANDLE;
  9621. NumberOfPages : PULONG;
  9622. PageFrameNumbers : PULONG
  9623. ): NTSTATUS; stdcall;
  9624. begin
  9625. GetProcedureAddress(_NtAllocateUserPhysicalPages, ntdll, 'NtAllocateUserPhysicalPages');
  9626. Result := TFNNtAllocateUserPhysicalPages(_NtAllocateUserPhysicalPages)(
  9627. ProcessHandle, NumberOfPages, PageFrameNumbers
  9628. );
  9629. end;
  9630. // Dynamic version of NtAllocateUuids
  9631. function NtAllocateUuids(
  9632. UuidLastTimeAllocated : PLARGE_INTEGER;
  9633. UuidDeltaTime : PULONG;
  9634. UuidSequenceNumber : PULONG;
  9635. UuidSeed : PUCHAR
  9636. ): NTSTATUS; stdcall;
  9637. begin
  9638. GetProcedureAddress(_NtAllocateUuids, ntdll, 'NtAllocateUuids');
  9639. Result := TFNNtAllocateUuids(_NtAllocateUuids)(
  9640. UuidLastTimeAllocated, UuidDeltaTime, UuidSequenceNumber, UuidSeed
  9641. );
  9642. end;
  9643. // Dynamic version of NtAllocateUuids
  9644. function ZwAllocateUuids(
  9645. UuidLastTimeAllocated : PLARGE_INTEGER;
  9646. UuidDeltaTime : PULONG;
  9647. UuidSequenceNumber : PULONG;
  9648. UuidSeed : PUCHAR
  9649. ): NTSTATUS; stdcall;
  9650. begin
  9651. GetProcedureAddress(_NtAllocateUuids, ntdll, 'NtAllocateUuids');
  9652. Result := TFNNtAllocateUuids(_NtAllocateUuids)(
  9653. UuidLastTimeAllocated, UuidDeltaTime, UuidSequenceNumber, UuidSeed
  9654. );
  9655. end;
  9656. // Dynamic version of NtAllocateVirtualMemory
  9657. function NtAllocateVirtualMemory(
  9658. ProcessHandle : HANDLE;
  9659. BaseAddress : PPVOID;
  9660. ZeroBits : ULONG;
  9661. AllocationSize : PULONG;
  9662. AllocationType : ULONG;
  9663. Protect : ULONG
  9664. ): NTSTATUS; stdcall;
  9665. begin
  9666. GetProcedureAddress(_NtAllocateVirtualMemory, ntdll, 'NtAllocateVirtualMemory');
  9667. Result := TFNNtAllocateVirtualMemory(_NtAllocateVirtualMemory)(
  9668. ProcessHandle, BaseAddress, ZeroBits, AllocationSize, AllocationType, Protect
  9669. );
  9670. end;
  9671. // Dynamic version of NtAllocateVirtualMemory
  9672. function ZwAllocateVirtualMemory(
  9673. ProcessHandle : HANDLE;
  9674. BaseAddress : PPVOID;
  9675. ZeroBits : ULONG;
  9676. AllocationSize : PULONG;
  9677. AllocationType : ULONG;
  9678. Protect : ULONG
  9679. ): NTSTATUS; stdcall;
  9680. begin
  9681. GetProcedureAddress(_NtAllocateVirtualMemory, ntdll, 'NtAllocateVirtualMemory');
  9682. Result := TFNNtAllocateVirtualMemory(_NtAllocateVirtualMemory)(
  9683. ProcessHandle, BaseAddress, ZeroBits, AllocationSize, AllocationType, Protect
  9684. );
  9685. end;
  9686. // Dynamic version of NtAreMappedFilesTheSame
  9687. function NtAreMappedFilesTheSame(
  9688. Address1 : PVOID;
  9689. Address2 : PVOID
  9690. ): NTSTATUS; stdcall;
  9691. begin
  9692. GetProcedureAddress(_NtAreMappedFilesTheSame, ntdll, 'NtAreMappedFilesTheSame');
  9693. Result := TFNNtAreMappedFilesTheSame(_NtAreMappedFilesTheSame)(
  9694. Address1, Address2
  9695. );
  9696. end;
  9697. // Dynamic version of NtAreMappedFilesTheSame
  9698. function ZwAreMappedFilesTheSame(
  9699. Address1 : PVOID;
  9700. Address2 : PVOID
  9701. ): NTSTATUS; stdcall;
  9702. begin
  9703. GetProcedureAddress(_NtAreMappedFilesTheSame, ntdll, 'NtAreMappedFilesTheSame');
  9704. Result := TFNNtAreMappedFilesTheSame(_NtAreMappedFilesTheSame)(
  9705. Address1, Address2
  9706. );
  9707. end;
  9708. // Dynamic version of NtAssignProcessToJobObject
  9709. function NtAssignProcessToJobObject(
  9710. JobHandle : HANDLE;
  9711. ProcessHandle : HANDLE
  9712. ): NTSTATUS; stdcall;
  9713. begin
  9714. GetProcedureAddress(_NtAssignProcessToJobObject, ntdll, 'NtAssignProcessToJobObject');
  9715. Result := TFNNtAssignProcessToJobObject(_NtAssignProcessToJobObject)(
  9716. JobHandle, ProcessHandle
  9717. );
  9718. end;
  9719. // Dynamic version of NtAssignProcessToJobObject
  9720. function ZwAssignProcessToJobObject(
  9721. JobHandle : HANDLE;
  9722. ProcessHandle : HANDLE
  9723. ): NTSTATUS; stdcall;
  9724. begin
  9725. GetProcedureAddress(_NtAssignProcessToJobObject, ntdll, 'NtAssignProcessToJobObject');
  9726. Result := TFNNtAssignProcessToJobObject(_NtAssignProcessToJobObject)(
  9727. JobHandle, ProcessHandle
  9728. );
  9729. end;
  9730. // Dynamic version of NtCallbackReturn
  9731. function NtCallbackReturn(
  9732. Result_ : PVOID;
  9733. ResultLength : ULONG;
  9734. Status : NTSTATUS
  9735. ): NTSTATUS; stdcall;
  9736. begin
  9737. GetProcedureAddress(_NtCallbackReturn, ntdll, 'NtCallbackReturn');
  9738. Result := TFNNtCallbackReturn(_NtCallbackReturn)(
  9739. Result_, ResultLength, Status
  9740. );
  9741. end;
  9742. // Dynamic version of NtCallbackReturn
  9743. function ZwCallbackReturn(
  9744. Result_ : PVOID;
  9745. ResultLength : ULONG;
  9746. Status : NTSTATUS
  9747. ): NTSTATUS; stdcall;
  9748. begin
  9749. GetProcedureAddress(_NtCallbackReturn, ntdll, 'NtCallbackReturn');
  9750. Result := TFNNtCallbackReturn(_NtCallbackReturn)(
  9751. Result_, ResultLength, Status
  9752. );
  9753. end;
  9754. // Dynamic version of NtCancelDeviceWakeupRequest
  9755. function NtCancelDeviceWakeupRequest(
  9756. DeviceHandle : HANDLE
  9757. ): NTSTATUS; stdcall;
  9758. begin
  9759. GetProcedureAddress(_NtCancelDeviceWakeupRequest, ntdll, 'NtCancelDeviceWakeupRequest');
  9760. Result := TFNNtCancelDeviceWakeupRequest(_NtCancelDeviceWakeupRequest)(
  9761. DeviceHandle
  9762. );
  9763. end;
  9764. // Dynamic version of NtCancelDeviceWakeupRequest
  9765. function ZwCancelDeviceWakeupRequest(
  9766. DeviceHandle : HANDLE
  9767. ): NTSTATUS; stdcall;
  9768. begin
  9769. GetProcedureAddress(_NtCancelDeviceWakeupRequest, ntdll, 'NtCancelDeviceWakeupRequest');
  9770. Result := TFNNtCancelDeviceWakeupRequest(_NtCancelDeviceWakeupRequest)(
  9771. DeviceHandle
  9772. );
  9773. end;
  9774. // Dynamic version of NtCancelIoFile
  9775. function NtCancelIoFile(
  9776. FileHandle : HANDLE;
  9777. IoStatusBlock : PIO_STATUS_BLOCK
  9778. ): NTSTATUS; stdcall;
  9779. begin
  9780. GetProcedureAddress(_NtCancelIoFile, ntdll, 'NtCancelIoFile');
  9781. Result := TFNNtCancelIoFile(_NtCancelIoFile)(
  9782. FileHandle, IoStatusBlock
  9783. );
  9784. end;
  9785. // Dynamic version of NtCancelIoFile
  9786. function ZwCancelIoFile(
  9787. FileHandle : HANDLE;
  9788. IoStatusBlock : PIO_STATUS_BLOCK
  9789. ): NTSTATUS; stdcall;
  9790. begin
  9791. GetProcedureAddress(_NtCancelIoFile, ntdll, 'NtCancelIoFile');
  9792. Result := TFNNtCancelIoFile(_NtCancelIoFile)(
  9793. FileHandle, IoStatusBlock
  9794. );
  9795. end;
  9796. // Dynamic version of NtCancelTimer
  9797. function NtCancelTimer(
  9798. TimerHandle : HANDLE;
  9799. PreviousState : PBOOLEAN
  9800. ): NTSTATUS; stdcall;
  9801. begin
  9802. GetProcedureAddress(_NtCancelTimer, ntdll, 'NtCancelTimer');
  9803. Result := TFNNtCancelTimer(_NtCancelTimer)(
  9804. TimerHandle, PreviousState
  9805. );
  9806. end;
  9807. // Dynamic version of NtCancelTimer
  9808. function ZwCancelTimer(
  9809. TimerHandle : HANDLE;
  9810. PreviousState : PBOOLEAN
  9811. ): NTSTATUS; stdcall;
  9812. begin
  9813. GetProcedureAddress(_NtCancelTimer, ntdll, 'NtCancelTimer');
  9814. Result := TFNNtCancelTimer(_NtCancelTimer)(
  9815. TimerHandle, PreviousState
  9816. );
  9817. end;
  9818. // Dynamic version of NtClearEvent
  9819. function NtClearEvent(
  9820. EventHandle : HANDLE
  9821. ): NTSTATUS; stdcall;
  9822. begin
  9823. GetProcedureAddress(_NtClearEvent, ntdll, 'NtClearEvent');
  9824. Result := TFNNtClearEvent(_NtClearEvent)(
  9825. EventHandle
  9826. );
  9827. end;
  9828. // Dynamic version of NtClearEvent
  9829. function ZwClearEvent(
  9830. EventHandle : HANDLE
  9831. ): NTSTATUS; stdcall;
  9832. begin
  9833. GetProcedureAddress(_NtClearEvent, ntdll, 'NtClearEvent');
  9834. Result := TFNNtClearEvent(_NtClearEvent)(
  9835. EventHandle
  9836. );
  9837. end;
  9838. {$IFNDEF JWA_INCLUDEMODE}
  9839. // Dynamic version of NtClose
  9840. function NtClose(
  9841. Handle : HANDLE
  9842. ): NTSTATUS; stdcall;
  9843. begin
  9844. GetProcedureAddress(_NtClose, ntdll, 'NtClose');
  9845. Result := TFNNtClose(_NtClose)(
  9846. Handle
  9847. );
  9848. end;
  9849. {$ENDIF JWA_INCLUDEMODE}
  9850. // Dynamic version of NtClose
  9851. function ZwClose(
  9852. Handle : HANDLE
  9853. ): NTSTATUS; stdcall;
  9854. begin
  9855. GetProcedureAddress(_NtClose, ntdll, 'NtClose');
  9856. Result := TFNNtClose(_NtClose)(
  9857. Handle
  9858. );
  9859. end;
  9860. // Dynamic version of NtCloseObjectAuditAlarm
  9861. function NtCloseObjectAuditAlarm(
  9862. SubsystemName : PUNICODE_STRING;
  9863. HandleId : PVOID;
  9864. GenerateOnClose : BOOLEAN
  9865. ): NTSTATUS; stdcall;
  9866. begin
  9867. GetProcedureAddress(_NtCloseObjectAuditAlarm, ntdll, 'NtCloseObjectAuditAlarm');
  9868. Result := TFNNtCloseObjectAuditAlarm(_NtCloseObjectAuditAlarm)(
  9869. SubsystemName, HandleId, GenerateOnClose
  9870. );
  9871. end;
  9872. // Dynamic version of NtCloseObjectAuditAlarm
  9873. function ZwCloseObjectAuditAlarm(
  9874. SubsystemName : PUNICODE_STRING;
  9875. HandleId : PVOID;
  9876. GenerateOnClose : BOOLEAN
  9877. ): NTSTATUS; stdcall;
  9878. begin
  9879. GetProcedureAddress(_NtCloseObjectAuditAlarm, ntdll, 'NtCloseObjectAuditAlarm');
  9880. Result := TFNNtCloseObjectAuditAlarm(_NtCloseObjectAuditAlarm)(
  9881. SubsystemName, HandleId, GenerateOnClose
  9882. );
  9883. end;
  9884. // Dynamic version of NtCompleteConnectPort
  9885. function NtCompleteConnectPort(
  9886. PortHandle : HANDLE
  9887. ): NTSTATUS; stdcall;
  9888. begin
  9889. GetProcedureAddress(_NtCompleteConnectPort, ntdll, 'NtCompleteConnectPort');
  9890. Result := TFNNtCompleteConnectPort(_NtCompleteConnectPort)(
  9891. PortHandle
  9892. );
  9893. end;
  9894. // Dynamic version of NtCompleteConnectPort
  9895. function ZwCompleteConnectPort(
  9896. PortHandle : HANDLE
  9897. ): NTSTATUS; stdcall;
  9898. begin
  9899. GetProcedureAddress(_NtCompleteConnectPort, ntdll, 'NtCompleteConnectPort');
  9900. Result := TFNNtCompleteConnectPort(_NtCompleteConnectPort)(
  9901. PortHandle
  9902. );
  9903. end;
  9904. // Dynamic version of NtConnectPort
  9905. function NtConnectPort(
  9906. PortHandle : PHANDLE;
  9907. PortName : PUNICODE_STRING;
  9908. SecurityQos : PSECURITY_QUALITY_OF_SERVICE;
  9909. WriteSection : PPORT_SECTION_WRITE;
  9910. ReadSection : PPORT_SECTION_READ;
  9911. MaxMessageSize : PULONG;
  9912. ConnectData : PVOID;
  9913. ConnectDataLength : PULONG
  9914. ): NTSTATUS; stdcall;
  9915. begin
  9916. GetProcedureAddress(_NtConnectPort, ntdll, 'NtConnectPort');
  9917. Result := TFNNtConnectPort(_NtConnectPort)(
  9918. PortHandle, PortName, SecurityQos, WriteSection, ReadSection, MaxMessageSize, ConnectData, ConnectDataLength
  9919. );
  9920. end;
  9921. // Dynamic version of NtConnectPort
  9922. function ZwConnectPort(
  9923. PortHandle : PHANDLE;
  9924. PortName : PUNICODE_STRING;
  9925. SecurityQos : PSECURITY_QUALITY_OF_SERVICE;
  9926. WriteSection : PPORT_SECTION_WRITE;
  9927. ReadSection : PPORT_SECTION_READ;
  9928. MaxMessageSize : PULONG;
  9929. ConnectData : PVOID;
  9930. ConnectDataLength : PULONG
  9931. ): NTSTATUS; stdcall;
  9932. begin
  9933. GetProcedureAddress(_NtConnectPort, ntdll, 'NtConnectPort');
  9934. Result := TFNNtConnectPort(_NtConnectPort)(
  9935. PortHandle, PortName, SecurityQos, WriteSection, ReadSection, MaxMessageSize, ConnectData, ConnectDataLength
  9936. );
  9937. end;
  9938. // Dynamic version of NtContinue
  9939. function NtContinue(
  9940. Context : PCONTEXT;
  9941. TestAlert : BOOLEAN
  9942. ): NTSTATUS; stdcall;
  9943. begin
  9944. GetProcedureAddress(_NtContinue, ntdll, 'NtContinue');
  9945. Result := TFNNtContinue(_NtContinue)(
  9946. Context, TestAlert
  9947. );
  9948. end;
  9949. // Dynamic version of NtContinue
  9950. function ZwContinue(
  9951. Context : PCONTEXT;
  9952. TestAlert : BOOLEAN
  9953. ): NTSTATUS; stdcall;
  9954. begin
  9955. GetProcedureAddress(_NtContinue, ntdll, 'NtContinue');
  9956. Result := TFNNtContinue(_NtContinue)(
  9957. Context, TestAlert
  9958. );
  9959. end;
  9960. // Dynamic version of NtCreateChannel
  9961. function NtCreateChannel(
  9962. ChannelHandle : PHANDLE;
  9963. ObjectAttributes : POBJECT_ATTRIBUTES
  9964. ): NTSTATUS; stdcall;
  9965. begin
  9966. GetProcedureAddress(_NtCreateChannel, ntdll, 'NtCreateChannel');
  9967. Result := TFNNtCreateChannel(_NtCreateChannel)(
  9968. ChannelHandle, ObjectAttributes
  9969. );
  9970. end;
  9971. // Dynamic version of NtCreateChannel
  9972. function ZwCreateChannel(
  9973. ChannelHandle : PHANDLE;
  9974. ObjectAttributes : POBJECT_ATTRIBUTES
  9975. ): NTSTATUS; stdcall;
  9976. begin
  9977. GetProcedureAddress(_NtCreateChannel, ntdll, 'NtCreateChannel');
  9978. Result := TFNNtCreateChannel(_NtCreateChannel)(
  9979. ChannelHandle, ObjectAttributes
  9980. );
  9981. end;
  9982. // Dynamic version of NtCreateDirectoryObject
  9983. function NtCreateDirectoryObject(
  9984. DirectoryHandle : PHANDLE;
  9985. DesiredAccess : ACCESS_MASK;
  9986. ObjectAttributes : POBJECT_ATTRIBUTES
  9987. ): NTSTATUS; stdcall;
  9988. begin
  9989. GetProcedureAddress(_NtCreateDirectoryObject, ntdll, 'NtCreateDirectoryObject');
  9990. Result := TFNNtCreateDirectoryObject(_NtCreateDirectoryObject)(
  9991. DirectoryHandle, DesiredAccess, ObjectAttributes
  9992. );
  9993. end;
  9994. // Dynamic version of NtCreateDirectoryObject
  9995. function ZwCreateDirectoryObject(
  9996. DirectoryHandle : PHANDLE;
  9997. DesiredAccess : ACCESS_MASK;
  9998. ObjectAttributes : POBJECT_ATTRIBUTES
  9999. ): NTSTATUS; stdcall;
  10000. begin
  10001. GetProcedureAddress(_NtCreateDirectoryObject, ntdll, 'NtCreateDirectoryObject');
  10002. Result := TFNNtCreateDirectoryObject(_NtCreateDirectoryObject)(
  10003. DirectoryHandle, DesiredAccess, ObjectAttributes
  10004. );
  10005. end;
  10006. // Dynamic version of NtCreateEvent
  10007. function NtCreateEvent(
  10008. EventHandle : PHANDLE;
  10009. DesiredAccess : ACCESS_MASK;
  10010. ObjectAttributes : POBJECT_ATTRIBUTES;
  10011. EventType : EVENT_TYPE;
  10012. InitialState : BOOLEAN
  10013. ): NTSTATUS; stdcall;
  10014. begin
  10015. GetProcedureAddress(_NtCreateEvent, ntdll, 'NtCreateEvent');
  10016. Result := TFNNtCreateEvent(_NtCreateEvent)(
  10017. EventHandle, DesiredAccess, ObjectAttributes, EventType, InitialState
  10018. );
  10019. end;
  10020. // Dynamic version of NtCreateEvent
  10021. function ZwCreateEvent(
  10022. EventHandle : PHANDLE;
  10023. DesiredAccess : ACCESS_MASK;
  10024. ObjectAttributes : POBJECT_ATTRIBUTES;
  10025. EventType : EVENT_TYPE;
  10026. InitialState : BOOLEAN
  10027. ): NTSTATUS; stdcall;
  10028. begin
  10029. GetProcedureAddress(_NtCreateEvent, ntdll, 'NtCreateEvent');
  10030. Result := TFNNtCreateEvent(_NtCreateEvent)(
  10031. EventHandle, DesiredAccess, ObjectAttributes, EventType, InitialState
  10032. );
  10033. end;
  10034. // Dynamic version of NtCreateEventPair
  10035. function NtCreateEventPair(
  10036. EventPairHandle : PHANDLE;
  10037. DesiredAccess : ACCESS_MASK;
  10038. ObjectAttributes : POBJECT_ATTRIBUTES
  10039. ): NTSTATUS; stdcall;
  10040. begin
  10041. GetProcedureAddress(_NtCreateEventPair, ntdll, 'NtCreateEventPair');
  10042. Result := TFNNtCreateEventPair(_NtCreateEventPair)(
  10043. EventPairHandle, DesiredAccess, ObjectAttributes
  10044. );
  10045. end;
  10046. // Dynamic version of NtCreateEventPair
  10047. function ZwCreateEventPair(
  10048. EventPairHandle : PHANDLE;
  10049. DesiredAccess : ACCESS_MASK;
  10050. ObjectAttributes : POBJECT_ATTRIBUTES
  10051. ): NTSTATUS; stdcall;
  10052. begin
  10053. GetProcedureAddress(_NtCreateEventPair, ntdll, 'NtCreateEventPair');
  10054. Result := TFNNtCreateEventPair(_NtCreateEventPair)(
  10055. EventPairHandle, DesiredAccess, ObjectAttributes
  10056. );
  10057. end;
  10058. {$IFNDEF JWA_INCLUDEMODE}
  10059. // Dynamic version of NtCreateFile
  10060. function NtCreateFile(
  10061. FileHandle : PHANDLE;
  10062. DesiredAccess : ACCESS_MASK;
  10063. ObjectAttributes : POBJECT_ATTRIBUTES;
  10064. IoStatusBlock : PIO_STATUS_BLOCK;
  10065. AllocationSize : PLARGE_INTEGER;
  10066. FileAttributes : ULONG;
  10067. ShareAccess : ULONG;
  10068. CreateDisposition : ULONG;
  10069. CreateOptions : ULONG;
  10070. EaBuffer : PVOID;
  10071. EaLength : ULONG
  10072. ): NTSTATUS; stdcall;
  10073. begin
  10074. GetProcedureAddress(_NtCreateFile, ntdll, 'NtCreateFile');
  10075. Result := TFNNtCreateFile(_NtCreateFile)(
  10076. FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, AllocationSize, FileAttributes, ShareAccess, CreateDisposition, CreateOptions, EaBuffer, EaLength
  10077. );
  10078. end;
  10079. {$ENDIF JWA_INCLUDEMODE}
  10080. // Dynamic version of NtCreateFile
  10081. function ZwCreateFile(
  10082. FileHandle : PHANDLE;
  10083. DesiredAccess : ACCESS_MASK;
  10084. ObjectAttributes : POBJECT_ATTRIBUTES;
  10085. IoStatusBlock : PIO_STATUS_BLOCK;
  10086. AllocationSize : PLARGE_INTEGER;
  10087. FileAttributes : ULONG;
  10088. ShareAccess : ULONG;
  10089. CreateDisposition : ULONG;
  10090. CreateOptions : ULONG;
  10091. EaBuffer : PVOID;
  10092. EaLength : ULONG
  10093. ): NTSTATUS; stdcall;
  10094. begin
  10095. GetProcedureAddress(_NtCreateFile, ntdll, 'NtCreateFile');
  10096. Result := TFNNtCreateFile(_NtCreateFile)(
  10097. FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, AllocationSize, FileAttributes, ShareAccess, CreateDisposition, CreateOptions, EaBuffer, EaLength
  10098. );
  10099. end;
  10100. // Dynamic version of NtCreateIoCompletion
  10101. function NtCreateIoCompletion(
  10102. IoCompletionHandle : PHANDLE;
  10103. DesiredAccess : ACCESS_MASK;
  10104. ObjectAttributes : POBJECT_ATTRIBUTES;
  10105. NumberOfConcurrentThreads : ULONG
  10106. ): NTSTATUS; stdcall;
  10107. begin
  10108. GetProcedureAddress(_NtCreateIoCompletion, ntdll, 'NtCreateIoCompletion');
  10109. Result := TFNNtCreateIoCompletion(_NtCreateIoCompletion)(
  10110. IoCompletionHandle, DesiredAccess, ObjectAttributes, NumberOfConcurrentThreads
  10111. );
  10112. end;
  10113. // Dynamic version of NtCreateIoCompletion
  10114. function ZwCreateIoCompletion(
  10115. IoCompletionHandle : PHANDLE;
  10116. DesiredAccess : ACCESS_MASK;
  10117. ObjectAttributes : POBJECT_ATTRIBUTES;
  10118. NumberOfConcurrentThreads : ULONG
  10119. ): NTSTATUS; stdcall;
  10120. begin
  10121. GetProcedureAddress(_NtCreateIoCompletion, ntdll, 'NtCreateIoCompletion');
  10122. Result := TFNNtCreateIoCompletion(_NtCreateIoCompletion)(
  10123. IoCompletionHandle, DesiredAccess, ObjectAttributes, NumberOfConcurrentThreads
  10124. );
  10125. end;
  10126. // Dynamic version of NtCreateJobObject
  10127. function NtCreateJobObject(
  10128. JobHandle : PHANDLE;
  10129. DesiredAccess : ACCESS_MASK;
  10130. ObjectAttributes : POBJECT_ATTRIBUTES
  10131. ): NTSTATUS; stdcall;
  10132. begin
  10133. GetProcedureAddress(_NtCreateJobObject, ntdll, 'NtCreateJobObject');
  10134. Result := TFNNtCreateJobObject(_NtCreateJobObject)(
  10135. JobHandle, DesiredAccess, ObjectAttributes
  10136. );
  10137. end;
  10138. // Dynamic version of NtCreateJobObject
  10139. function ZwCreateJobObject(
  10140. JobHandle : PHANDLE;
  10141. DesiredAccess : ACCESS_MASK;
  10142. ObjectAttributes : POBJECT_ATTRIBUTES
  10143. ): NTSTATUS; stdcall;
  10144. begin
  10145. GetProcedureAddress(_NtCreateJobObject, ntdll, 'NtCreateJobObject');
  10146. Result := TFNNtCreateJobObject(_NtCreateJobObject)(
  10147. JobHandle, DesiredAccess, ObjectAttributes
  10148. );
  10149. end;
  10150. // Dynamic version of NtCreateKey
  10151. function NtCreateKey(
  10152. KeyHandle : PHANDLE;
  10153. DesiredAccess : ACCESS_MASK;
  10154. ObjectAttributes : POBJECT_ATTRIBUTES;
  10155. TitleIndex : ULONG;
  10156. Class_ : PUNICODE_STRING;
  10157. CreateOptions : ULONG;
  10158. Disposition : PULONG
  10159. ): NTSTATUS; stdcall;
  10160. begin
  10161. GetProcedureAddress(_NtCreateKey, ntdll, 'NtCreateKey');
  10162. Result := TFNNtCreateKey(_NtCreateKey)(
  10163. KeyHandle, DesiredAccess, ObjectAttributes, TitleIndex, Class_, CreateOptions, Disposition
  10164. );
  10165. end;
  10166. // Dynamic version of NtCreateKey
  10167. function ZwCreateKey(
  10168. KeyHandle : PHANDLE;
  10169. DesiredAccess : ACCESS_MASK;
  10170. ObjectAttributes : POBJECT_ATTRIBUTES;
  10171. TitleIndex : ULONG;
  10172. Class_ : PUNICODE_STRING;
  10173. CreateOptions : ULONG;
  10174. Disposition : PULONG
  10175. ): NTSTATUS; stdcall;
  10176. begin
  10177. GetProcedureAddress(_NtCreateKey, ntdll, 'NtCreateKey');
  10178. Result := TFNNtCreateKey(_NtCreateKey)(
  10179. KeyHandle, DesiredAccess, ObjectAttributes, TitleIndex, Class_, CreateOptions, Disposition
  10180. );
  10181. end;
  10182. // Dynamic version of NtCreateMailslotFile
  10183. function NtCreateMailslotFile(
  10184. FileHandle : PHANDLE;
  10185. DesiredAccess : ACCESS_MASK;
  10186. ObjectAttributes : POBJECT_ATTRIBUTES;
  10187. IoStatusBlock : PIO_STATUS_BLOCK;
  10188. CreateOptions : ULONG;
  10189. Unknown : ULONG;
  10190. MaxMessageSize : ULONG;
  10191. ReadTimeout : PLARGE_INTEGER
  10192. ): NTSTATUS; stdcall;
  10193. begin
  10194. GetProcedureAddress(_NtCreateMailslotFile, ntdll, 'NtCreateMailslotFile');
  10195. Result := TFNNtCreateMailslotFile(_NtCreateMailslotFile)(
  10196. FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, CreateOptions, Unknown, MaxMessageSize, ReadTimeout
  10197. );
  10198. end;
  10199. // Dynamic version of NtCreateMailslotFile
  10200. function ZwCreateMailslotFile(
  10201. FileHandle : PHANDLE;
  10202. DesiredAccess : ACCESS_MASK;
  10203. ObjectAttributes : POBJECT_ATTRIBUTES;
  10204. IoStatusBlock : PIO_STATUS_BLOCK;
  10205. CreateOptions : ULONG;
  10206. Unknown : ULONG;
  10207. MaxMessageSize : ULONG;
  10208. ReadTimeout : PLARGE_INTEGER
  10209. ): NTSTATUS; stdcall;
  10210. begin
  10211. GetProcedureAddress(_NtCreateMailslotFile, ntdll, 'NtCreateMailslotFile');
  10212. Result := TFNNtCreateMailslotFile(_NtCreateMailslotFile)(
  10213. FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, CreateOptions, Unknown, MaxMessageSize, ReadTimeout
  10214. );
  10215. end;
  10216. // Dynamic version of NtCreateMutant
  10217. function NtCreateMutant(
  10218. MutantHandle : PHANDLE;
  10219. DesiredAccess : ACCESS_MASK;
  10220. ObjectAttributes : POBJECT_ATTRIBUTES;
  10221. InitialOwner : BOOLEAN
  10222. ): NTSTATUS; stdcall;
  10223. begin
  10224. GetProcedureAddress(_NtCreateMutant, ntdll, 'NtCreateMutant');
  10225. Result := TFNNtCreateMutant(_NtCreateMutant)(
  10226. MutantHandle, DesiredAccess, ObjectAttributes, InitialOwner
  10227. );
  10228. end;
  10229. // Dynamic version of NtCreateMutant
  10230. function ZwCreateMutant(
  10231. MutantHandle : PHANDLE;
  10232. DesiredAccess : ACCESS_MASK;
  10233. ObjectAttributes : POBJECT_ATTRIBUTES;
  10234. InitialOwner : BOOLEAN
  10235. ): NTSTATUS; stdcall;
  10236. begin
  10237. GetProcedureAddress(_NtCreateMutant, ntdll, 'NtCreateMutant');
  10238. Result := TFNNtCreateMutant(_NtCreateMutant)(
  10239. MutantHandle, DesiredAccess, ObjectAttributes, InitialOwner
  10240. );
  10241. end;
  10242. // Dynamic version of NtCreateNamedPipeFile
  10243. function NtCreateNamedPipeFile(
  10244. FileHandle : PHANDLE;
  10245. DesiredAccess : ACCESS_MASK;
  10246. ObjectAttributes : POBJECT_ATTRIBUTES;
  10247. IoStatusBlock : PIO_STATUS_BLOCK;
  10248. ShareAccess : ULONG;
  10249. CreateDisposition : ULONG;
  10250. CreateOptions : ULONG;
  10251. TypeMessage : BOOLEAN;
  10252. ReadmodeMessage : BOOLEAN;
  10253. Nonblocking : BOOLEAN;
  10254. MaxInstances : ULONG;
  10255. InBufferSize : ULONG;
  10256. OutBufferSize : ULONG;
  10257. DefaultTimeout : PLARGE_INTEGER
  10258. ): NTSTATUS; stdcall;
  10259. begin
  10260. GetProcedureAddress(_NtCreateNamedPipeFile, ntdll, 'NtCreateNamedPipeFile');
  10261. Result := TFNNtCreateNamedPipeFile(_NtCreateNamedPipeFile)(
  10262. FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, ShareAccess, CreateDisposition, CreateOptions, TypeMessage, ReadmodeMessage, Nonblocking, MaxInstances, InBufferSize, OutBufferSize, DefaultTimeout
  10263. );
  10264. end;
  10265. // Dynamic version of NtCreateNamedPipeFile
  10266. function ZwCreateNamedPipeFile(
  10267. FileHandle : PHANDLE;
  10268. DesiredAccess : ACCESS_MASK;
  10269. ObjectAttributes : POBJECT_ATTRIBUTES;
  10270. IoStatusBlock : PIO_STATUS_BLOCK;
  10271. ShareAccess : ULONG;
  10272. CreateDisposition : ULONG;
  10273. CreateOptions : ULONG;
  10274. TypeMessage : BOOLEAN;
  10275. ReadmodeMessage : BOOLEAN;
  10276. Nonblocking : BOOLEAN;
  10277. MaxInstances : ULONG;
  10278. InBufferSize : ULONG;
  10279. OutBufferSize : ULONG;
  10280. DefaultTimeout : PLARGE_INTEGER
  10281. ): NTSTATUS; stdcall;
  10282. begin
  10283. GetProcedureAddress(_NtCreateNamedPipeFile, ntdll, 'NtCreateNamedPipeFile');
  10284. Result := TFNNtCreateNamedPipeFile(_NtCreateNamedPipeFile)(
  10285. FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, ShareAccess, CreateDisposition, CreateOptions, TypeMessage, ReadmodeMessage, Nonblocking, MaxInstances, InBufferSize, OutBufferSize, DefaultTimeout
  10286. );
  10287. end;
  10288. // Dynamic version of NtCreatePagingFile
  10289. function NtCreatePagingFile(
  10290. FileName : PUNICODE_STRING;
  10291. InitialSize : PULARGE_INTEGER;
  10292. MaximumSize : PULARGE_INTEGER;
  10293. Reserved : ULONG
  10294. ): NTSTATUS; stdcall;
  10295. begin
  10296. GetProcedureAddress(_NtCreatePagingFile, ntdll, 'NtCreatePagingFile');
  10297. Result := TFNNtCreatePagingFile(_NtCreatePagingFile)(
  10298. FileName, InitialSize, MaximumSize, Reserved
  10299. );
  10300. end;
  10301. // Dynamic version of NtCreatePagingFile
  10302. function ZwCreatePagingFile(
  10303. FileName : PUNICODE_STRING;
  10304. InitialSize : PULARGE_INTEGER;
  10305. MaximumSize : PULARGE_INTEGER;
  10306. Reserved : ULONG
  10307. ): NTSTATUS; stdcall;
  10308. begin
  10309. GetProcedureAddress(_NtCreatePagingFile, ntdll, 'NtCreatePagingFile');
  10310. Result := TFNNtCreatePagingFile(_NtCreatePagingFile)(
  10311. FileName, InitialSize, MaximumSize, Reserved
  10312. );
  10313. end;
  10314. // Dynamic version of NtCreatePort
  10315. function NtCreatePort(
  10316. PortHandle : PHANDLE;
  10317. ObjectAttributes : POBJECT_ATTRIBUTES;
  10318. MaxDataSize : ULONG;
  10319. MaxMessageSize : ULONG;
  10320. Reserved : ULONG
  10321. ): NTSTATUS; stdcall;
  10322. begin
  10323. GetProcedureAddress(_NtCreatePort, ntdll, 'NtCreatePort');
  10324. Result := TFNNtCreatePort(_NtCreatePort)(
  10325. PortHandle, ObjectAttributes, MaxDataSize, MaxMessageSize, Reserved
  10326. );
  10327. end;
  10328. // Dynamic version of NtCreatePort
  10329. function ZwCreatePort(
  10330. PortHandle : PHANDLE;
  10331. ObjectAttributes : POBJECT_ATTRIBUTES;
  10332. MaxDataSize : ULONG;
  10333. MaxMessageSize : ULONG;
  10334. Reserved : ULONG
  10335. ): NTSTATUS; stdcall;
  10336. begin
  10337. GetProcedureAddress(_NtCreatePort, ntdll, 'NtCreatePort');
  10338. Result := TFNNtCreatePort(_NtCreatePort)(
  10339. PortHandle, ObjectAttributes, MaxDataSize, MaxMessageSize, Reserved
  10340. );
  10341. end;
  10342. // Dynamic version of NtCreateProcess
  10343. function NtCreateProcess(
  10344. ProcessHandle : PHANDLE;
  10345. DesiredAccess : ACCESS_MASK;
  10346. ObjectAttributes : POBJECT_ATTRIBUTES;
  10347. InheritFromProcessHandle : HANDLE;
  10348. InheritHandles : BOOLEAN;
  10349. SectionHandle : HANDLE;
  10350. DebugPort : HANDLE;
  10351. ExceptionPort : HANDLE
  10352. ): NTSTATUS; stdcall;
  10353. begin
  10354. GetProcedureAddress(_NtCreateProcess, ntdll, 'NtCreateProcess');
  10355. Result := TFNNtCreateProcess(_NtCreateProcess)(
  10356. ProcessHandle, DesiredAccess, ObjectAttributes, InheritFromProcessHandle, InheritHandles, SectionHandle, DebugPort, ExceptionPort
  10357. );
  10358. end;
  10359. // Dynamic version of NtCreateProcess
  10360. function ZwCreateProcess(
  10361. ProcessHandle : PHANDLE;
  10362. DesiredAccess : ACCESS_MASK;
  10363. ObjectAttributes : POBJECT_ATTRIBUTES;
  10364. InheritFromProcessHandle : HANDLE;
  10365. InheritHandles : BOOLEAN;
  10366. SectionHandle : HANDLE;
  10367. DebugPort : HANDLE;
  10368. ExceptionPort : HANDLE
  10369. ): NTSTATUS; stdcall;
  10370. begin
  10371. GetProcedureAddress(_NtCreateProcess, ntdll, 'NtCreateProcess');
  10372. Result := TFNNtCreateProcess(_NtCreateProcess)(
  10373. ProcessHandle, DesiredAccess, ObjectAttributes, InheritFromProcessHandle, InheritHandles, SectionHandle, DebugPort, ExceptionPort
  10374. );
  10375. end;
  10376. // Dynamic version of NtCreateProfile
  10377. function NtCreateProfile(
  10378. ProfileHandle : PHANDLE;
  10379. ProcessHandle : HANDLE;
  10380. Base : PVOID;
  10381. Size : ULONG;
  10382. BucketShift : ULONG;
  10383. Buffer : PULONG;
  10384. BufferLength : ULONG;
  10385. Source : KPROFILE_SOURCE;
  10386. ProcessorMask : ULONG
  10387. ): NTSTATUS; stdcall;
  10388. begin
  10389. GetProcedureAddress(_NtCreateProfile, ntdll, 'NtCreateProfile');
  10390. Result := TFNNtCreateProfile(_NtCreateProfile)(
  10391. ProfileHandle, ProcessHandle, Base, Size, BucketShift, Buffer, BufferLength, Source, ProcessorMask
  10392. );
  10393. end;
  10394. // Dynamic version of NtCreateProfile
  10395. function ZwCreateProfile(
  10396. ProfileHandle : PHANDLE;
  10397. ProcessHandle : HANDLE;
  10398. Base : PVOID;
  10399. Size : ULONG;
  10400. BucketShift : ULONG;
  10401. Buffer : PULONG;
  10402. BufferLength : ULONG;
  10403. Source : KPROFILE_SOURCE;
  10404. ProcessorMask : ULONG
  10405. ): NTSTATUS; stdcall;
  10406. begin
  10407. GetProcedureAddress(_NtCreateProfile, ntdll, 'NtCreateProfile');
  10408. Result := TFNNtCreateProfile(_NtCreateProfile)(
  10409. ProfileHandle, ProcessHandle, Base, Size, BucketShift, Buffer, BufferLength, Source, ProcessorMask
  10410. );
  10411. end;
  10412. // Dynamic version of NtCreateSection
  10413. function NtCreateSection(
  10414. SectionHandle : PHANDLE;
  10415. DesiredAccess : ACCESS_MASK;
  10416. ObjectAttributes : POBJECT_ATTRIBUTES;
  10417. SectionSize : PLARGE_INTEGER;
  10418. Protect : ULONG;
  10419. Attributes : ULONG;
  10420. FileHandle : HANDLE
  10421. ): NTSTATUS; stdcall;
  10422. begin
  10423. GetProcedureAddress(_NtCreateSection, ntdll, 'NtCreateSection');
  10424. Result := TFNNtCreateSection(_NtCreateSection)(
  10425. SectionHandle, DesiredAccess, ObjectAttributes, SectionSize, Protect, Attributes, FileHandle
  10426. );
  10427. end;
  10428. // Dynamic version of NtCreateSection
  10429. function ZwCreateSection(
  10430. SectionHandle : PHANDLE;
  10431. DesiredAccess : ACCESS_MASK;
  10432. ObjectAttributes : POBJECT_ATTRIBUTES;
  10433. SectionSize : PLARGE_INTEGER;
  10434. Protect : ULONG;
  10435. Attributes : ULONG;
  10436. FileHandle : HANDLE
  10437. ): NTSTATUS; stdcall;
  10438. begin
  10439. GetProcedureAddress(_NtCreateSection, ntdll, 'NtCreateSection');
  10440. Result := TFNNtCreateSection(_NtCreateSection)(
  10441. SectionHandle, DesiredAccess, ObjectAttributes, SectionSize, Protect, Attributes, FileHandle
  10442. );
  10443. end;
  10444. // Dynamic version of NtCreateSemaphore
  10445. function NtCreateSemaphore(
  10446. SemaphoreHandle : PHANDLE;
  10447. DesiredAccess : ACCESS_MASK;
  10448. ObjectAttributes : POBJECT_ATTRIBUTES;
  10449. InitialCount : LONG;
  10450. MaximumCount : LONG
  10451. ): NTSTATUS; stdcall;
  10452. begin
  10453. GetProcedureAddress(_NtCreateSemaphore, ntdll, 'NtCreateSemaphore');
  10454. Result := TFNNtCreateSemaphore(_NtCreateSemaphore)(
  10455. SemaphoreHandle, DesiredAccess, ObjectAttributes, InitialCount, MaximumCount
  10456. );
  10457. end;
  10458. // Dynamic version of NtCreateSemaphore
  10459. function ZwCreateSemaphore(
  10460. SemaphoreHandle : PHANDLE;
  10461. DesiredAccess : ACCESS_MASK;
  10462. ObjectAttributes : POBJECT_ATTRIBUTES;
  10463. InitialCount : LONG;
  10464. MaximumCount : LONG
  10465. ): NTSTATUS; stdcall;
  10466. begin
  10467. GetProcedureAddress(_NtCreateSemaphore, ntdll, 'NtCreateSemaphore');
  10468. Result := TFNNtCreateSemaphore(_NtCreateSemaphore)(
  10469. SemaphoreHandle, DesiredAccess, ObjectAttributes, InitialCount, MaximumCount
  10470. );
  10471. end;
  10472. // Dynamic version of NtCreateSymbolicLinkObject
  10473. function NtCreateSymbolicLinkObject(
  10474. SymbolicLinkHandle : PHANDLE;
  10475. DesiredAccess : ACCESS_MASK;
  10476. ObjectAttributes : POBJECT_ATTRIBUTES;
  10477. TargetName : PUNICODE_STRING
  10478. ): NTSTATUS; stdcall;
  10479. begin
  10480. GetProcedureAddress(_NtCreateSymbolicLinkObject, ntdll, 'NtCreateSymbolicLinkObject');
  10481. Result := TFNNtCreateSymbolicLinkObject(_NtCreateSymbolicLinkObject)(
  10482. SymbolicLinkHandle, DesiredAccess, ObjectAttributes, TargetName
  10483. );
  10484. end;
  10485. // Dynamic version of NtCreateSymbolicLinkObject
  10486. function ZwCreateSymbolicLinkObject(
  10487. SymbolicLinkHandle : PHANDLE;
  10488. DesiredAccess : ACCESS_MASK;
  10489. ObjectAttributes : POBJECT_ATTRIBUTES;
  10490. TargetName : PUNICODE_STRING
  10491. ): NTSTATUS; stdcall;
  10492. begin
  10493. GetProcedureAddress(_NtCreateSymbolicLinkObject, ntdll, 'NtCreateSymbolicLinkObject');
  10494. Result := TFNNtCreateSymbolicLinkObject(_NtCreateSymbolicLinkObject)(
  10495. SymbolicLinkHandle, DesiredAccess, ObjectAttributes, TargetName
  10496. );
  10497. end;
  10498. // Dynamic version of NtCreateThread
  10499. function NtCreateThread(
  10500. ThreadHandle : PHANDLE;
  10501. DesiredAccess : ACCESS_MASK;
  10502. ObjectAttributes : POBJECT_ATTRIBUTES;
  10503. ProcessHandle : HANDLE;
  10504. ClientId : PCLIENT_ID;
  10505. ThreadContext : PCONTEXT;
  10506. UserStack : PUSER_STACK;
  10507. CreateSuspended : BOOLEAN
  10508. ): NTSTATUS; stdcall;
  10509. begin
  10510. GetProcedureAddress(_NtCreateThread, ntdll, 'NtCreateThread');
  10511. Result := TFNNtCreateThread(_NtCreateThread)(
  10512. ThreadHandle, DesiredAccess, ObjectAttributes, ProcessHandle, ClientId, ThreadContext, UserStack, CreateSuspended
  10513. );
  10514. end;
  10515. // Dynamic version of NtCreateThread
  10516. function ZwCreateThread(
  10517. ThreadHandle : PHANDLE;
  10518. DesiredAccess : ACCESS_MASK;
  10519. ObjectAttributes : POBJECT_ATTRIBUTES;
  10520. ProcessHandle : HANDLE;
  10521. ClientId : PCLIENT_ID;
  10522. ThreadContext : PCONTEXT;
  10523. UserStack : PUSER_STACK;
  10524. CreateSuspended : BOOLEAN
  10525. ): NTSTATUS; stdcall;
  10526. begin
  10527. GetProcedureAddress(_NtCreateThread, ntdll, 'NtCreateThread');
  10528. Result := TFNNtCreateThread(_NtCreateThread)(
  10529. ThreadHandle, DesiredAccess, ObjectAttributes, ProcessHandle, ClientId, ThreadContext, UserStack, CreateSuspended
  10530. );
  10531. end;
  10532. // Dynamic version of NtCreateTimer
  10533. function NtCreateTimer(
  10534. TimerHandle : PHANDLE;
  10535. DesiredAccess : ACCESS_MASK;
  10536. ObjectAttributes : POBJECT_ATTRIBUTES;
  10537. TimerType : TIMER_TYPE
  10538. ): NTSTATUS; stdcall;
  10539. begin
  10540. GetProcedureAddress(_NtCreateTimer, ntdll, 'NtCreateTimer');
  10541. Result := TFNNtCreateTimer(_NtCreateTimer)(
  10542. TimerHandle, DesiredAccess, ObjectAttributes, TimerType
  10543. );
  10544. end;
  10545. // Dynamic version of NtCreateTimer
  10546. function ZwCreateTimer(
  10547. TimerHandle : PHANDLE;
  10548. DesiredAccess : ACCESS_MASK;
  10549. ObjectAttributes : POBJECT_ATTRIBUTES;
  10550. TimerType : TIMER_TYPE
  10551. ): NTSTATUS; stdcall;
  10552. begin
  10553. GetProcedureAddress(_NtCreateTimer, ntdll, 'NtCreateTimer');
  10554. Result := TFNNtCreateTimer(_NtCreateTimer)(
  10555. TimerHandle, DesiredAccess, ObjectAttributes, TimerType
  10556. );
  10557. end;
  10558. // Dynamic version of NtCreateToken
  10559. function NtCreateToken(
  10560. TokenHandle : PHANDLE;
  10561. DesiredAccess : ACCESS_MASK;
  10562. ObjectAttributes : POBJECT_ATTRIBUTES;
  10563. Type_ : TOKEN_TYPE;
  10564. AuthenticationId : PLUID;
  10565. ExpirationTime : PLARGE_INTEGER;
  10566. User : PTOKEN_USER;
  10567. Groups : PTOKEN_GROUPS;
  10568. Privileges : PTOKEN_PRIVILEGES;
  10569. Owner : PTOKEN_OWNER;
  10570. PrimaryGroup : PTOKEN_PRIMARY_GROUP;
  10571. DefaultDacl : PTOKEN_DEFAULT_DACL;
  10572. Source : PTOKEN_SOURCE
  10573. ): NTSTATUS; stdcall;
  10574. begin
  10575. GetProcedureAddress(_NtCreateToken, ntdll, 'NtCreateToken');
  10576. Result := TFNNtCreateToken(_NtCreateToken)(
  10577. TokenHandle, DesiredAccess, ObjectAttributes, Type_, AuthenticationId, ExpirationTime, User, Groups, Privileges, Owner, PrimaryGroup, DefaultDacl, Source
  10578. );
  10579. end;
  10580. // Dynamic version of NtCreateToken
  10581. function ZwCreateToken(
  10582. TokenHandle : PHANDLE;
  10583. DesiredAccess : ACCESS_MASK;
  10584. ObjectAttributes : POBJECT_ATTRIBUTES;
  10585. Type_ : TOKEN_TYPE;
  10586. AuthenticationId : PLUID;
  10587. ExpirationTime : PLARGE_INTEGER;
  10588. User : PTOKEN_USER;
  10589. Groups : PTOKEN_GROUPS;
  10590. Privileges : PTOKEN_PRIVILEGES;
  10591. Owner : PTOKEN_OWNER;
  10592. PrimaryGroup : PTOKEN_PRIMARY_GROUP;
  10593. DefaultDacl : PTOKEN_DEFAULT_DACL;
  10594. Source : PTOKEN_SOURCE
  10595. ): NTSTATUS; stdcall;
  10596. begin
  10597. GetProcedureAddress(_NtCreateToken, ntdll, 'NtCreateToken');
  10598. Result := TFNNtCreateToken(_NtCreateToken)(
  10599. TokenHandle, DesiredAccess, ObjectAttributes, Type_, AuthenticationId, ExpirationTime, User, Groups, Privileges, Owner, PrimaryGroup, DefaultDacl, Source
  10600. );
  10601. end;
  10602. // Dynamic version of NtCreateWaitablePort
  10603. function NtCreateWaitablePort(
  10604. PortHandle : PHANDLE;
  10605. ObjectAttributes : POBJECT_ATTRIBUTES;
  10606. MaxDataSize : ULONG;
  10607. MaxMessageSize : ULONG;
  10608. Reserved : ULONG
  10609. ): NTSTATUS; stdcall;
  10610. begin
  10611. GetProcedureAddress(_NtCreateWaitablePort, ntdll, 'NtCreateWaitablePort');
  10612. Result := TFNNtCreateWaitablePort(_NtCreateWaitablePort)(
  10613. PortHandle, ObjectAttributes, MaxDataSize, MaxMessageSize, Reserved
  10614. );
  10615. end;
  10616. // Dynamic version of NtCreateWaitablePort
  10617. function ZwCreateWaitablePort(
  10618. PortHandle : PHANDLE;
  10619. ObjectAttributes : POBJECT_ATTRIBUTES;
  10620. MaxDataSize : ULONG;
  10621. MaxMessageSize : ULONG;
  10622. Reserved : ULONG
  10623. ): NTSTATUS; stdcall;
  10624. begin
  10625. GetProcedureAddress(_NtCreateWaitablePort, ntdll, 'NtCreateWaitablePort');
  10626. Result := TFNNtCreateWaitablePort(_NtCreateWaitablePort)(
  10627. PortHandle, ObjectAttributes, MaxDataSize, MaxMessageSize, Reserved
  10628. );
  10629. end;
  10630. {.$IFNDEF JWA_INCLUDEMODE}
  10631. // Dynamic version of NtCurrentTeb
  10632. function NtCurrentTeb(): PTEB; stdcall;
  10633. begin
  10634. GetProcedureAddress(_NtCurrentTeb, ntdll, 'NtCurrentTeb');
  10635. Result := TFNNtCurrentTeb(_NtCurrentTeb)();
  10636. end;
  10637. {.$ENDIF JWA_INCLUDEMODE}
  10638. // Dynamic version of NtCurrentTeb
  10639. function ZwCurrentTeb(): PTEB; stdcall;
  10640. begin
  10641. GetProcedureAddress(_NtCurrentTeb, ntdll, 'NtCurrentTeb');
  10642. Result := TFNNtCurrentTeb(_NtCurrentTeb)();
  10643. end;
  10644. // Dynamic version of NtDebugActiveProcess
  10645. function NtDebugActiveProcess(
  10646. hProcess : HANDLE;
  10647. hDebugObject : HANDLE
  10648. ): NTSTATUS; stdcall;
  10649. begin
  10650. GetProcedureAddress(_NtDebugActiveProcess, ntdll, 'NtDebugActiveProcess');
  10651. Result := TFNNtDebugActiveProcess(_NtDebugActiveProcess)(
  10652. hProcess, hDebugObject
  10653. );
  10654. end;
  10655. // Dynamic version of NtDebugActiveProcess
  10656. function ZwDebugActiveProcess(
  10657. hProcess : HANDLE;
  10658. hDebugObject : HANDLE
  10659. ): NTSTATUS; stdcall;
  10660. begin
  10661. GetProcedureAddress(_NtDebugActiveProcess, ntdll, 'NtDebugActiveProcess');
  10662. Result := TFNNtDebugActiveProcess(_NtDebugActiveProcess)(
  10663. hProcess, hDebugObject
  10664. );
  10665. end;
  10666. // Dynamic version of NtDelayExecution
  10667. function NtDelayExecution(
  10668. Alertable : BOOLEAN;
  10669. Interval : PLARGE_INTEGER
  10670. ): NTSTATUS; stdcall;
  10671. begin
  10672. GetProcedureAddress(_NtDelayExecution, ntdll, 'NtDelayExecution');
  10673. Result := TFNNtDelayExecution(_NtDelayExecution)(
  10674. Alertable, Interval
  10675. );
  10676. end;
  10677. // Dynamic version of NtDelayExecution
  10678. function ZwDelayExecution(
  10679. Alertable : BOOLEAN;
  10680. Interval : PLARGE_INTEGER
  10681. ): NTSTATUS; stdcall;
  10682. begin
  10683. GetProcedureAddress(_NtDelayExecution, ntdll, 'NtDelayExecution');
  10684. Result := TFNNtDelayExecution(_NtDelayExecution)(
  10685. Alertable, Interval
  10686. );
  10687. end;
  10688. // Dynamic version of NtDeleteAtom
  10689. function NtDeleteAtom(
  10690. Atom : USHORT
  10691. ): NTSTATUS; stdcall;
  10692. begin
  10693. GetProcedureAddress(_NtDeleteAtom, ntdll, 'NtDeleteAtom');
  10694. Result := TFNNtDeleteAtom(_NtDeleteAtom)(
  10695. Atom
  10696. );
  10697. end;
  10698. // Dynamic version of NtDeleteAtom
  10699. function ZwDeleteAtom(
  10700. Atom : USHORT
  10701. ): NTSTATUS; stdcall;
  10702. begin
  10703. GetProcedureAddress(_NtDeleteAtom, ntdll, 'NtDeleteAtom');
  10704. Result := TFNNtDeleteAtom(_NtDeleteAtom)(
  10705. Atom
  10706. );
  10707. end;
  10708. // Dynamic version of NtDeleteFile
  10709. function NtDeleteFile(
  10710. ObjectAttributes : POBJECT_ATTRIBUTES
  10711. ): NTSTATUS; stdcall;
  10712. begin
  10713. GetProcedureAddress(_NtDeleteFile, ntdll, 'NtDeleteFile');
  10714. Result := TFNNtDeleteFile(_NtDeleteFile)(
  10715. ObjectAttributes
  10716. );
  10717. end;
  10718. // Dynamic version of NtDeleteFile
  10719. function ZwDeleteFile(
  10720. ObjectAttributes : POBJECT_ATTRIBUTES
  10721. ): NTSTATUS; stdcall;
  10722. begin
  10723. GetProcedureAddress(_NtDeleteFile, ntdll, 'NtDeleteFile');
  10724. Result := TFNNtDeleteFile(_NtDeleteFile)(
  10725. ObjectAttributes
  10726. );
  10727. end;
  10728. // Dynamic version of NtDeleteKey
  10729. function NtDeleteKey(
  10730. KeyHandle : HANDLE
  10731. ): NTSTATUS; stdcall;
  10732. begin
  10733. GetProcedureAddress(_NtDeleteKey, ntdll, 'NtDeleteKey');
  10734. Result := TFNNtDeleteKey(_NtDeleteKey)(
  10735. KeyHandle
  10736. );
  10737. end;
  10738. // Dynamic version of NtDeleteKey
  10739. function ZwDeleteKey(
  10740. KeyHandle : HANDLE
  10741. ): NTSTATUS; stdcall;
  10742. begin
  10743. GetProcedureAddress(_NtDeleteKey, ntdll, 'NtDeleteKey');
  10744. Result := TFNNtDeleteKey(_NtDeleteKey)(
  10745. KeyHandle
  10746. );
  10747. end;
  10748. // Dynamic version of NtDeleteObjectAuditAlarm
  10749. function NtDeleteObjectAuditAlarm(
  10750. SubsystemName : PUNICODE_STRING;
  10751. HandleId : PVOID;
  10752. GenerateOnClose : BOOLEAN
  10753. ): NTSTATUS; stdcall;
  10754. begin
  10755. GetProcedureAddress(_NtDeleteObjectAuditAlarm, ntdll, 'NtDeleteObjectAuditAlarm');
  10756. Result := TFNNtDeleteObjectAuditAlarm(_NtDeleteObjectAuditAlarm)(
  10757. SubsystemName, HandleId, GenerateOnClose
  10758. );
  10759. end;
  10760. // Dynamic version of NtDeleteObjectAuditAlarm
  10761. function ZwDeleteObjectAuditAlarm(
  10762. SubsystemName : PUNICODE_STRING;
  10763. HandleId : PVOID;
  10764. GenerateOnClose : BOOLEAN
  10765. ): NTSTATUS; stdcall;
  10766. begin
  10767. GetProcedureAddress(_NtDeleteObjectAuditAlarm, ntdll, 'NtDeleteObjectAuditAlarm');
  10768. Result := TFNNtDeleteObjectAuditAlarm(_NtDeleteObjectAuditAlarm)(
  10769. SubsystemName, HandleId, GenerateOnClose
  10770. );
  10771. end;
  10772. // Dynamic version of NtDeleteValueKey
  10773. function NtDeleteValueKey(
  10774. KeyHandle : HANDLE;
  10775. ValueName : PUNICODE_STRING
  10776. ): NTSTATUS; stdcall;
  10777. begin
  10778. GetProcedureAddress(_NtDeleteValueKey, ntdll, 'NtDeleteValueKey');
  10779. Result := TFNNtDeleteValueKey(_NtDeleteValueKey)(
  10780. KeyHandle, ValueName
  10781. );
  10782. end;
  10783. // Dynamic version of NtDeleteValueKey
  10784. function ZwDeleteValueKey(
  10785. KeyHandle : HANDLE;
  10786. ValueName : PUNICODE_STRING
  10787. ): NTSTATUS; stdcall;
  10788. begin
  10789. GetProcedureAddress(_NtDeleteValueKey, ntdll, 'NtDeleteValueKey');
  10790. Result := TFNNtDeleteValueKey(_NtDeleteValueKey)(
  10791. KeyHandle, ValueName
  10792. );
  10793. end;
  10794. {$IFNDEF JWA_INCLUDEMODE}
  10795. // Dynamic version of NtDeviceIoControlFile
  10796. function NtDeviceIoControlFile(
  10797. FileHandle : HANDLE;
  10798. Event : HANDLE;
  10799. ApcRoutine : PIO_APC_ROUTINE;
  10800. ApcContext : PVOID;
  10801. IoStatusBlock : PIO_STATUS_BLOCK;
  10802. IoControlCode : ULONG;
  10803. InputBuffer : PVOID;
  10804. InputBufferLength : ULONG;
  10805. OutputBuffer : PVOID;
  10806. OutputBufferLength : ULONG
  10807. ): NTSTATUS; stdcall;
  10808. begin
  10809. GetProcedureAddress(_NtDeviceIoControlFile, ntdll, 'NtDeviceIoControlFile');
  10810. Result := TFNNtDeviceIoControlFile(_NtDeviceIoControlFile)(
  10811. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, IoControlCode, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength
  10812. );
  10813. end;
  10814. {$ENDIF JWA_INCLUDEMODE}
  10815. // Dynamic version of NtDeviceIoControlFile
  10816. function ZwDeviceIoControlFile(
  10817. FileHandle : HANDLE;
  10818. Event : HANDLE;
  10819. ApcRoutine : PIO_APC_ROUTINE;
  10820. ApcContext : PVOID;
  10821. IoStatusBlock : PIO_STATUS_BLOCK;
  10822. IoControlCode : ULONG;
  10823. InputBuffer : PVOID;
  10824. InputBufferLength : ULONG;
  10825. OutputBuffer : PVOID;
  10826. OutputBufferLength : ULONG
  10827. ): NTSTATUS; stdcall;
  10828. begin
  10829. GetProcedureAddress(_NtDeviceIoControlFile, ntdll, 'NtDeviceIoControlFile');
  10830. Result := TFNNtDeviceIoControlFile(_NtDeviceIoControlFile)(
  10831. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, IoControlCode, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength
  10832. );
  10833. end;
  10834. // Dynamic version of NtDisplayString
  10835. function NtDisplayString(
  10836. Str : PUNICODE_STRING
  10837. ): NTSTATUS; stdcall;
  10838. begin
  10839. GetProcedureAddress(_NtDisplayString, ntdll, 'NtDisplayString');
  10840. Result := TFNNtDisplayString(_NtDisplayString)(
  10841. Str
  10842. );
  10843. end;
  10844. // Dynamic version of NtDisplayString
  10845. function ZwDisplayString(
  10846. Str : PUNICODE_STRING
  10847. ): NTSTATUS; stdcall;
  10848. begin
  10849. GetProcedureAddress(_NtDisplayString, ntdll, 'NtDisplayString');
  10850. Result := TFNNtDisplayString(_NtDisplayString)(
  10851. Str
  10852. );
  10853. end;
  10854. // Dynamic version of NtDuplicateObject
  10855. function NtDuplicateObject(
  10856. SourceProcessHandle : HANDLE;
  10857. SourceHandle : HANDLE;
  10858. TargetProcessHandle : HANDLE;
  10859. TargetHandle : PHANDLE;
  10860. DesiredAccess : ACCESS_MASK;
  10861. Attributes : ULONG;
  10862. Options : ULONG
  10863. ): NTSTATUS; stdcall;
  10864. begin
  10865. GetProcedureAddress(_NtDuplicateObject, ntdll, 'NtDuplicateObject');
  10866. Result := TFNNtDuplicateObject(_NtDuplicateObject)(
  10867. SourceProcessHandle, SourceHandle, TargetProcessHandle, TargetHandle, DesiredAccess, Attributes, Options
  10868. );
  10869. end;
  10870. // Dynamic version of NtDuplicateObject
  10871. function ZwDuplicateObject(
  10872. SourceProcessHandle : HANDLE;
  10873. SourceHandle : HANDLE;
  10874. TargetProcessHandle : HANDLE;
  10875. TargetHandle : PHANDLE;
  10876. DesiredAccess : ACCESS_MASK;
  10877. Attributes : ULONG;
  10878. Options : ULONG
  10879. ): NTSTATUS; stdcall;
  10880. begin
  10881. GetProcedureAddress(_NtDuplicateObject, ntdll, 'NtDuplicateObject');
  10882. Result := TFNNtDuplicateObject(_NtDuplicateObject)(
  10883. SourceProcessHandle, SourceHandle, TargetProcessHandle, TargetHandle, DesiredAccess, Attributes, Options
  10884. );
  10885. end;
  10886. // Dynamic version of NtDuplicateToken
  10887. function NtDuplicateToken(
  10888. ExistingTokenHandle : HANDLE;
  10889. DesiredAccess : ACCESS_MASK;
  10890. ObjectAttributes : POBJECT_ATTRIBUTES;
  10891. EffectiveOnly : BOOLEAN;
  10892. TokenType : TOKEN_TYPE;
  10893. NewTokenHandle : PHANDLE
  10894. ): NTSTATUS; stdcall;
  10895. begin
  10896. GetProcedureAddress(_NtDuplicateToken, ntdll, 'NtDuplicateToken');
  10897. Result := TFNNtDuplicateToken(_NtDuplicateToken)(
  10898. ExistingTokenHandle, DesiredAccess, ObjectAttributes, EffectiveOnly, TokenType, NewTokenHandle
  10899. );
  10900. end;
  10901. // Dynamic version of NtDuplicateToken
  10902. function ZwDuplicateToken(
  10903. ExistingTokenHandle : HANDLE;
  10904. DesiredAccess : ACCESS_MASK;
  10905. ObjectAttributes : POBJECT_ATTRIBUTES;
  10906. EffectiveOnly : BOOLEAN;
  10907. TokenType : TOKEN_TYPE;
  10908. NewTokenHandle : PHANDLE
  10909. ): NTSTATUS; stdcall;
  10910. begin
  10911. GetProcedureAddress(_NtDuplicateToken, ntdll, 'NtDuplicateToken');
  10912. Result := TFNNtDuplicateToken(_NtDuplicateToken)(
  10913. ExistingTokenHandle, DesiredAccess, ObjectAttributes, EffectiveOnly, TokenType, NewTokenHandle
  10914. );
  10915. end;
  10916. // Dynamic version of NtEnumerateKey
  10917. function NtEnumerateKey(
  10918. KeyHandle : HANDLE;
  10919. Index : ULONG;
  10920. KeyInformationClass : KEY_INFORMATION_CLASS;
  10921. KeyInformation : PVOID;
  10922. KeyInformationLength : ULONG;
  10923. ResultLength : PULONG
  10924. ): NTSTATUS; stdcall;
  10925. begin
  10926. GetProcedureAddress(_NtEnumerateKey, ntdll, 'NtEnumerateKey');
  10927. Result := TFNNtEnumerateKey(_NtEnumerateKey)(
  10928. KeyHandle, Index, KeyInformationClass, KeyInformation, KeyInformationLength, ResultLength
  10929. );
  10930. end;
  10931. // Dynamic version of NtEnumerateKey
  10932. function ZwEnumerateKey(
  10933. KeyHandle : HANDLE;
  10934. Index : ULONG;
  10935. KeyInformationClass : KEY_INFORMATION_CLASS;
  10936. KeyInformation : PVOID;
  10937. KeyInformationLength : ULONG;
  10938. ResultLength : PULONG
  10939. ): NTSTATUS; stdcall;
  10940. begin
  10941. GetProcedureAddress(_NtEnumerateKey, ntdll, 'NtEnumerateKey');
  10942. Result := TFNNtEnumerateKey(_NtEnumerateKey)(
  10943. KeyHandle, Index, KeyInformationClass, KeyInformation, KeyInformationLength, ResultLength
  10944. );
  10945. end;
  10946. // Dynamic version of NtEnumerateValueKey
  10947. function NtEnumerateValueKey(
  10948. KeyHandle : HANDLE;
  10949. Index : ULONG;
  10950. KeyValueInformationClass : KEY_VALUE_INFORMATION_CLASS;
  10951. KeyValueInformation : PVOID;
  10952. KeyValueInformationLength : ULONG;
  10953. ResultLength : PULONG
  10954. ): NTSTATUS; stdcall;
  10955. begin
  10956. GetProcedureAddress(_NtEnumerateValueKey, ntdll, 'NtEnumerateValueKey');
  10957. Result := TFNNtEnumerateValueKey(_NtEnumerateValueKey)(
  10958. KeyHandle, Index, KeyValueInformationClass, KeyValueInformation, KeyValueInformationLength, ResultLength
  10959. );
  10960. end;
  10961. // Dynamic version of NtEnumerateValueKey
  10962. function ZwEnumerateValueKey(
  10963. KeyHandle : HANDLE;
  10964. Index : ULONG;
  10965. KeyValueInformationClass : KEY_VALUE_INFORMATION_CLASS;
  10966. KeyValueInformation : PVOID;
  10967. KeyValueInformationLength : ULONG;
  10968. ResultLength : PULONG
  10969. ): NTSTATUS; stdcall;
  10970. begin
  10971. GetProcedureAddress(_NtEnumerateValueKey, ntdll, 'NtEnumerateValueKey');
  10972. Result := TFNNtEnumerateValueKey(_NtEnumerateValueKey)(
  10973. KeyHandle, Index, KeyValueInformationClass, KeyValueInformation, KeyValueInformationLength, ResultLength
  10974. );
  10975. end;
  10976. // Dynamic version of NtExtendSection
  10977. function NtExtendSection(
  10978. SectionHandle : HANDLE;
  10979. SectionSize : PLARGE_INTEGER
  10980. ): NTSTATUS; stdcall;
  10981. begin
  10982. GetProcedureAddress(_NtExtendSection, ntdll, 'NtExtendSection');
  10983. Result := TFNNtExtendSection(_NtExtendSection)(
  10984. SectionHandle, SectionSize
  10985. );
  10986. end;
  10987. // Dynamic version of NtExtendSection
  10988. function ZwExtendSection(
  10989. SectionHandle : HANDLE;
  10990. SectionSize : PLARGE_INTEGER
  10991. ): NTSTATUS; stdcall;
  10992. begin
  10993. GetProcedureAddress(_NtExtendSection, ntdll, 'NtExtendSection');
  10994. Result := TFNNtExtendSection(_NtExtendSection)(
  10995. SectionHandle, SectionSize
  10996. );
  10997. end;
  10998. // Dynamic version of NtFilterToken
  10999. function NtFilterToken(
  11000. ExistingTokenHandle : HANDLE;
  11001. Flags : ULONG;
  11002. SidsToDisable : PTOKEN_GROUPS;
  11003. PrivilegesToDelete : PTOKEN_PRIVILEGES;
  11004. SidsToRestricted : PTOKEN_GROUPS;
  11005. NewTokenHandle : PHANDLE
  11006. ): NTSTATUS; stdcall;
  11007. begin
  11008. GetProcedureAddress(_NtFilterToken, ntdll, 'NtFilterToken');
  11009. Result := TFNNtFilterToken(_NtFilterToken)(
  11010. ExistingTokenHandle, Flags, SidsToDisable, PrivilegesToDelete, SidsToRestricted, NewTokenHandle
  11011. );
  11012. end;
  11013. // Dynamic version of NtFilterToken
  11014. function ZwFilterToken(
  11015. ExistingTokenHandle : HANDLE;
  11016. Flags : ULONG;
  11017. SidsToDisable : PTOKEN_GROUPS;
  11018. PrivilegesToDelete : PTOKEN_PRIVILEGES;
  11019. SidsToRestricted : PTOKEN_GROUPS;
  11020. NewTokenHandle : PHANDLE
  11021. ): NTSTATUS; stdcall;
  11022. begin
  11023. GetProcedureAddress(_NtFilterToken, ntdll, 'NtFilterToken');
  11024. Result := TFNNtFilterToken(_NtFilterToken)(
  11025. ExistingTokenHandle, Flags, SidsToDisable, PrivilegesToDelete, SidsToRestricted, NewTokenHandle
  11026. );
  11027. end;
  11028. // Dynamic version of NtFindAtom
  11029. function NtFindAtom(
  11030. Str : PWSTR;
  11031. StringLength : ULONG;
  11032. Atom : PUSHORT
  11033. ): NTSTATUS; stdcall;
  11034. begin
  11035. GetProcedureAddress(_NtFindAtom, ntdll, 'NtFindAtom');
  11036. Result := TFNNtFindAtom(_NtFindAtom)(
  11037. Str, StringLength, Atom
  11038. );
  11039. end;
  11040. // Dynamic version of NtFindAtom
  11041. function ZwFindAtom(
  11042. Str : PWSTR;
  11043. StringLength : ULONG;
  11044. Atom : PUSHORT
  11045. ): NTSTATUS; stdcall;
  11046. begin
  11047. GetProcedureAddress(_NtFindAtom, ntdll, 'NtFindAtom');
  11048. Result := TFNNtFindAtom(_NtFindAtom)(
  11049. Str, StringLength, Atom
  11050. );
  11051. end;
  11052. // Dynamic version of NtFlushBuffersFile
  11053. function NtFlushBuffersFile(
  11054. FileHandle : HANDLE;
  11055. IoStatusBlock : PIO_STATUS_BLOCK
  11056. ): NTSTATUS; stdcall;
  11057. begin
  11058. GetProcedureAddress(_NtFlushBuffersFile, ntdll, 'NtFlushBuffersFile');
  11059. Result := TFNNtFlushBuffersFile(_NtFlushBuffersFile)(
  11060. FileHandle, IoStatusBlock
  11061. );
  11062. end;
  11063. // Dynamic version of NtFlushBuffersFile
  11064. function ZwFlushBuffersFile(
  11065. FileHandle : HANDLE;
  11066. IoStatusBlock : PIO_STATUS_BLOCK
  11067. ): NTSTATUS; stdcall;
  11068. begin
  11069. GetProcedureAddress(_NtFlushBuffersFile, ntdll, 'NtFlushBuffersFile');
  11070. Result := TFNNtFlushBuffersFile(_NtFlushBuffersFile)(
  11071. FileHandle, IoStatusBlock
  11072. );
  11073. end;
  11074. // Dynamic version of NtFlushInstructionCache
  11075. function NtFlushInstructionCache(
  11076. ProcessHandle : HANDLE;
  11077. BaseAddress : PVOID;
  11078. FlushSize : ULONG
  11079. ): NTSTATUS; stdcall;
  11080. begin
  11081. GetProcedureAddress(_NtFlushInstructionCache, ntdll, 'NtFlushInstructionCache');
  11082. Result := TFNNtFlushInstructionCache(_NtFlushInstructionCache)(
  11083. ProcessHandle, BaseAddress, FlushSize
  11084. );
  11085. end;
  11086. // Dynamic version of NtFlushInstructionCache
  11087. function ZwFlushInstructionCache(
  11088. ProcessHandle : HANDLE;
  11089. BaseAddress : PVOID;
  11090. FlushSize : ULONG
  11091. ): NTSTATUS; stdcall;
  11092. begin
  11093. GetProcedureAddress(_NtFlushInstructionCache, ntdll, 'NtFlushInstructionCache');
  11094. Result := TFNNtFlushInstructionCache(_NtFlushInstructionCache)(
  11095. ProcessHandle, BaseAddress, FlushSize
  11096. );
  11097. end;
  11098. // Dynamic version of NtFlushKey
  11099. function NtFlushKey(
  11100. KeyHandle : HANDLE
  11101. ): NTSTATUS; stdcall;
  11102. begin
  11103. GetProcedureAddress(_NtFlushKey, ntdll, 'NtFlushKey');
  11104. Result := TFNNtFlushKey(_NtFlushKey)(
  11105. KeyHandle
  11106. );
  11107. end;
  11108. // Dynamic version of NtFlushKey
  11109. function ZwFlushKey(
  11110. KeyHandle : HANDLE
  11111. ): NTSTATUS; stdcall;
  11112. begin
  11113. GetProcedureAddress(_NtFlushKey, ntdll, 'NtFlushKey');
  11114. Result := TFNNtFlushKey(_NtFlushKey)(
  11115. KeyHandle
  11116. );
  11117. end;
  11118. // Dynamic version of NtFlushVirtualMemory
  11119. function NtFlushVirtualMemory(
  11120. ProcessHandle : HANDLE;
  11121. BaseAddress : PPVOID;
  11122. FlushSize : PULONG;
  11123. IoStatusBlock : PIO_STATUS_BLOCK
  11124. ): NTSTATUS; stdcall;
  11125. begin
  11126. GetProcedureAddress(_NtFlushVirtualMemory, ntdll, 'NtFlushVirtualMemory');
  11127. Result := TFNNtFlushVirtualMemory(_NtFlushVirtualMemory)(
  11128. ProcessHandle, BaseAddress, FlushSize, IoStatusBlock
  11129. );
  11130. end;
  11131. // Dynamic version of NtFlushVirtualMemory
  11132. function ZwFlushVirtualMemory(
  11133. ProcessHandle : HANDLE;
  11134. BaseAddress : PPVOID;
  11135. FlushSize : PULONG;
  11136. IoStatusBlock : PIO_STATUS_BLOCK
  11137. ): NTSTATUS; stdcall;
  11138. begin
  11139. GetProcedureAddress(_NtFlushVirtualMemory, ntdll, 'NtFlushVirtualMemory');
  11140. Result := TFNNtFlushVirtualMemory(_NtFlushVirtualMemory)(
  11141. ProcessHandle, BaseAddress, FlushSize, IoStatusBlock
  11142. );
  11143. end;
  11144. // Dynamic version of NtFlushWriteBuffer
  11145. function NtFlushWriteBuffer(): NTSTATUS; stdcall;
  11146. begin
  11147. GetProcedureAddress(_NtFlushWriteBuffer, ntdll, 'NtFlushWriteBuffer');
  11148. Result := TFNNtFlushWriteBuffer(_NtFlushWriteBuffer)();
  11149. end;
  11150. // Dynamic version of NtFlushWriteBuffer
  11151. function ZwFlushWriteBuffer(): NTSTATUS; stdcall;
  11152. begin
  11153. GetProcedureAddress(_NtFlushWriteBuffer, ntdll, 'NtFlushWriteBuffer');
  11154. Result := TFNNtFlushWriteBuffer(_NtFlushWriteBuffer)();
  11155. end;
  11156. // Dynamic version of NtFreeUserPhysicalPages
  11157. function NtFreeUserPhysicalPages(
  11158. ProcessHandle : HANDLE;
  11159. NumberOfPages : PULONG;
  11160. PageFrameNumbers : PULONG
  11161. ): NTSTATUS; stdcall;
  11162. begin
  11163. GetProcedureAddress(_NtFreeUserPhysicalPages, ntdll, 'NtFreeUserPhysicalPages');
  11164. Result := TFNNtFreeUserPhysicalPages(_NtFreeUserPhysicalPages)(
  11165. ProcessHandle, NumberOfPages, PageFrameNumbers
  11166. );
  11167. end;
  11168. // Dynamic version of NtFreeUserPhysicalPages
  11169. function ZwFreeUserPhysicalPages(
  11170. ProcessHandle : HANDLE;
  11171. NumberOfPages : PULONG;
  11172. PageFrameNumbers : PULONG
  11173. ): NTSTATUS; stdcall;
  11174. begin
  11175. GetProcedureAddress(_NtFreeUserPhysicalPages, ntdll, 'NtFreeUserPhysicalPages');
  11176. Result := TFNNtFreeUserPhysicalPages(_NtFreeUserPhysicalPages)(
  11177. ProcessHandle, NumberOfPages, PageFrameNumbers
  11178. );
  11179. end;
  11180. // Dynamic version of NtFreeVirtualMemory
  11181. function NtFreeVirtualMemory(
  11182. ProcessHandle : HANDLE;
  11183. BaseAddress : PPVOID;
  11184. FreeSize : PULONG;
  11185. FreeType : ULONG
  11186. ): NTSTATUS; stdcall;
  11187. begin
  11188. GetProcedureAddress(_NtFreeVirtualMemory, ntdll, 'NtFreeVirtualMemory');
  11189. Result := TFNNtFreeVirtualMemory(_NtFreeVirtualMemory)(
  11190. ProcessHandle, BaseAddress, FreeSize, FreeType
  11191. );
  11192. end;
  11193. // Dynamic version of NtFreeVirtualMemory
  11194. function ZwFreeVirtualMemory(
  11195. ProcessHandle : HANDLE;
  11196. BaseAddress : PPVOID;
  11197. FreeSize : PULONG;
  11198. FreeType : ULONG
  11199. ): NTSTATUS; stdcall;
  11200. begin
  11201. GetProcedureAddress(_NtFreeVirtualMemory, ntdll, 'NtFreeVirtualMemory');
  11202. Result := TFNNtFreeVirtualMemory(_NtFreeVirtualMemory)(
  11203. ProcessHandle, BaseAddress, FreeSize, FreeType
  11204. );
  11205. end;
  11206. // Dynamic version of NtFsControlFile
  11207. function NtFsControlFile(
  11208. FileHandle : HANDLE;
  11209. Event : HANDLE;
  11210. ApcRoutine : PIO_APC_ROUTINE;
  11211. ApcContext : PVOID;
  11212. IoStatusBlock : PIO_STATUS_BLOCK;
  11213. FsControlCode : ULONG;
  11214. InputBuffer : PVOID;
  11215. InputBufferLength : ULONG;
  11216. OutputBuffer : PVOID;
  11217. OutputBufferLength : ULONG
  11218. ): NTSTATUS; stdcall;
  11219. begin
  11220. GetProcedureAddress(_NtFsControlFile, ntdll, 'NtFsControlFile');
  11221. Result := TFNNtFsControlFile(_NtFsControlFile)(
  11222. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, FsControlCode, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength
  11223. );
  11224. end;
  11225. // Dynamic version of NtFsControlFile
  11226. function ZwFsControlFile(
  11227. FileHandle : HANDLE;
  11228. Event : HANDLE;
  11229. ApcRoutine : PIO_APC_ROUTINE;
  11230. ApcContext : PVOID;
  11231. IoStatusBlock : PIO_STATUS_BLOCK;
  11232. FsControlCode : ULONG;
  11233. InputBuffer : PVOID;
  11234. InputBufferLength : ULONG;
  11235. OutputBuffer : PVOID;
  11236. OutputBufferLength : ULONG
  11237. ): NTSTATUS; stdcall;
  11238. begin
  11239. GetProcedureAddress(_NtFsControlFile, ntdll, 'NtFsControlFile');
  11240. Result := TFNNtFsControlFile(_NtFsControlFile)(
  11241. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, FsControlCode, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength
  11242. );
  11243. end;
  11244. // Dynamic version of NtGetContextThread
  11245. function NtGetContextThread(
  11246. ThreadHandle : HANDLE;
  11247. Context : PCONTEXT
  11248. ): NTSTATUS; stdcall;
  11249. begin
  11250. GetProcedureAddress(_NtGetContextThread, ntdll, 'NtGetContextThread');
  11251. Result := TFNNtGetContextThread(_NtGetContextThread)(
  11252. ThreadHandle, Context
  11253. );
  11254. end;
  11255. // Dynamic version of NtGetContextThread
  11256. function ZwGetContextThread(
  11257. ThreadHandle : HANDLE;
  11258. Context : PCONTEXT
  11259. ): NTSTATUS; stdcall;
  11260. begin
  11261. GetProcedureAddress(_NtGetContextThread, ntdll, 'NtGetContextThread');
  11262. Result := TFNNtGetContextThread(_NtGetContextThread)(
  11263. ThreadHandle, Context
  11264. );
  11265. end;
  11266. // Dynamic version of NtGetCurrentProcessorNumber
  11267. function NtGetCurrentProcessorNumber(): ULONG; stdcall;
  11268. begin
  11269. GetProcedureAddress(_NtGetCurrentProcessorNumber, ntdll, 'NtGetCurrentProcessorNumber');
  11270. Result := TFNNtGetCurrentProcessorNumber(_NtGetCurrentProcessorNumber)();
  11271. end;
  11272. // Dynamic version of NtGetCurrentProcessorNumber
  11273. function ZwGetCurrentProcessorNumber(): ULONG; stdcall;
  11274. begin
  11275. GetProcedureAddress(_NtGetCurrentProcessorNumber, ntdll, 'NtGetCurrentProcessorNumber');
  11276. Result := TFNNtGetCurrentProcessorNumber(_NtGetCurrentProcessorNumber)();
  11277. end;
  11278. // Dynamic version of NtGetDevicePowerState
  11279. function NtGetDevicePowerState(
  11280. DeviceHandle : HANDLE;
  11281. DevicePowerState : PDEVICE_POWER_STATE
  11282. ): NTSTATUS; stdcall;
  11283. begin
  11284. GetProcedureAddress(_NtGetDevicePowerState, ntdll, 'NtGetDevicePowerState');
  11285. Result := TFNNtGetDevicePowerState(_NtGetDevicePowerState)(
  11286. DeviceHandle, DevicePowerState
  11287. );
  11288. end;
  11289. // Dynamic version of NtGetDevicePowerState
  11290. function ZwGetDevicePowerState(
  11291. DeviceHandle : HANDLE;
  11292. DevicePowerState : PDEVICE_POWER_STATE
  11293. ): NTSTATUS; stdcall;
  11294. begin
  11295. GetProcedureAddress(_NtGetDevicePowerState, ntdll, 'NtGetDevicePowerState');
  11296. Result := TFNNtGetDevicePowerState(_NtGetDevicePowerState)(
  11297. DeviceHandle, DevicePowerState
  11298. );
  11299. end;
  11300. // Dynamic version of NtGetPlugPlayEvent
  11301. function NtGetPlugPlayEvent(
  11302. Reserved1 : ULONG;
  11303. Reserved2 : ULONG;
  11304. Buffer : PVOID;
  11305. BufferLength : ULONG
  11306. ): NTSTATUS; stdcall;
  11307. begin
  11308. GetProcedureAddress(_NtGetPlugPlayEvent, ntdll, 'NtGetPlugPlayEvent');
  11309. Result := TFNNtGetPlugPlayEvent(_NtGetPlugPlayEvent)(
  11310. Reserved1, Reserved2, Buffer, BufferLength
  11311. );
  11312. end;
  11313. // Dynamic version of NtGetPlugPlayEvent
  11314. function ZwGetPlugPlayEvent(
  11315. Reserved1 : ULONG;
  11316. Reserved2 : ULONG;
  11317. Buffer : PVOID;
  11318. BufferLength : ULONG
  11319. ): NTSTATUS; stdcall;
  11320. begin
  11321. GetProcedureAddress(_NtGetPlugPlayEvent, ntdll, 'NtGetPlugPlayEvent');
  11322. Result := TFNNtGetPlugPlayEvent(_NtGetPlugPlayEvent)(
  11323. Reserved1, Reserved2, Buffer, BufferLength
  11324. );
  11325. end;
  11326. // Dynamic version of NtGetTickCount
  11327. function NtGetTickCount(): ULONG; stdcall;
  11328. begin
  11329. GetProcedureAddress(_NtGetTickCount, ntdll, 'NtGetTickCount');
  11330. Result := TFNNtGetTickCount(_NtGetTickCount)();
  11331. end;
  11332. // Dynamic version of NtGetTickCount
  11333. function ZwGetTickCount(): ULONG; stdcall;
  11334. begin
  11335. GetProcedureAddress(_NtGetTickCount, ntdll, 'NtGetTickCount');
  11336. Result := TFNNtGetTickCount(_NtGetTickCount)();
  11337. end;
  11338. // Dynamic version of NtGetWriteWatch
  11339. function NtGetWriteWatch(
  11340. ProcessHandle : HANDLE;
  11341. Flags : ULONG;
  11342. BaseAddress : PVOID;
  11343. RegionSize : ULONG;
  11344. Buffer : PULONG;
  11345. BufferEntries : PULONG;
  11346. Granularity : PULONG
  11347. ): NTSTATUS; stdcall;
  11348. begin
  11349. GetProcedureAddress(_NtGetWriteWatch, ntdll, 'NtGetWriteWatch');
  11350. Result := TFNNtGetWriteWatch(_NtGetWriteWatch)(
  11351. ProcessHandle, Flags, BaseAddress, RegionSize, Buffer, BufferEntries, Granularity
  11352. );
  11353. end;
  11354. // Dynamic version of NtGetWriteWatch
  11355. function ZwGetWriteWatch(
  11356. ProcessHandle : HANDLE;
  11357. Flags : ULONG;
  11358. BaseAddress : PVOID;
  11359. RegionSize : ULONG;
  11360. Buffer : PULONG;
  11361. BufferEntries : PULONG;
  11362. Granularity : PULONG
  11363. ): NTSTATUS; stdcall;
  11364. begin
  11365. GetProcedureAddress(_NtGetWriteWatch, ntdll, 'NtGetWriteWatch');
  11366. Result := TFNNtGetWriteWatch(_NtGetWriteWatch)(
  11367. ProcessHandle, Flags, BaseAddress, RegionSize, Buffer, BufferEntries, Granularity
  11368. );
  11369. end;
  11370. // Dynamic version of NtImpersonateAnonymousToken
  11371. function NtImpersonateAnonymousToken(
  11372. ThreadHandle : HANDLE
  11373. ): NTSTATUS; stdcall;
  11374. begin
  11375. GetProcedureAddress(_NtImpersonateAnonymousToken, ntdll, 'NtImpersonateAnonymousToken');
  11376. Result := TFNNtImpersonateAnonymousToken(_NtImpersonateAnonymousToken)(
  11377. ThreadHandle
  11378. );
  11379. end;
  11380. // Dynamic version of NtImpersonateAnonymousToken
  11381. function ZwImpersonateAnonymousToken(
  11382. ThreadHandle : HANDLE
  11383. ): NTSTATUS; stdcall;
  11384. begin
  11385. GetProcedureAddress(_NtImpersonateAnonymousToken, ntdll, 'NtImpersonateAnonymousToken');
  11386. Result := TFNNtImpersonateAnonymousToken(_NtImpersonateAnonymousToken)(
  11387. ThreadHandle
  11388. );
  11389. end;
  11390. // Dynamic version of NtImpersonateClientOfPort
  11391. function NtImpersonateClientOfPort(
  11392. PortHandle : HANDLE;
  11393. Message : PPORT_MESSAGE
  11394. ): NTSTATUS; stdcall;
  11395. begin
  11396. GetProcedureAddress(_NtImpersonateClientOfPort, ntdll, 'NtImpersonateClientOfPort');
  11397. Result := TFNNtImpersonateClientOfPort(_NtImpersonateClientOfPort)(
  11398. PortHandle, Message
  11399. );
  11400. end;
  11401. // Dynamic version of NtImpersonateClientOfPort
  11402. function ZwImpersonateClientOfPort(
  11403. PortHandle : HANDLE;
  11404. Message : PPORT_MESSAGE
  11405. ): NTSTATUS; stdcall;
  11406. begin
  11407. GetProcedureAddress(_NtImpersonateClientOfPort, ntdll, 'NtImpersonateClientOfPort');
  11408. Result := TFNNtImpersonateClientOfPort(_NtImpersonateClientOfPort)(
  11409. PortHandle, Message
  11410. );
  11411. end;
  11412. // Dynamic version of NtImpersonateThread
  11413. function NtImpersonateThread(
  11414. ThreadHandle : HANDLE;
  11415. TargetThreadHandle : HANDLE;
  11416. SecurityQos : PSECURITY_QUALITY_OF_SERVICE
  11417. ): NTSTATUS; stdcall;
  11418. begin
  11419. GetProcedureAddress(_NtImpersonateThread, ntdll, 'NtImpersonateThread');
  11420. Result := TFNNtImpersonateThread(_NtImpersonateThread)(
  11421. ThreadHandle, TargetThreadHandle, SecurityQos
  11422. );
  11423. end;
  11424. // Dynamic version of NtImpersonateThread
  11425. function ZwImpersonateThread(
  11426. ThreadHandle : HANDLE;
  11427. TargetThreadHandle : HANDLE;
  11428. SecurityQos : PSECURITY_QUALITY_OF_SERVICE
  11429. ): NTSTATUS; stdcall;
  11430. begin
  11431. GetProcedureAddress(_NtImpersonateThread, ntdll, 'NtImpersonateThread');
  11432. Result := TFNNtImpersonateThread(_NtImpersonateThread)(
  11433. ThreadHandle, TargetThreadHandle, SecurityQos
  11434. );
  11435. end;
  11436. // Dynamic version of NtInitializeRegistry
  11437. function NtInitializeRegistry(
  11438. Setup : BOOLEAN
  11439. ): NTSTATUS; stdcall;
  11440. begin
  11441. GetProcedureAddress(_NtInitializeRegistry, ntdll, 'NtInitializeRegistry');
  11442. Result := TFNNtInitializeRegistry(_NtInitializeRegistry)(
  11443. Setup
  11444. );
  11445. end;
  11446. // Dynamic version of NtInitializeRegistry
  11447. function ZwInitializeRegistry(
  11448. Setup : BOOLEAN
  11449. ): NTSTATUS; stdcall;
  11450. begin
  11451. GetProcedureAddress(_NtInitializeRegistry, ntdll, 'NtInitializeRegistry');
  11452. Result := TFNNtInitializeRegistry(_NtInitializeRegistry)(
  11453. Setup
  11454. );
  11455. end;
  11456. // Dynamic version of NtInitiatePowerAction
  11457. function NtInitiatePowerAction(
  11458. SystemAction : POWER_ACTION;
  11459. MinSystemState : SYSTEM_POWER_STATE;
  11460. Flags : ULONG;
  11461. Asynchronous : BOOLEAN
  11462. ): NTSTATUS; stdcall;
  11463. begin
  11464. GetProcedureAddress(_NtInitiatePowerAction, ntdll, 'NtInitiatePowerAction');
  11465. Result := TFNNtInitiatePowerAction(_NtInitiatePowerAction)(
  11466. SystemAction, MinSystemState, Flags, Asynchronous
  11467. );
  11468. end;
  11469. // Dynamic version of NtInitiatePowerAction
  11470. function ZwInitiatePowerAction(
  11471. SystemAction : POWER_ACTION;
  11472. MinSystemState : SYSTEM_POWER_STATE;
  11473. Flags : ULONG;
  11474. Asynchronous : BOOLEAN
  11475. ): NTSTATUS; stdcall;
  11476. begin
  11477. GetProcedureAddress(_NtInitiatePowerAction, ntdll, 'NtInitiatePowerAction');
  11478. Result := TFNNtInitiatePowerAction(_NtInitiatePowerAction)(
  11479. SystemAction, MinSystemState, Flags, Asynchronous
  11480. );
  11481. end;
  11482. // Dynamic version of NtIsSystemResumeAutomatic
  11483. function NtIsSystemResumeAutomatic(): BOOLEAN; stdcall;
  11484. begin
  11485. GetProcedureAddress(_NtIsSystemResumeAutomatic, ntdll, 'NtIsSystemResumeAutomatic');
  11486. Result := TFNNtIsSystemResumeAutomatic(_NtIsSystemResumeAutomatic)();
  11487. end;
  11488. // Dynamic version of NtIsSystemResumeAutomatic
  11489. function ZwIsSystemResumeAutomatic(): BOOLEAN; stdcall;
  11490. begin
  11491. GetProcedureAddress(_NtIsSystemResumeAutomatic, ntdll, 'NtIsSystemResumeAutomatic');
  11492. Result := TFNNtIsSystemResumeAutomatic(_NtIsSystemResumeAutomatic)();
  11493. end;
  11494. // Dynamic version of NtListenChannel
  11495. function NtListenChannel(
  11496. x : PVOID;
  11497. y : PVOID
  11498. ): NTSTATUS; stdcall;
  11499. begin
  11500. GetProcedureAddress(_NtListenChannel, ntdll, 'NtListenChannel');
  11501. Result := TFNNtListenChannel(_NtListenChannel)(
  11502. x, y
  11503. );
  11504. end;
  11505. // Dynamic version of NtListenChannel
  11506. function ZwListenChannel(
  11507. x : PVOID;
  11508. y : PVOID
  11509. ): NTSTATUS; stdcall;
  11510. begin
  11511. GetProcedureAddress(_NtListenChannel, ntdll, 'NtListenChannel');
  11512. Result := TFNNtListenChannel(_NtListenChannel)(
  11513. x, y
  11514. );
  11515. end;
  11516. // Dynamic version of NtListenPort
  11517. function NtListenPort(
  11518. PortHandle : HANDLE;
  11519. Message : PPORT_MESSAGE
  11520. ): NTSTATUS; stdcall;
  11521. begin
  11522. GetProcedureAddress(_NtListenPort, ntdll, 'NtListenPort');
  11523. Result := TFNNtListenPort(_NtListenPort)(
  11524. PortHandle, Message
  11525. );
  11526. end;
  11527. // Dynamic version of NtListenPort
  11528. function ZwListenPort(
  11529. PortHandle : HANDLE;
  11530. Message : PPORT_MESSAGE
  11531. ): NTSTATUS; stdcall;
  11532. begin
  11533. GetProcedureAddress(_NtListenPort, ntdll, 'NtListenPort');
  11534. Result := TFNNtListenPort(_NtListenPort)(
  11535. PortHandle, Message
  11536. );
  11537. end;
  11538. // Dynamic version of NtLoadDriver
  11539. function NtLoadDriver(
  11540. DriverServiceName : PUNICODE_STRING
  11541. ): NTSTATUS; stdcall;
  11542. begin
  11543. GetProcedureAddress(_NtLoadDriver, ntdll, 'NtLoadDriver');
  11544. Result := TFNNtLoadDriver(_NtLoadDriver)(
  11545. DriverServiceName
  11546. );
  11547. end;
  11548. // Dynamic version of NtLoadDriver
  11549. function ZwLoadDriver(
  11550. DriverServiceName : PUNICODE_STRING
  11551. ): NTSTATUS; stdcall;
  11552. begin
  11553. GetProcedureAddress(_NtLoadDriver, ntdll, 'NtLoadDriver');
  11554. Result := TFNNtLoadDriver(_NtLoadDriver)(
  11555. DriverServiceName
  11556. );
  11557. end;
  11558. // Dynamic version of NtLoadKey
  11559. function NtLoadKey(
  11560. KeyObjectAttributes : POBJECT_ATTRIBUTES;
  11561. FileObjectAttributes : POBJECT_ATTRIBUTES
  11562. ): NTSTATUS; stdcall;
  11563. begin
  11564. GetProcedureAddress(_NtLoadKey, ntdll, 'NtLoadKey');
  11565. Result := TFNNtLoadKey(_NtLoadKey)(
  11566. KeyObjectAttributes, FileObjectAttributes
  11567. );
  11568. end;
  11569. // Dynamic version of NtLoadKey
  11570. function ZwLoadKey(
  11571. KeyObjectAttributes : POBJECT_ATTRIBUTES;
  11572. FileObjectAttributes : POBJECT_ATTRIBUTES
  11573. ): NTSTATUS; stdcall;
  11574. begin
  11575. GetProcedureAddress(_NtLoadKey, ntdll, 'NtLoadKey');
  11576. Result := TFNNtLoadKey(_NtLoadKey)(
  11577. KeyObjectAttributes, FileObjectAttributes
  11578. );
  11579. end;
  11580. // Dynamic version of NtLoadKey2
  11581. function NtLoadKey2(
  11582. KeyObjectAttributes : POBJECT_ATTRIBUTES;
  11583. FileObjectAttributes : POBJECT_ATTRIBUTES;
  11584. Flags : ULONG
  11585. ): NTSTATUS; stdcall;
  11586. begin
  11587. GetProcedureAddress(_NtLoadKey2, ntdll, 'NtLoadKey2');
  11588. Result := TFNNtLoadKey2(_NtLoadKey2)(
  11589. KeyObjectAttributes, FileObjectAttributes, Flags
  11590. );
  11591. end;
  11592. // Dynamic version of NtLoadKey2
  11593. function ZwLoadKey2(
  11594. KeyObjectAttributes : POBJECT_ATTRIBUTES;
  11595. FileObjectAttributes : POBJECT_ATTRIBUTES;
  11596. Flags : ULONG
  11597. ): NTSTATUS; stdcall;
  11598. begin
  11599. GetProcedureAddress(_NtLoadKey2, ntdll, 'NtLoadKey2');
  11600. Result := TFNNtLoadKey2(_NtLoadKey2)(
  11601. KeyObjectAttributes, FileObjectAttributes, Flags
  11602. );
  11603. end;
  11604. // Dynamic version of NtLockFile
  11605. function NtLockFile(
  11606. FileHandle : HANDLE;
  11607. Event : HANDLE;
  11608. ApcRoutine : PIO_APC_ROUTINE;
  11609. ApcContext : PVOID;
  11610. IoStatusBlock : PIO_STATUS_BLOCK;
  11611. LockOffset : PULARGE_INTEGER;
  11612. LockLength : PULARGE_INTEGER;
  11613. Key : ULONG;
  11614. FailImmediately : BOOLEAN;
  11615. ExclusiveLock : BOOLEAN
  11616. ): NTSTATUS; stdcall;
  11617. begin
  11618. GetProcedureAddress(_NtLockFile, ntdll, 'NtLockFile');
  11619. Result := TFNNtLockFile(_NtLockFile)(
  11620. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, LockOffset, LockLength, Key, FailImmediately, ExclusiveLock
  11621. );
  11622. end;
  11623. // Dynamic version of NtLockFile
  11624. function ZwLockFile(
  11625. FileHandle : HANDLE;
  11626. Event : HANDLE;
  11627. ApcRoutine : PIO_APC_ROUTINE;
  11628. ApcContext : PVOID;
  11629. IoStatusBlock : PIO_STATUS_BLOCK;
  11630. LockOffset : PULARGE_INTEGER;
  11631. LockLength : PULARGE_INTEGER;
  11632. Key : ULONG;
  11633. FailImmediately : BOOLEAN;
  11634. ExclusiveLock : BOOLEAN
  11635. ): NTSTATUS; stdcall;
  11636. begin
  11637. GetProcedureAddress(_NtLockFile, ntdll, 'NtLockFile');
  11638. Result := TFNNtLockFile(_NtLockFile)(
  11639. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, LockOffset, LockLength, Key, FailImmediately, ExclusiveLock
  11640. );
  11641. end;
  11642. // Dynamic version of NtLockVirtualMemory
  11643. function NtLockVirtualMemory(
  11644. ProcessHandle : HANDLE;
  11645. BaseAddress : PPVOID;
  11646. LockSize : PULONG;
  11647. LockType : ULONG
  11648. ): NTSTATUS; stdcall;
  11649. begin
  11650. GetProcedureAddress(_NtLockVirtualMemory, ntdll, 'NtLockVirtualMemory');
  11651. Result := TFNNtLockVirtualMemory(_NtLockVirtualMemory)(
  11652. ProcessHandle, BaseAddress, LockSize, LockType
  11653. );
  11654. end;
  11655. // Dynamic version of NtLockVirtualMemory
  11656. function ZwLockVirtualMemory(
  11657. ProcessHandle : HANDLE;
  11658. BaseAddress : PPVOID;
  11659. LockSize : PULONG;
  11660. LockType : ULONG
  11661. ): NTSTATUS; stdcall;
  11662. begin
  11663. GetProcedureAddress(_NtLockVirtualMemory, ntdll, 'NtLockVirtualMemory');
  11664. Result := TFNNtLockVirtualMemory(_NtLockVirtualMemory)(
  11665. ProcessHandle, BaseAddress, LockSize, LockType
  11666. );
  11667. end;
  11668. // Dynamic version of NtMakePermanentObject
  11669. function NtMakePermanentObject(
  11670. Handle : HANDLE
  11671. ): NTSTATUS; stdcall;
  11672. begin
  11673. GetProcedureAddress(_NtMakePermanentObject, ntdll, 'NtMakePermanentObject');
  11674. Result := TFNNtMakePermanentObject(_NtMakePermanentObject)(
  11675. Handle
  11676. );
  11677. end;
  11678. // Dynamic version of NtMakePermanentObject
  11679. function ZwMakePermanentObject(
  11680. Handle : HANDLE
  11681. ): NTSTATUS; stdcall;
  11682. begin
  11683. GetProcedureAddress(_NtMakePermanentObject, ntdll, 'NtMakePermanentObject');
  11684. Result := TFNNtMakePermanentObject(_NtMakePermanentObject)(
  11685. Handle
  11686. );
  11687. end;
  11688. // Dynamic version of NtMakeTemporaryObject
  11689. function NtMakeTemporaryObject(
  11690. Handle : HANDLE
  11691. ): NTSTATUS; stdcall;
  11692. begin
  11693. GetProcedureAddress(_NtMakeTemporaryObject, ntdll, 'NtMakeTemporaryObject');
  11694. Result := TFNNtMakeTemporaryObject(_NtMakeTemporaryObject)(
  11695. Handle
  11696. );
  11697. end;
  11698. // Dynamic version of NtMakeTemporaryObject
  11699. function ZwMakeTemporaryObject(
  11700. Handle : HANDLE
  11701. ): NTSTATUS; stdcall;
  11702. begin
  11703. GetProcedureAddress(_NtMakeTemporaryObject, ntdll, 'NtMakeTemporaryObject');
  11704. Result := TFNNtMakeTemporaryObject(_NtMakeTemporaryObject)(
  11705. Handle
  11706. );
  11707. end;
  11708. // Dynamic version of NtMapUserPhysicalPages
  11709. function NtMapUserPhysicalPages(
  11710. BaseAddress : PVOID;
  11711. NumberOfPages : PULONG;
  11712. PageFrameNumbers : PULONG
  11713. ): NTSTATUS; stdcall;
  11714. begin
  11715. GetProcedureAddress(_NtMapUserPhysicalPages, ntdll, 'NtMapUserPhysicalPages');
  11716. Result := TFNNtMapUserPhysicalPages(_NtMapUserPhysicalPages)(
  11717. BaseAddress, NumberOfPages, PageFrameNumbers
  11718. );
  11719. end;
  11720. // Dynamic version of NtMapUserPhysicalPages
  11721. function ZwMapUserPhysicalPages(
  11722. BaseAddress : PVOID;
  11723. NumberOfPages : PULONG;
  11724. PageFrameNumbers : PULONG
  11725. ): NTSTATUS; stdcall;
  11726. begin
  11727. GetProcedureAddress(_NtMapUserPhysicalPages, ntdll, 'NtMapUserPhysicalPages');
  11728. Result := TFNNtMapUserPhysicalPages(_NtMapUserPhysicalPages)(
  11729. BaseAddress, NumberOfPages, PageFrameNumbers
  11730. );
  11731. end;
  11732. // Dynamic version of NtMapUserPhysicalPagesScatter
  11733. function NtMapUserPhysicalPagesScatter(
  11734. BaseAddresses : PPVOID;
  11735. NumberOfPages : PULONG;
  11736. PageFrameNumbers : PULONG
  11737. ): NTSTATUS; stdcall;
  11738. begin
  11739. GetProcedureAddress(_NtMapUserPhysicalPagesScatter, ntdll, 'NtMapUserPhysicalPagesScatter');
  11740. Result := TFNNtMapUserPhysicalPagesScatter(_NtMapUserPhysicalPagesScatter)(
  11741. BaseAddresses, NumberOfPages, PageFrameNumbers
  11742. );
  11743. end;
  11744. // Dynamic version of NtMapUserPhysicalPagesScatter
  11745. function ZwMapUserPhysicalPagesScatter(
  11746. BaseAddresses : PPVOID;
  11747. NumberOfPages : PULONG;
  11748. PageFrameNumbers : PULONG
  11749. ): NTSTATUS; stdcall;
  11750. begin
  11751. GetProcedureAddress(_NtMapUserPhysicalPagesScatter, ntdll, 'NtMapUserPhysicalPagesScatter');
  11752. Result := TFNNtMapUserPhysicalPagesScatter(_NtMapUserPhysicalPagesScatter)(
  11753. BaseAddresses, NumberOfPages, PageFrameNumbers
  11754. );
  11755. end;
  11756. // Dynamic version of NtMapViewOfSection
  11757. function NtMapViewOfSection(
  11758. SectionHandle : HANDLE;
  11759. ProcessHandle : HANDLE;
  11760. BaseAddress : PPVOID;
  11761. ZeroBits : ULONG;
  11762. CommitSize : ULONG;
  11763. SectionOffset : PLARGE_INTEGER;
  11764. ViewSize : PULONG;
  11765. InheritDisposition : SECTION_INHERIT;
  11766. AllocationType : ULONG;
  11767. Protect : ULONG
  11768. ): NTSTATUS; stdcall;
  11769. begin
  11770. GetProcedureAddress(_NtMapViewOfSection, ntdll, 'NtMapViewOfSection');
  11771. Result := TFNNtMapViewOfSection(_NtMapViewOfSection)(
  11772. SectionHandle, ProcessHandle, BaseAddress, ZeroBits, CommitSize, SectionOffset, ViewSize, InheritDisposition, AllocationType, Protect
  11773. );
  11774. end;
  11775. // Dynamic version of NtMapViewOfSection
  11776. function ZwMapViewOfSection(
  11777. SectionHandle : HANDLE;
  11778. ProcessHandle : HANDLE;
  11779. BaseAddress : PPVOID;
  11780. ZeroBits : ULONG;
  11781. CommitSize : ULONG;
  11782. SectionOffset : PLARGE_INTEGER;
  11783. ViewSize : PULONG;
  11784. InheritDisposition : SECTION_INHERIT;
  11785. AllocationType : ULONG;
  11786. Protect : ULONG
  11787. ): NTSTATUS; stdcall;
  11788. begin
  11789. GetProcedureAddress(_NtMapViewOfSection, ntdll, 'NtMapViewOfSection');
  11790. Result := TFNNtMapViewOfSection(_NtMapViewOfSection)(
  11791. SectionHandle, ProcessHandle, BaseAddress, ZeroBits, CommitSize, SectionOffset, ViewSize, InheritDisposition, AllocationType, Protect
  11792. );
  11793. end;
  11794. // Dynamic version of NtNotifyChangeDirectoryFile
  11795. function NtNotifyChangeDirectoryFile(
  11796. FileHandle : HANDLE;
  11797. Event : HANDLE;
  11798. ApcRoutine : PIO_APC_ROUTINE;
  11799. ApcContext : PVOID;
  11800. IoStatusBlock : PIO_STATUS_BLOCK;
  11801. Buffer : PFILE_NOTIFY_INFORMATION;
  11802. BufferLength : ULONG;
  11803. NotifyFilter : ULONG;
  11804. WatchSubtree : BOOLEAN
  11805. ): NTSTATUS; stdcall;
  11806. begin
  11807. GetProcedureAddress(_NtNotifyChangeDirectoryFile, ntdll, 'NtNotifyChangeDirectoryFile');
  11808. Result := TFNNtNotifyChangeDirectoryFile(_NtNotifyChangeDirectoryFile)(
  11809. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, Buffer, BufferLength, NotifyFilter, WatchSubtree
  11810. );
  11811. end;
  11812. // Dynamic version of NtNotifyChangeDirectoryFile
  11813. function ZwNotifyChangeDirectoryFile(
  11814. FileHandle : HANDLE;
  11815. Event : HANDLE;
  11816. ApcRoutine : PIO_APC_ROUTINE;
  11817. ApcContext : PVOID;
  11818. IoStatusBlock : PIO_STATUS_BLOCK;
  11819. Buffer : PFILE_NOTIFY_INFORMATION;
  11820. BufferLength : ULONG;
  11821. NotifyFilter : ULONG;
  11822. WatchSubtree : BOOLEAN
  11823. ): NTSTATUS; stdcall;
  11824. begin
  11825. GetProcedureAddress(_NtNotifyChangeDirectoryFile, ntdll, 'NtNotifyChangeDirectoryFile');
  11826. Result := TFNNtNotifyChangeDirectoryFile(_NtNotifyChangeDirectoryFile)(
  11827. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, Buffer, BufferLength, NotifyFilter, WatchSubtree
  11828. );
  11829. end;
  11830. // Dynamic version of NtNotifyChangeKey
  11831. function NtNotifyChangeKey(
  11832. KeyHandle : HANDLE;
  11833. EventHandle : HANDLE;
  11834. ApcRoutine : PIO_APC_ROUTINE;
  11835. ApcContext : PVOID;
  11836. IoStatusBlock : PIO_STATUS_BLOCK;
  11837. NotifyFilter : ULONG;
  11838. WatchSubtree : BOOLEAN;
  11839. Buffer : PVOID;
  11840. BufferLength : ULONG;
  11841. Asynchronous : BOOLEAN
  11842. ): NTSTATUS; stdcall;
  11843. begin
  11844. GetProcedureAddress(_NtNotifyChangeKey, ntdll, 'NtNotifyChangeKey');
  11845. Result := TFNNtNotifyChangeKey(_NtNotifyChangeKey)(
  11846. KeyHandle, EventHandle, ApcRoutine, ApcContext, IoStatusBlock, NotifyFilter, WatchSubtree, Buffer, BufferLength, Asynchronous
  11847. );
  11848. end;
  11849. // Dynamic version of NtNotifyChangeKey
  11850. function ZwNotifyChangeKey(
  11851. KeyHandle : HANDLE;
  11852. EventHandle : HANDLE;
  11853. ApcRoutine : PIO_APC_ROUTINE;
  11854. ApcContext : PVOID;
  11855. IoStatusBlock : PIO_STATUS_BLOCK;
  11856. NotifyFilter : ULONG;
  11857. WatchSubtree : BOOLEAN;
  11858. Buffer : PVOID;
  11859. BufferLength : ULONG;
  11860. Asynchronous : BOOLEAN
  11861. ): NTSTATUS; stdcall;
  11862. begin
  11863. GetProcedureAddress(_NtNotifyChangeKey, ntdll, 'NtNotifyChangeKey');
  11864. Result := TFNNtNotifyChangeKey(_NtNotifyChangeKey)(
  11865. KeyHandle, EventHandle, ApcRoutine, ApcContext, IoStatusBlock, NotifyFilter, WatchSubtree, Buffer, BufferLength, Asynchronous
  11866. );
  11867. end;
  11868. // Dynamic version of NtNotifyChangeMultipleKeys
  11869. function NtNotifyChangeMultipleKeys(
  11870. KeyHandle : HANDLE;
  11871. Flags : ULONG;
  11872. KeyObjectAttributes : POBJECT_ATTRIBUTES;
  11873. EventHandle : HANDLE;
  11874. ApcRoutine : PIO_APC_ROUTINE;
  11875. ApcContext : PVOID;
  11876. IoStatusBlock : PIO_STATUS_BLOCK;
  11877. NotifyFilter : ULONG;
  11878. WatchSubtree : BOOLEAN;
  11879. Buffer : PVOID;
  11880. BufferLength : ULONG;
  11881. Asynchronous : BOOLEAN
  11882. ): NTSTATUS; stdcall;
  11883. begin
  11884. GetProcedureAddress(_NtNotifyChangeMultipleKeys, ntdll, 'NtNotifyChangeMultipleKeys');
  11885. Result := TFNNtNotifyChangeMultipleKeys(_NtNotifyChangeMultipleKeys)(
  11886. KeyHandle, Flags, KeyObjectAttributes, EventHandle, ApcRoutine, ApcContext, IoStatusBlock, NotifyFilter, WatchSubtree, Buffer, BufferLength, Asynchronous
  11887. );
  11888. end;
  11889. // Dynamic version of NtNotifyChangeMultipleKeys
  11890. function ZwNotifyChangeMultipleKeys(
  11891. KeyHandle : HANDLE;
  11892. Flags : ULONG;
  11893. KeyObjectAttributes : POBJECT_ATTRIBUTES;
  11894. EventHandle : HANDLE;
  11895. ApcRoutine : PIO_APC_ROUTINE;
  11896. ApcContext : PVOID;
  11897. IoStatusBlock : PIO_STATUS_BLOCK;
  11898. NotifyFilter : ULONG;
  11899. WatchSubtree : BOOLEAN;
  11900. Buffer : PVOID;
  11901. BufferLength : ULONG;
  11902. Asynchronous : BOOLEAN
  11903. ): NTSTATUS; stdcall;
  11904. begin
  11905. GetProcedureAddress(_NtNotifyChangeMultipleKeys, ntdll, 'NtNotifyChangeMultipleKeys');
  11906. Result := TFNNtNotifyChangeMultipleKeys(_NtNotifyChangeMultipleKeys)(
  11907. KeyHandle, Flags, KeyObjectAttributes, EventHandle, ApcRoutine, ApcContext, IoStatusBlock, NotifyFilter, WatchSubtree, Buffer, BufferLength, Asynchronous
  11908. );
  11909. end;
  11910. // Dynamic version of NtOpenChannel
  11911. function NtOpenChannel(
  11912. ChannelHandle : PHANDLE;
  11913. ObjectAttributes : POBJECT_ATTRIBUTES
  11914. ): NTSTATUS; stdcall;
  11915. begin
  11916. GetProcedureAddress(_NtOpenChannel, ntdll, 'NtOpenChannel');
  11917. Result := TFNNtOpenChannel(_NtOpenChannel)(
  11918. ChannelHandle, ObjectAttributes
  11919. );
  11920. end;
  11921. // Dynamic version of NtOpenChannel
  11922. function ZwOpenChannel(
  11923. ChannelHandle : PHANDLE;
  11924. ObjectAttributes : POBJECT_ATTRIBUTES
  11925. ): NTSTATUS; stdcall;
  11926. begin
  11927. GetProcedureAddress(_NtOpenChannel, ntdll, 'NtOpenChannel');
  11928. Result := TFNNtOpenChannel(_NtOpenChannel)(
  11929. ChannelHandle, ObjectAttributes
  11930. );
  11931. end;
  11932. // Dynamic version of NtOpenDirectoryObject
  11933. function NtOpenDirectoryObject(
  11934. DirectoryHandle : PHANDLE;
  11935. DesiredAccess : ACCESS_MASK;
  11936. ObjectAttributes : POBJECT_ATTRIBUTES
  11937. ): NTSTATUS; stdcall;
  11938. begin
  11939. GetProcedureAddress(_NtOpenDirectoryObject, ntdll, 'NtOpenDirectoryObject');
  11940. Result := TFNNtOpenDirectoryObject(_NtOpenDirectoryObject)(
  11941. DirectoryHandle, DesiredAccess, ObjectAttributes
  11942. );
  11943. end;
  11944. // Dynamic version of NtOpenDirectoryObject
  11945. function ZwOpenDirectoryObject(
  11946. DirectoryHandle : PHANDLE;
  11947. DesiredAccess : ACCESS_MASK;
  11948. ObjectAttributes : POBJECT_ATTRIBUTES
  11949. ): NTSTATUS; stdcall;
  11950. begin
  11951. GetProcedureAddress(_NtOpenDirectoryObject, ntdll, 'NtOpenDirectoryObject');
  11952. Result := TFNNtOpenDirectoryObject(_NtOpenDirectoryObject)(
  11953. DirectoryHandle, DesiredAccess, ObjectAttributes
  11954. );
  11955. end;
  11956. // Dynamic version of NtOpenEvent
  11957. function NtOpenEvent(
  11958. EventHandle : PHANDLE;
  11959. DesiredAccess : ACCESS_MASK;
  11960. ObjectAttributes : POBJECT_ATTRIBUTES
  11961. ): NTSTATUS; stdcall;
  11962. begin
  11963. GetProcedureAddress(_NtOpenEvent, ntdll, 'NtOpenEvent');
  11964. Result := TFNNtOpenEvent(_NtOpenEvent)(
  11965. EventHandle, DesiredAccess, ObjectAttributes
  11966. );
  11967. end;
  11968. // Dynamic version of NtOpenEvent
  11969. function ZwOpenEvent(
  11970. EventHandle : PHANDLE;
  11971. DesiredAccess : ACCESS_MASK;
  11972. ObjectAttributes : POBJECT_ATTRIBUTES
  11973. ): NTSTATUS; stdcall;
  11974. begin
  11975. GetProcedureAddress(_NtOpenEvent, ntdll, 'NtOpenEvent');
  11976. Result := TFNNtOpenEvent(_NtOpenEvent)(
  11977. EventHandle, DesiredAccess, ObjectAttributes
  11978. );
  11979. end;
  11980. // Dynamic version of NtOpenEventPair
  11981. function NtOpenEventPair(
  11982. EventPairHandle : PHANDLE;
  11983. DesiredAccess : ACCESS_MASK;
  11984. ObjectAttributes : POBJECT_ATTRIBUTES
  11985. ): NTSTATUS; stdcall;
  11986. begin
  11987. GetProcedureAddress(_NtOpenEventPair, ntdll, 'NtOpenEventPair');
  11988. Result := TFNNtOpenEventPair(_NtOpenEventPair)(
  11989. EventPairHandle, DesiredAccess, ObjectAttributes
  11990. );
  11991. end;
  11992. // Dynamic version of NtOpenEventPair
  11993. function ZwOpenEventPair(
  11994. EventPairHandle : PHANDLE;
  11995. DesiredAccess : ACCESS_MASK;
  11996. ObjectAttributes : POBJECT_ATTRIBUTES
  11997. ): NTSTATUS; stdcall;
  11998. begin
  11999. GetProcedureAddress(_NtOpenEventPair, ntdll, 'NtOpenEventPair');
  12000. Result := TFNNtOpenEventPair(_NtOpenEventPair)(
  12001. EventPairHandle, DesiredAccess, ObjectAttributes
  12002. );
  12003. end;
  12004. {$IFNDEF JWA_INCLUDEMODE}
  12005. // Dynamic version of NtOpenFile
  12006. function NtOpenFile(
  12007. FileHandle : PHANDLE;
  12008. DesiredAccess : ACCESS_MASK;
  12009. ObjectAttributes : POBJECT_ATTRIBUTES;
  12010. IoStatusBlock : PIO_STATUS_BLOCK;
  12011. ShareAccess : ULONG;
  12012. OpenOptions : ULONG
  12013. ): NTSTATUS; stdcall;
  12014. begin
  12015. GetProcedureAddress(_NtOpenFile, ntdll, 'NtOpenFile');
  12016. Result := TFNNtOpenFile(_NtOpenFile)(
  12017. FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, ShareAccess, OpenOptions
  12018. );
  12019. end;
  12020. {$ENDIF JWA_INCLUDEMODE}
  12021. // Dynamic version of NtOpenFile
  12022. function ZwOpenFile(
  12023. FileHandle : PHANDLE;
  12024. DesiredAccess : ACCESS_MASK;
  12025. ObjectAttributes : POBJECT_ATTRIBUTES;
  12026. IoStatusBlock : PIO_STATUS_BLOCK;
  12027. ShareAccess : ULONG;
  12028. OpenOptions : ULONG
  12029. ): NTSTATUS; stdcall;
  12030. begin
  12031. GetProcedureAddress(_NtOpenFile, ntdll, 'NtOpenFile');
  12032. Result := TFNNtOpenFile(_NtOpenFile)(
  12033. FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, ShareAccess, OpenOptions
  12034. );
  12035. end;
  12036. // Dynamic version of NtOpenIoCompletion
  12037. function NtOpenIoCompletion(
  12038. IoCompletionHandle : PHANDLE;
  12039. DesiredAccess : ACCESS_MASK;
  12040. ObjectAttributes : POBJECT_ATTRIBUTES
  12041. ): NTSTATUS; stdcall;
  12042. begin
  12043. GetProcedureAddress(_NtOpenIoCompletion, ntdll, 'NtOpenIoCompletion');
  12044. Result := TFNNtOpenIoCompletion(_NtOpenIoCompletion)(
  12045. IoCompletionHandle, DesiredAccess, ObjectAttributes
  12046. );
  12047. end;
  12048. // Dynamic version of NtOpenIoCompletion
  12049. function ZwOpenIoCompletion(
  12050. IoCompletionHandle : PHANDLE;
  12051. DesiredAccess : ACCESS_MASK;
  12052. ObjectAttributes : POBJECT_ATTRIBUTES
  12053. ): NTSTATUS; stdcall;
  12054. begin
  12055. GetProcedureAddress(_NtOpenIoCompletion, ntdll, 'NtOpenIoCompletion');
  12056. Result := TFNNtOpenIoCompletion(_NtOpenIoCompletion)(
  12057. IoCompletionHandle, DesiredAccess, ObjectAttributes
  12058. );
  12059. end;
  12060. // Dynamic version of NtOpenJobObject
  12061. function NtOpenJobObject(
  12062. JobHandle : PHANDLE;
  12063. DesiredAccess : ACCESS_MASK;
  12064. ObjectAttributes : POBJECT_ATTRIBUTES
  12065. ): NTSTATUS; stdcall;
  12066. begin
  12067. GetProcedureAddress(_NtOpenJobObject, ntdll, 'NtOpenJobObject');
  12068. Result := TFNNtOpenJobObject(_NtOpenJobObject)(
  12069. JobHandle, DesiredAccess, ObjectAttributes
  12070. );
  12071. end;
  12072. // Dynamic version of NtOpenJobObject
  12073. function ZwOpenJobObject(
  12074. JobHandle : PHANDLE;
  12075. DesiredAccess : ACCESS_MASK;
  12076. ObjectAttributes : POBJECT_ATTRIBUTES
  12077. ): NTSTATUS; stdcall;
  12078. begin
  12079. GetProcedureAddress(_NtOpenJobObject, ntdll, 'NtOpenJobObject');
  12080. Result := TFNNtOpenJobObject(_NtOpenJobObject)(
  12081. JobHandle, DesiredAccess, ObjectAttributes
  12082. );
  12083. end;
  12084. // Dynamic version of NtOpenKey
  12085. function NtOpenKey(
  12086. KeyHandle : PHANDLE;
  12087. DesiredAccess : ACCESS_MASK;
  12088. ObjectAttributes : POBJECT_ATTRIBUTES
  12089. ): NTSTATUS; stdcall;
  12090. begin
  12091. GetProcedureAddress(_NtOpenKey, ntdll, 'NtOpenKey');
  12092. Result := TFNNtOpenKey(_NtOpenKey)(
  12093. KeyHandle, DesiredAccess, ObjectAttributes
  12094. );
  12095. end;
  12096. // Dynamic version of NtOpenKey
  12097. function ZwOpenKey(
  12098. KeyHandle : PHANDLE;
  12099. DesiredAccess : ACCESS_MASK;
  12100. ObjectAttributes : POBJECT_ATTRIBUTES
  12101. ): NTSTATUS; stdcall;
  12102. begin
  12103. GetProcedureAddress(_NtOpenKey, ntdll, 'NtOpenKey');
  12104. Result := TFNNtOpenKey(_NtOpenKey)(
  12105. KeyHandle, DesiredAccess, ObjectAttributes
  12106. );
  12107. end;
  12108. // Dynamic version of NtOpenMutant
  12109. function NtOpenMutant(
  12110. MutantHandle : PHANDLE;
  12111. DesiredAccess : ACCESS_MASK;
  12112. ObjectAttributes : POBJECT_ATTRIBUTES
  12113. ): NTSTATUS; stdcall;
  12114. begin
  12115. GetProcedureAddress(_NtOpenMutant, ntdll, 'NtOpenMutant');
  12116. Result := TFNNtOpenMutant(_NtOpenMutant)(
  12117. MutantHandle, DesiredAccess, ObjectAttributes
  12118. );
  12119. end;
  12120. // Dynamic version of NtOpenMutant
  12121. function ZwOpenMutant(
  12122. MutantHandle : PHANDLE;
  12123. DesiredAccess : ACCESS_MASK;
  12124. ObjectAttributes : POBJECT_ATTRIBUTES
  12125. ): NTSTATUS; stdcall;
  12126. begin
  12127. GetProcedureAddress(_NtOpenMutant, ntdll, 'NtOpenMutant');
  12128. Result := TFNNtOpenMutant(_NtOpenMutant)(
  12129. MutantHandle, DesiredAccess, ObjectAttributes
  12130. );
  12131. end;
  12132. // Dynamic version of NtOpenObjectAuditAlarm
  12133. function NtOpenObjectAuditAlarm(
  12134. SubsystemName : PUNICODE_STRING;
  12135. HandleId : PPVOID;
  12136. ObjectTypeName : PUNICODE_STRING;
  12137. ObjectName : PUNICODE_STRING;
  12138. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  12139. TokenHandle : HANDLE;
  12140. DesiredAccess : ACCESS_MASK;
  12141. GrantedAccess : ACCESS_MASK;
  12142. Privileges : PPRIVILEGE_SET;
  12143. ObjectCreation : BOOLEAN;
  12144. AccessGranted : BOOLEAN;
  12145. GenerateOnClose : PBOOLEAN
  12146. ): NTSTATUS; stdcall;
  12147. begin
  12148. GetProcedureAddress(_NtOpenObjectAuditAlarm, ntdll, 'NtOpenObjectAuditAlarm');
  12149. Result := TFNNtOpenObjectAuditAlarm(_NtOpenObjectAuditAlarm)(
  12150. SubsystemName, HandleId, ObjectTypeName, ObjectName, SecurityDescriptor, TokenHandle, DesiredAccess, GrantedAccess, Privileges, ObjectCreation, AccessGranted, GenerateOnClose
  12151. );
  12152. end;
  12153. // Dynamic version of NtOpenObjectAuditAlarm
  12154. function ZwOpenObjectAuditAlarm(
  12155. SubsystemName : PUNICODE_STRING;
  12156. HandleId : PPVOID;
  12157. ObjectTypeName : PUNICODE_STRING;
  12158. ObjectName : PUNICODE_STRING;
  12159. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  12160. TokenHandle : HANDLE;
  12161. DesiredAccess : ACCESS_MASK;
  12162. GrantedAccess : ACCESS_MASK;
  12163. Privileges : PPRIVILEGE_SET;
  12164. ObjectCreation : BOOLEAN;
  12165. AccessGranted : BOOLEAN;
  12166. GenerateOnClose : PBOOLEAN
  12167. ): NTSTATUS; stdcall;
  12168. begin
  12169. GetProcedureAddress(_NtOpenObjectAuditAlarm, ntdll, 'NtOpenObjectAuditAlarm');
  12170. Result := TFNNtOpenObjectAuditAlarm(_NtOpenObjectAuditAlarm)(
  12171. SubsystemName, HandleId, ObjectTypeName, ObjectName, SecurityDescriptor, TokenHandle, DesiredAccess, GrantedAccess, Privileges, ObjectCreation, AccessGranted, GenerateOnClose
  12172. );
  12173. end;
  12174. // Dynamic version of NtOpenProcess
  12175. function NtOpenProcess(
  12176. ProcessHandle : PHANDLE;
  12177. DesiredAccess : ACCESS_MASK;
  12178. ObjectAttributes : POBJECT_ATTRIBUTES;
  12179. ClientId : PCLIENT_ID
  12180. ): NTSTATUS; stdcall;
  12181. begin
  12182. GetProcedureAddress(_NtOpenProcess, ntdll, 'NtOpenProcess');
  12183. Result := TFNNtOpenProcess(_NtOpenProcess)(
  12184. ProcessHandle, DesiredAccess, ObjectAttributes, ClientId
  12185. );
  12186. end;
  12187. // Dynamic version of NtOpenProcess
  12188. function ZwOpenProcess(
  12189. ProcessHandle : PHANDLE;
  12190. DesiredAccess : ACCESS_MASK;
  12191. ObjectAttributes : POBJECT_ATTRIBUTES;
  12192. ClientId : PCLIENT_ID
  12193. ): NTSTATUS; stdcall;
  12194. begin
  12195. GetProcedureAddress(_NtOpenProcess, ntdll, 'NtOpenProcess');
  12196. Result := TFNNtOpenProcess(_NtOpenProcess)(
  12197. ProcessHandle, DesiredAccess, ObjectAttributes, ClientId
  12198. );
  12199. end;
  12200. // Dynamic version of NtOpenProcessToken
  12201. function NtOpenProcessToken(
  12202. ProcessHandle : HANDLE;
  12203. DesiredAccess : ACCESS_MASK;
  12204. TokenHandle : PHANDLE
  12205. ): NTSTATUS; stdcall;
  12206. begin
  12207. GetProcedureAddress(_NtOpenProcessToken, ntdll, 'NtOpenProcessToken');
  12208. Result := TFNNtOpenProcessToken(_NtOpenProcessToken)(
  12209. ProcessHandle, DesiredAccess, TokenHandle
  12210. );
  12211. end;
  12212. // Dynamic version of NtOpenProcessToken
  12213. function ZwOpenProcessToken(
  12214. ProcessHandle : HANDLE;
  12215. DesiredAccess : ACCESS_MASK;
  12216. TokenHandle : PHANDLE
  12217. ): NTSTATUS; stdcall;
  12218. begin
  12219. GetProcedureAddress(_NtOpenProcessToken, ntdll, 'NtOpenProcessToken');
  12220. Result := TFNNtOpenProcessToken(_NtOpenProcessToken)(
  12221. ProcessHandle, DesiredAccess, TokenHandle
  12222. );
  12223. end;
  12224. // Dynamic version of NtOpenSection
  12225. function NtOpenSection(
  12226. SectionHandle : PHANDLE;
  12227. DesiredAccess : ACCESS_MASK;
  12228. ObjectAttributes : POBJECT_ATTRIBUTES
  12229. ): NTSTATUS; stdcall;
  12230. begin
  12231. GetProcedureAddress(_NtOpenSection, ntdll, 'NtOpenSection');
  12232. Result := TFNNtOpenSection(_NtOpenSection)(
  12233. SectionHandle, DesiredAccess, ObjectAttributes
  12234. );
  12235. end;
  12236. // Dynamic version of NtOpenSection
  12237. function ZwOpenSection(
  12238. SectionHandle : PHANDLE;
  12239. DesiredAccess : ACCESS_MASK;
  12240. ObjectAttributes : POBJECT_ATTRIBUTES
  12241. ): NTSTATUS; stdcall;
  12242. begin
  12243. GetProcedureAddress(_NtOpenSection, ntdll, 'NtOpenSection');
  12244. Result := TFNNtOpenSection(_NtOpenSection)(
  12245. SectionHandle, DesiredAccess, ObjectAttributes
  12246. );
  12247. end;
  12248. // Dynamic version of NtOpenSemaphore
  12249. function NtOpenSemaphore(
  12250. SemaphoreHandle : PHANDLE;
  12251. DesiredAccess : ACCESS_MASK;
  12252. ObjectAttributes : POBJECT_ATTRIBUTES
  12253. ): NTSTATUS; stdcall;
  12254. begin
  12255. GetProcedureAddress(_NtOpenSemaphore, ntdll, 'NtOpenSemaphore');
  12256. Result := TFNNtOpenSemaphore(_NtOpenSemaphore)(
  12257. SemaphoreHandle, DesiredAccess, ObjectAttributes
  12258. );
  12259. end;
  12260. // Dynamic version of NtOpenSemaphore
  12261. function ZwOpenSemaphore(
  12262. SemaphoreHandle : PHANDLE;
  12263. DesiredAccess : ACCESS_MASK;
  12264. ObjectAttributes : POBJECT_ATTRIBUTES
  12265. ): NTSTATUS; stdcall;
  12266. begin
  12267. GetProcedureAddress(_NtOpenSemaphore, ntdll, 'NtOpenSemaphore');
  12268. Result := TFNNtOpenSemaphore(_NtOpenSemaphore)(
  12269. SemaphoreHandle, DesiredAccess, ObjectAttributes
  12270. );
  12271. end;
  12272. // Dynamic version of NtOpenSymbolicLinkObject
  12273. function NtOpenSymbolicLinkObject(
  12274. SymbolicLinkHandle : PHANDLE;
  12275. DesiredAccess : ACCESS_MASK;
  12276. ObjectAttributes : POBJECT_ATTRIBUTES
  12277. ): NTSTATUS; stdcall;
  12278. begin
  12279. GetProcedureAddress(_NtOpenSymbolicLinkObject, ntdll, 'NtOpenSymbolicLinkObject');
  12280. Result := TFNNtOpenSymbolicLinkObject(_NtOpenSymbolicLinkObject)(
  12281. SymbolicLinkHandle, DesiredAccess, ObjectAttributes
  12282. );
  12283. end;
  12284. // Dynamic version of NtOpenSymbolicLinkObject
  12285. function ZwOpenSymbolicLinkObject(
  12286. SymbolicLinkHandle : PHANDLE;
  12287. DesiredAccess : ACCESS_MASK;
  12288. ObjectAttributes : POBJECT_ATTRIBUTES
  12289. ): NTSTATUS; stdcall;
  12290. begin
  12291. GetProcedureAddress(_NtOpenSymbolicLinkObject, ntdll, 'NtOpenSymbolicLinkObject');
  12292. Result := TFNNtOpenSymbolicLinkObject(_NtOpenSymbolicLinkObject)(
  12293. SymbolicLinkHandle, DesiredAccess, ObjectAttributes
  12294. );
  12295. end;
  12296. // Dynamic version of NtOpenThread
  12297. function NtOpenThread(
  12298. ThreadHandle : PHANDLE;
  12299. DesiredAccess : ACCESS_MASK;
  12300. ObjectAttributes : POBJECT_ATTRIBUTES;
  12301. ClientId : PCLIENT_ID
  12302. ): NTSTATUS; stdcall;
  12303. begin
  12304. GetProcedureAddress(_NtOpenThread, ntdll, 'NtOpenThread');
  12305. Result := TFNNtOpenThread(_NtOpenThread)(
  12306. ThreadHandle, DesiredAccess, ObjectAttributes, ClientId
  12307. );
  12308. end;
  12309. // Dynamic version of NtOpenThread
  12310. function ZwOpenThread(
  12311. ThreadHandle : PHANDLE;
  12312. DesiredAccess : ACCESS_MASK;
  12313. ObjectAttributes : POBJECT_ATTRIBUTES;
  12314. ClientId : PCLIENT_ID
  12315. ): NTSTATUS; stdcall;
  12316. begin
  12317. GetProcedureAddress(_NtOpenThread, ntdll, 'NtOpenThread');
  12318. Result := TFNNtOpenThread(_NtOpenThread)(
  12319. ThreadHandle, DesiredAccess, ObjectAttributes, ClientId
  12320. );
  12321. end;
  12322. // Dynamic version of NtOpenThreadToken
  12323. function NtOpenThreadToken(
  12324. ThreadHandle : HANDLE;
  12325. DesiredAccess : ACCESS_MASK;
  12326. OpenAsSelf : BOOLEAN;
  12327. TokenHandle : PHANDLE
  12328. ): NTSTATUS; stdcall;
  12329. begin
  12330. GetProcedureAddress(_NtOpenThreadToken, ntdll, 'NtOpenThreadToken');
  12331. Result := TFNNtOpenThreadToken(_NtOpenThreadToken)(
  12332. ThreadHandle, DesiredAccess, OpenAsSelf, TokenHandle
  12333. );
  12334. end;
  12335. // Dynamic version of NtOpenThreadToken
  12336. function ZwOpenThreadToken(
  12337. ThreadHandle : HANDLE;
  12338. DesiredAccess : ACCESS_MASK;
  12339. OpenAsSelf : BOOLEAN;
  12340. TokenHandle : PHANDLE
  12341. ): NTSTATUS; stdcall;
  12342. begin
  12343. GetProcedureAddress(_NtOpenThreadToken, ntdll, 'NtOpenThreadToken');
  12344. Result := TFNNtOpenThreadToken(_NtOpenThreadToken)(
  12345. ThreadHandle, DesiredAccess, OpenAsSelf, TokenHandle
  12346. );
  12347. end;
  12348. // Dynamic version of NtOpenTimer
  12349. function NtOpenTimer(
  12350. TimerHandle : PHANDLE;
  12351. DesiredAccess : ACCESS_MASK;
  12352. ObjectAttributes : POBJECT_ATTRIBUTES
  12353. ): NTSTATUS; stdcall;
  12354. begin
  12355. GetProcedureAddress(_NtOpenTimer, ntdll, 'NtOpenTimer');
  12356. Result := TFNNtOpenTimer(_NtOpenTimer)(
  12357. TimerHandle, DesiredAccess, ObjectAttributes
  12358. );
  12359. end;
  12360. // Dynamic version of NtOpenTimer
  12361. function ZwOpenTimer(
  12362. TimerHandle : PHANDLE;
  12363. DesiredAccess : ACCESS_MASK;
  12364. ObjectAttributes : POBJECT_ATTRIBUTES
  12365. ): NTSTATUS; stdcall;
  12366. begin
  12367. GetProcedureAddress(_NtOpenTimer, ntdll, 'NtOpenTimer');
  12368. Result := TFNNtOpenTimer(_NtOpenTimer)(
  12369. TimerHandle, DesiredAccess, ObjectAttributes
  12370. );
  12371. end;
  12372. // Dynamic version of NtPlugPlayControl
  12373. function NtPlugPlayControl(
  12374. ControlCode : ULONG;
  12375. Buffer : PVOID;
  12376. BufferLength : ULONG
  12377. ): NTSTATUS; stdcall;
  12378. begin
  12379. GetProcedureAddress(_NtPlugPlayControl, ntdll, 'NtPlugPlayControl');
  12380. Result := TFNNtPlugPlayControl(_NtPlugPlayControl)(
  12381. ControlCode, Buffer, BufferLength
  12382. );
  12383. end;
  12384. // Dynamic version of NtPlugPlayControl
  12385. function ZwPlugPlayControl(
  12386. ControlCode : ULONG;
  12387. Buffer : PVOID;
  12388. BufferLength : ULONG
  12389. ): NTSTATUS; stdcall;
  12390. begin
  12391. GetProcedureAddress(_NtPlugPlayControl, ntdll, 'NtPlugPlayControl');
  12392. Result := TFNNtPlugPlayControl(_NtPlugPlayControl)(
  12393. ControlCode, Buffer, BufferLength
  12394. );
  12395. end;
  12396. // Dynamic version of NtPowerInformation
  12397. function NtPowerInformation(
  12398. PowerInformationLevel : POWER_INFORMATION_LEVEL;
  12399. InputBuffer : PVOID;
  12400. InputBufferLength : ULONG;
  12401. OutputBuffer : PVOID;
  12402. OutputBufferLength : ULONG
  12403. ): NTSTATUS; stdcall;
  12404. begin
  12405. GetProcedureAddress(_NtPowerInformation, ntdll, 'NtPowerInformation');
  12406. Result := TFNNtPowerInformation(_NtPowerInformation)(
  12407. PowerInformationLevel, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength
  12408. );
  12409. end;
  12410. // Dynamic version of NtPowerInformation
  12411. function ZwPowerInformation(
  12412. PowerInformationLevel : POWER_INFORMATION_LEVEL;
  12413. InputBuffer : PVOID;
  12414. InputBufferLength : ULONG;
  12415. OutputBuffer : PVOID;
  12416. OutputBufferLength : ULONG
  12417. ): NTSTATUS; stdcall;
  12418. begin
  12419. GetProcedureAddress(_NtPowerInformation, ntdll, 'NtPowerInformation');
  12420. Result := TFNNtPowerInformation(_NtPowerInformation)(
  12421. PowerInformationLevel, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength
  12422. );
  12423. end;
  12424. // Dynamic version of NtPrivilegeCheck
  12425. function NtPrivilegeCheck(
  12426. TokenHandle : HANDLE;
  12427. RequiredPrivileges : PPRIVILEGE_SET;
  12428. Result_ : PBOOLEAN
  12429. ): NTSTATUS; stdcall;
  12430. begin
  12431. GetProcedureAddress(_NtPrivilegeCheck, ntdll, 'NtPrivilegeCheck');
  12432. Result := TFNNtPrivilegeCheck(_NtPrivilegeCheck)(
  12433. TokenHandle, RequiredPrivileges, Result_
  12434. );
  12435. end;
  12436. // Dynamic version of NtPrivilegeCheck
  12437. function ZwPrivilegeCheck(
  12438. TokenHandle : HANDLE;
  12439. RequiredPrivileges : PPRIVILEGE_SET;
  12440. Result_ : PBOOLEAN
  12441. ): NTSTATUS; stdcall;
  12442. begin
  12443. GetProcedureAddress(_NtPrivilegeCheck, ntdll, 'NtPrivilegeCheck');
  12444. Result := TFNNtPrivilegeCheck(_NtPrivilegeCheck)(
  12445. TokenHandle, RequiredPrivileges, Result_
  12446. );
  12447. end;
  12448. // Dynamic version of NtPrivilegeObjectAuditAlarm
  12449. function NtPrivilegeObjectAuditAlarm(
  12450. SubsystemName : PUNICODE_STRING;
  12451. HandleId : PVOID;
  12452. TokenHandle : HANDLE;
  12453. DesiredAccess : ACCESS_MASK;
  12454. Privileges : PPRIVILEGE_SET;
  12455. AccessGranted : BOOLEAN
  12456. ): NTSTATUS; stdcall;
  12457. begin
  12458. GetProcedureAddress(_NtPrivilegeObjectAuditAlarm, ntdll, 'NtPrivilegeObjectAuditAlarm');
  12459. Result := TFNNtPrivilegeObjectAuditAlarm(_NtPrivilegeObjectAuditAlarm)(
  12460. SubsystemName, HandleId, TokenHandle, DesiredAccess, Privileges, AccessGranted
  12461. );
  12462. end;
  12463. // Dynamic version of NtPrivilegeObjectAuditAlarm
  12464. function ZwPrivilegeObjectAuditAlarm(
  12465. SubsystemName : PUNICODE_STRING;
  12466. HandleId : PVOID;
  12467. TokenHandle : HANDLE;
  12468. DesiredAccess : ACCESS_MASK;
  12469. Privileges : PPRIVILEGE_SET;
  12470. AccessGranted : BOOLEAN
  12471. ): NTSTATUS; stdcall;
  12472. begin
  12473. GetProcedureAddress(_NtPrivilegeObjectAuditAlarm, ntdll, 'NtPrivilegeObjectAuditAlarm');
  12474. Result := TFNNtPrivilegeObjectAuditAlarm(_NtPrivilegeObjectAuditAlarm)(
  12475. SubsystemName, HandleId, TokenHandle, DesiredAccess, Privileges, AccessGranted
  12476. );
  12477. end;
  12478. // Dynamic version of NtPrivilegedServiceAuditAlarm
  12479. function NtPrivilegedServiceAuditAlarm(
  12480. SubsystemName : PUNICODE_STRING;
  12481. ServiceName : PUNICODE_STRING;
  12482. TokenHandle : HANDLE;
  12483. Privileges : PPRIVILEGE_SET;
  12484. AccessGranted : BOOLEAN
  12485. ): NTSTATUS; stdcall;
  12486. begin
  12487. GetProcedureAddress(_NtPrivilegedServiceAuditAlarm, ntdll, 'NtPrivilegedServiceAuditAlarm');
  12488. Result := TFNNtPrivilegedServiceAuditAlarm(_NtPrivilegedServiceAuditAlarm)(
  12489. SubsystemName, ServiceName, TokenHandle, Privileges, AccessGranted
  12490. );
  12491. end;
  12492. // Dynamic version of NtPrivilegedServiceAuditAlarm
  12493. function ZwPrivilegedServiceAuditAlarm(
  12494. SubsystemName : PUNICODE_STRING;
  12495. ServiceName : PUNICODE_STRING;
  12496. TokenHandle : HANDLE;
  12497. Privileges : PPRIVILEGE_SET;
  12498. AccessGranted : BOOLEAN
  12499. ): NTSTATUS; stdcall;
  12500. begin
  12501. GetProcedureAddress(_NtPrivilegedServiceAuditAlarm, ntdll, 'NtPrivilegedServiceAuditAlarm');
  12502. Result := TFNNtPrivilegedServiceAuditAlarm(_NtPrivilegedServiceAuditAlarm)(
  12503. SubsystemName, ServiceName, TokenHandle, Privileges, AccessGranted
  12504. );
  12505. end;
  12506. // Dynamic version of NtProtectVirtualMemory
  12507. function NtProtectVirtualMemory(
  12508. ProcessHandle : HANDLE;
  12509. BaseAddress : PPVOID;
  12510. ProtectSize : PULONG;
  12511. NewProtect : ULONG;
  12512. OldProtect : PULONG
  12513. ): NTSTATUS; stdcall;
  12514. begin
  12515. GetProcedureAddress(_NtProtectVirtualMemory, ntdll, 'NtProtectVirtualMemory');
  12516. Result := TFNNtProtectVirtualMemory(_NtProtectVirtualMemory)(
  12517. ProcessHandle, BaseAddress, ProtectSize, NewProtect, OldProtect
  12518. );
  12519. end;
  12520. // Dynamic version of NtProtectVirtualMemory
  12521. function ZwProtectVirtualMemory(
  12522. ProcessHandle : HANDLE;
  12523. BaseAddress : PPVOID;
  12524. ProtectSize : PULONG;
  12525. NewProtect : ULONG;
  12526. OldProtect : PULONG
  12527. ): NTSTATUS; stdcall;
  12528. begin
  12529. GetProcedureAddress(_NtProtectVirtualMemory, ntdll, 'NtProtectVirtualMemory');
  12530. Result := TFNNtProtectVirtualMemory(_NtProtectVirtualMemory)(
  12531. ProcessHandle, BaseAddress, ProtectSize, NewProtect, OldProtect
  12532. );
  12533. end;
  12534. // Dynamic version of NtPulseEvent
  12535. function NtPulseEvent(
  12536. EventHandle : HANDLE;
  12537. PreviousState : PULONG
  12538. ): NTSTATUS; stdcall;
  12539. begin
  12540. GetProcedureAddress(_NtPulseEvent, ntdll, 'NtPulseEvent');
  12541. Result := TFNNtPulseEvent(_NtPulseEvent)(
  12542. EventHandle, PreviousState
  12543. );
  12544. end;
  12545. // Dynamic version of NtPulseEvent
  12546. function ZwPulseEvent(
  12547. EventHandle : HANDLE;
  12548. PreviousState : PULONG
  12549. ): NTSTATUS; stdcall;
  12550. begin
  12551. GetProcedureAddress(_NtPulseEvent, ntdll, 'NtPulseEvent');
  12552. Result := TFNNtPulseEvent(_NtPulseEvent)(
  12553. EventHandle, PreviousState
  12554. );
  12555. end;
  12556. // Dynamic version of NtQueryAttributesFile
  12557. function NtQueryAttributesFile(
  12558. ObjectAttributes : POBJECT_ATTRIBUTES;
  12559. FileInformation : PFILE_BASIC_INFORMATION
  12560. ): NTSTATUS; stdcall;
  12561. begin
  12562. GetProcedureAddress(_NtQueryAttributesFile, ntdll, 'NtQueryAttributesFile');
  12563. Result := TFNNtQueryAttributesFile(_NtQueryAttributesFile)(
  12564. ObjectAttributes, FileInformation
  12565. );
  12566. end;
  12567. // Dynamic version of NtQueryAttributesFile
  12568. function ZwQueryAttributesFile(
  12569. ObjectAttributes : POBJECT_ATTRIBUTES;
  12570. FileInformation : PFILE_BASIC_INFORMATION
  12571. ): NTSTATUS; stdcall;
  12572. begin
  12573. GetProcedureAddress(_NtQueryAttributesFile, ntdll, 'NtQueryAttributesFile');
  12574. Result := TFNNtQueryAttributesFile(_NtQueryAttributesFile)(
  12575. ObjectAttributes, FileInformation
  12576. );
  12577. end;
  12578. // Dynamic version of NtQueryDefaultLocale
  12579. function NtQueryDefaultLocale(
  12580. ThreadOrSystem : BOOLEAN;
  12581. Locale : PLCID
  12582. ): NTSTATUS; stdcall;
  12583. begin
  12584. GetProcedureAddress(_NtQueryDefaultLocale, ntdll, 'NtQueryDefaultLocale');
  12585. Result := TFNNtQueryDefaultLocale(_NtQueryDefaultLocale)(
  12586. ThreadOrSystem, Locale
  12587. );
  12588. end;
  12589. // Dynamic version of NtQueryDefaultLocale
  12590. function ZwQueryDefaultLocale(
  12591. ThreadOrSystem : BOOLEAN;
  12592. Locale : PLCID
  12593. ): NTSTATUS; stdcall;
  12594. begin
  12595. GetProcedureAddress(_NtQueryDefaultLocale, ntdll, 'NtQueryDefaultLocale');
  12596. Result := TFNNtQueryDefaultLocale(_NtQueryDefaultLocale)(
  12597. ThreadOrSystem, Locale
  12598. );
  12599. end;
  12600. // Dynamic version of NtQueryDefaultUILanguage
  12601. function NtQueryDefaultUILanguage(
  12602. LanguageId : PLANGID
  12603. ): NTSTATUS; stdcall;
  12604. begin
  12605. GetProcedureAddress(_NtQueryDefaultUILanguage, ntdll, 'NtQueryDefaultUILanguage');
  12606. Result := TFNNtQueryDefaultUILanguage(_NtQueryDefaultUILanguage)(
  12607. LanguageId
  12608. );
  12609. end;
  12610. // Dynamic version of NtQueryDefaultUILanguage
  12611. function ZwQueryDefaultUILanguage(
  12612. LanguageId : PLANGID
  12613. ): NTSTATUS; stdcall;
  12614. begin
  12615. GetProcedureAddress(_NtQueryDefaultUILanguage, ntdll, 'NtQueryDefaultUILanguage');
  12616. Result := TFNNtQueryDefaultUILanguage(_NtQueryDefaultUILanguage)(
  12617. LanguageId
  12618. );
  12619. end;
  12620. // Dynamic version of NtQueryDirectoryFile
  12621. function NtQueryDirectoryFile(
  12622. FileHandle : HANDLE;
  12623. Event : HANDLE;
  12624. ApcRoutine : PIO_APC_ROUTINE;
  12625. ApcContext : PVOID;
  12626. IoStatusBlock : PIO_STATUS_BLOCK;
  12627. FileInformation : PVOID;
  12628. FileInformationLength : ULONG;
  12629. FileInformationClass : FILE_INFORMATION_CLASS;
  12630. ReturnSingleEntry : BOOLEAN;
  12631. FileName : PUNICODE_STRING;
  12632. RestartScan : BOOLEAN
  12633. ): NTSTATUS; stdcall;
  12634. begin
  12635. GetProcedureAddress(_NtQueryDirectoryFile, ntdll, 'NtQueryDirectoryFile');
  12636. Result := TFNNtQueryDirectoryFile(_NtQueryDirectoryFile)(
  12637. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, FileInformation, FileInformationLength, FileInformationClass, ReturnSingleEntry, FileName, RestartScan
  12638. );
  12639. end;
  12640. // Dynamic version of NtQueryDirectoryFile
  12641. function ZwQueryDirectoryFile(
  12642. FileHandle : HANDLE;
  12643. Event : HANDLE;
  12644. ApcRoutine : PIO_APC_ROUTINE;
  12645. ApcContext : PVOID;
  12646. IoStatusBlock : PIO_STATUS_BLOCK;
  12647. FileInformation : PVOID;
  12648. FileInformationLength : ULONG;
  12649. FileInformationClass : FILE_INFORMATION_CLASS;
  12650. ReturnSingleEntry : BOOLEAN;
  12651. FileName : PUNICODE_STRING;
  12652. RestartScan : BOOLEAN
  12653. ): NTSTATUS; stdcall;
  12654. begin
  12655. GetProcedureAddress(_NtQueryDirectoryFile, ntdll, 'NtQueryDirectoryFile');
  12656. Result := TFNNtQueryDirectoryFile(_NtQueryDirectoryFile)(
  12657. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, FileInformation, FileInformationLength, FileInformationClass, ReturnSingleEntry, FileName, RestartScan
  12658. );
  12659. end;
  12660. // Dynamic version of NtQueryDirectoryObject
  12661. function NtQueryDirectoryObject(
  12662. DirectoryHandle : HANDLE;
  12663. Buffer : PVOID;
  12664. BufferLength : ULONG;
  12665. ReturnSingleEntry : BOOLEAN;
  12666. RestartScan : BOOLEAN;
  12667. Context : PULONG;
  12668. ReturnLength : PULONG
  12669. ): NTSTATUS; stdcall;
  12670. begin
  12671. GetProcedureAddress(_NtQueryDirectoryObject, ntdll, 'NtQueryDirectoryObject');
  12672. Result := TFNNtQueryDirectoryObject(_NtQueryDirectoryObject)(
  12673. DirectoryHandle, Buffer, BufferLength, ReturnSingleEntry, RestartScan, Context, ReturnLength
  12674. );
  12675. end;
  12676. // Dynamic version of NtQueryDirectoryObject
  12677. function ZwQueryDirectoryObject(
  12678. DirectoryHandle : HANDLE;
  12679. Buffer : PVOID;
  12680. BufferLength : ULONG;
  12681. ReturnSingleEntry : BOOLEAN;
  12682. RestartScan : BOOLEAN;
  12683. Context : PULONG;
  12684. ReturnLength : PULONG
  12685. ): NTSTATUS; stdcall;
  12686. begin
  12687. GetProcedureAddress(_NtQueryDirectoryObject, ntdll, 'NtQueryDirectoryObject');
  12688. Result := TFNNtQueryDirectoryObject(_NtQueryDirectoryObject)(
  12689. DirectoryHandle, Buffer, BufferLength, ReturnSingleEntry, RestartScan, Context, ReturnLength
  12690. );
  12691. end;
  12692. // Dynamic version of NtQueryEaFile
  12693. function NtQueryEaFile(
  12694. FileHandle : HANDLE;
  12695. IoStatusBlock : PIO_STATUS_BLOCK;
  12696. Buffer : PFILE_FULL_EA_INFORMATION;
  12697. BufferLength : ULONG;
  12698. ReturnSingleEntry : BOOLEAN;
  12699. EaList : PFILE_GET_EA_INFORMATION;
  12700. EaListLength : ULONG;
  12701. EaIndex : PULONG;
  12702. RestartScan : BOOLEAN
  12703. ): NTSTATUS; stdcall;
  12704. begin
  12705. GetProcedureAddress(_NtQueryEaFile, ntdll, 'NtQueryEaFile');
  12706. Result := TFNNtQueryEaFile(_NtQueryEaFile)(
  12707. FileHandle, IoStatusBlock, Buffer, BufferLength, ReturnSingleEntry, EaList, EaListLength, EaIndex, RestartScan
  12708. );
  12709. end;
  12710. // Dynamic version of NtQueryEaFile
  12711. function ZwQueryEaFile(
  12712. FileHandle : HANDLE;
  12713. IoStatusBlock : PIO_STATUS_BLOCK;
  12714. Buffer : PFILE_FULL_EA_INFORMATION;
  12715. BufferLength : ULONG;
  12716. ReturnSingleEntry : BOOLEAN;
  12717. EaList : PFILE_GET_EA_INFORMATION;
  12718. EaListLength : ULONG;
  12719. EaIndex : PULONG;
  12720. RestartScan : BOOLEAN
  12721. ): NTSTATUS; stdcall;
  12722. begin
  12723. GetProcedureAddress(_NtQueryEaFile, ntdll, 'NtQueryEaFile');
  12724. Result := TFNNtQueryEaFile(_NtQueryEaFile)(
  12725. FileHandle, IoStatusBlock, Buffer, BufferLength, ReturnSingleEntry, EaList, EaListLength, EaIndex, RestartScan
  12726. );
  12727. end;
  12728. // Dynamic version of NtQueryEvent
  12729. function NtQueryEvent(
  12730. EventHandle : HANDLE;
  12731. EventInformationClass : EVENT_INFORMATION_CLASS;
  12732. EventInformation : PVOID;
  12733. EventInformationLength : ULONG;
  12734. ResultLength : PULONG
  12735. ): NTSTATUS; stdcall;
  12736. begin
  12737. GetProcedureAddress(_NtQueryEvent, ntdll, 'NtQueryEvent');
  12738. Result := TFNNtQueryEvent(_NtQueryEvent)(
  12739. EventHandle, EventInformationClass, EventInformation, EventInformationLength, ResultLength
  12740. );
  12741. end;
  12742. // Dynamic version of NtQueryEvent
  12743. function ZwQueryEvent(
  12744. EventHandle : HANDLE;
  12745. EventInformationClass : EVENT_INFORMATION_CLASS;
  12746. EventInformation : PVOID;
  12747. EventInformationLength : ULONG;
  12748. ResultLength : PULONG
  12749. ): NTSTATUS; stdcall;
  12750. begin
  12751. GetProcedureAddress(_NtQueryEvent, ntdll, 'NtQueryEvent');
  12752. Result := TFNNtQueryEvent(_NtQueryEvent)(
  12753. EventHandle, EventInformationClass, EventInformation, EventInformationLength, ResultLength
  12754. );
  12755. end;
  12756. // Dynamic version of NtQueryFullAttributesFile
  12757. function NtQueryFullAttributesFile(
  12758. ObjectAttributes : POBJECT_ATTRIBUTES;
  12759. FileInformation : PFILE_NETWORK_OPEN_INFORMATION
  12760. ): NTSTATUS; stdcall;
  12761. begin
  12762. GetProcedureAddress(_NtQueryFullAttributesFile, ntdll, 'NtQueryFullAttributesFile');
  12763. Result := TFNNtQueryFullAttributesFile(_NtQueryFullAttributesFile)(
  12764. ObjectAttributes, FileInformation
  12765. );
  12766. end;
  12767. // Dynamic version of NtQueryFullAttributesFile
  12768. function ZwQueryFullAttributesFile(
  12769. ObjectAttributes : POBJECT_ATTRIBUTES;
  12770. FileInformation : PFILE_NETWORK_OPEN_INFORMATION
  12771. ): NTSTATUS; stdcall;
  12772. begin
  12773. GetProcedureAddress(_NtQueryFullAttributesFile, ntdll, 'NtQueryFullAttributesFile');
  12774. Result := TFNNtQueryFullAttributesFile(_NtQueryFullAttributesFile)(
  12775. ObjectAttributes, FileInformation
  12776. );
  12777. end;
  12778. // Dynamic version of NtQueryInformationAtom
  12779. function NtQueryInformationAtom(
  12780. Atom : USHORT;
  12781. AtomInformationClass : ATOM_INFORMATION_CLASS;
  12782. AtomInformation : PVOID;
  12783. AtomInformationLength : ULONG;
  12784. ReturnLength : PULONG
  12785. ): NTSTATUS; stdcall;
  12786. begin
  12787. GetProcedureAddress(_NtQueryInformationAtom, ntdll, 'NtQueryInformationAtom');
  12788. Result := TFNNtQueryInformationAtom(_NtQueryInformationAtom)(
  12789. Atom, AtomInformationClass, AtomInformation, AtomInformationLength, ReturnLength
  12790. );
  12791. end;
  12792. // Dynamic version of NtQueryInformationAtom
  12793. function ZwQueryInformationAtom(
  12794. Atom : USHORT;
  12795. AtomInformationClass : ATOM_INFORMATION_CLASS;
  12796. AtomInformation : PVOID;
  12797. AtomInformationLength : ULONG;
  12798. ReturnLength : PULONG
  12799. ): NTSTATUS; stdcall;
  12800. begin
  12801. GetProcedureAddress(_NtQueryInformationAtom, ntdll, 'NtQueryInformationAtom');
  12802. Result := TFNNtQueryInformationAtom(_NtQueryInformationAtom)(
  12803. Atom, AtomInformationClass, AtomInformation, AtomInformationLength, ReturnLength
  12804. );
  12805. end;
  12806. // Dynamic version of NtQueryInformationFile
  12807. function NtQueryInformationFile(
  12808. FileHandle : HANDLE;
  12809. IoStatusBlock : PIO_STATUS_BLOCK;
  12810. FileInformation : PVOID;
  12811. FileInformationLength : ULONG;
  12812. FileInformationClass : FILE_INFORMATION_CLASS
  12813. ): NTSTATUS; stdcall;
  12814. begin
  12815. GetProcedureAddress(_NtQueryInformationFile, ntdll, 'NtQueryInformationFile');
  12816. Result := TFNNtQueryInformationFile(_NtQueryInformationFile)(
  12817. FileHandle, IoStatusBlock, FileInformation, FileInformationLength, FileInformationClass
  12818. );
  12819. end;
  12820. // Dynamic version of NtQueryInformationFile
  12821. function ZwQueryInformationFile(
  12822. FileHandle : HANDLE;
  12823. IoStatusBlock : PIO_STATUS_BLOCK;
  12824. FileInformation : PVOID;
  12825. FileInformationLength : ULONG;
  12826. FileInformationClass : FILE_INFORMATION_CLASS
  12827. ): NTSTATUS; stdcall;
  12828. begin
  12829. GetProcedureAddress(_NtQueryInformationFile, ntdll, 'NtQueryInformationFile');
  12830. Result := TFNNtQueryInformationFile(_NtQueryInformationFile)(
  12831. FileHandle, IoStatusBlock, FileInformation, FileInformationLength, FileInformationClass
  12832. );
  12833. end;
  12834. // Dynamic version of NtQueryInformationJobObject
  12835. function NtQueryInformationJobObject(
  12836. JobHandle : HANDLE;
  12837. JobInformationClass : JOBOBJECTINFOCLASS;
  12838. JobInformation : PVOID;
  12839. JobInformationLength : ULONG;
  12840. ReturnLength : PULONG
  12841. ): NTSTATUS; stdcall;
  12842. begin
  12843. GetProcedureAddress(_NtQueryInformationJobObject, ntdll, 'NtQueryInformationJobObject');
  12844. Result := TFNNtQueryInformationJobObject(_NtQueryInformationJobObject)(
  12845. JobHandle, JobInformationClass, JobInformation, JobInformationLength, ReturnLength
  12846. );
  12847. end;
  12848. // Dynamic version of NtQueryInformationJobObject
  12849. function ZwQueryInformationJobObject(
  12850. JobHandle : HANDLE;
  12851. JobInformationClass : JOBOBJECTINFOCLASS;
  12852. JobInformation : PVOID;
  12853. JobInformationLength : ULONG;
  12854. ReturnLength : PULONG
  12855. ): NTSTATUS; stdcall;
  12856. begin
  12857. GetProcedureAddress(_NtQueryInformationJobObject, ntdll, 'NtQueryInformationJobObject');
  12858. Result := TFNNtQueryInformationJobObject(_NtQueryInformationJobObject)(
  12859. JobHandle, JobInformationClass, JobInformation, JobInformationLength, ReturnLength
  12860. );
  12861. end;
  12862. // Dynamic version of NtQueryInformationPort
  12863. function NtQueryInformationPort(
  12864. PortHandle : HANDLE;
  12865. PortInformationClass : PORT_INFORMATION_CLASS;
  12866. PortInformation : PVOID;
  12867. PortInformationLength : ULONG;
  12868. ReturnLength : PULONG
  12869. ): NTSTATUS; stdcall;
  12870. begin
  12871. GetProcedureAddress(_NtQueryInformationPort, ntdll, 'NtQueryInformationPort');
  12872. Result := TFNNtQueryInformationPort(_NtQueryInformationPort)(
  12873. PortHandle, PortInformationClass, PortInformation, PortInformationLength, ReturnLength
  12874. );
  12875. end;
  12876. // Dynamic version of NtQueryInformationPort
  12877. function ZwQueryInformationPort(
  12878. PortHandle : HANDLE;
  12879. PortInformationClass : PORT_INFORMATION_CLASS;
  12880. PortInformation : PVOID;
  12881. PortInformationLength : ULONG;
  12882. ReturnLength : PULONG
  12883. ): NTSTATUS; stdcall;
  12884. begin
  12885. GetProcedureAddress(_NtQueryInformationPort, ntdll, 'NtQueryInformationPort');
  12886. Result := TFNNtQueryInformationPort(_NtQueryInformationPort)(
  12887. PortHandle, PortInformationClass, PortInformation, PortInformationLength, ReturnLength
  12888. );
  12889. end;
  12890. {$IFNDEF JWA_INCLUDEMODE}
  12891. // Dynamic version of NtQueryInformationProcess
  12892. function NtQueryInformationProcess(
  12893. ProcessHandle : HANDLE;
  12894. ProcessInformationClass : PROCESSINFOCLASS;
  12895. ProcessInformation : PVOID;
  12896. ProcessInformationLength : ULONG;
  12897. ReturnLength : PULONG
  12898. ): NTSTATUS; stdcall;
  12899. begin
  12900. GetProcedureAddress(_NtQueryInformationProcess, ntdll, 'NtQueryInformationProcess');
  12901. Result := TFNNtQueryInformationProcess(_NtQueryInformationProcess)(
  12902. ProcessHandle, ProcessInformationClass, ProcessInformation, ProcessInformationLength, ReturnLength
  12903. );
  12904. end;
  12905. {$ENDIF JWA_INCLUDEMODE}
  12906. // Dynamic version of NtQueryInformationProcess
  12907. function ZwQueryInformationProcess(
  12908. ProcessHandle : HANDLE;
  12909. ProcessInformationClass : PROCESSINFOCLASS;
  12910. ProcessInformation : PVOID;
  12911. ProcessInformationLength : ULONG;
  12912. ReturnLength : PULONG
  12913. ): NTSTATUS; stdcall;
  12914. begin
  12915. GetProcedureAddress(_NtQueryInformationProcess, ntdll, 'NtQueryInformationProcess');
  12916. Result := TFNNtQueryInformationProcess(_NtQueryInformationProcess)(
  12917. ProcessHandle, ProcessInformationClass, ProcessInformation, ProcessInformationLength, ReturnLength
  12918. );
  12919. end;
  12920. {$IFNDEF JWA_INCLUDEMODE}
  12921. // Dynamic version of NtQueryInformationThread
  12922. function NtQueryInformationThread(
  12923. ThreadHandle : HANDLE;
  12924. ThreadInformationClass : THREADINFOCLASS;
  12925. ThreadInformation : PVOID;
  12926. ThreadInformationLength : ULONG;
  12927. ReturnLength : PULONG
  12928. ): NTSTATUS; stdcall;
  12929. begin
  12930. GetProcedureAddress(_NtQueryInformationThread, ntdll, 'NtQueryInformationThread');
  12931. Result := TFNNtQueryInformationThread(_NtQueryInformationThread)(
  12932. ThreadHandle, ThreadInformationClass, ThreadInformation, ThreadInformationLength, ReturnLength
  12933. );
  12934. end;
  12935. {$ENDIF JWA_INCLUDEMODE}
  12936. // Dynamic version of NtQueryInformationThread
  12937. function ZwQueryInformationThread(
  12938. ThreadHandle : HANDLE;
  12939. ThreadInformationClass : THREADINFOCLASS;
  12940. ThreadInformation : PVOID;
  12941. ThreadInformationLength : ULONG;
  12942. ReturnLength : PULONG
  12943. ): NTSTATUS; stdcall;
  12944. begin
  12945. GetProcedureAddress(_NtQueryInformationThread, ntdll, 'NtQueryInformationThread');
  12946. Result := TFNNtQueryInformationThread(_NtQueryInformationThread)(
  12947. ThreadHandle, ThreadInformationClass, ThreadInformation, ThreadInformationLength, ReturnLength
  12948. );
  12949. end;
  12950. // Dynamic version of NtQueryInformationToken
  12951. function NtQueryInformationToken(
  12952. TokenHandle : HANDLE;
  12953. TokenInformationClass : TOKEN_INFORMATION_CLASS;
  12954. TokenInformation : PVOID;
  12955. TokenInformationLength : ULONG;
  12956. ReturnLength : PULONG
  12957. ): NTSTATUS; stdcall;
  12958. begin
  12959. GetProcedureAddress(_NtQueryInformationToken, ntdll, 'NtQueryInformationToken');
  12960. Result := TFNNtQueryInformationToken(_NtQueryInformationToken)(
  12961. TokenHandle, TokenInformationClass, TokenInformation, TokenInformationLength, ReturnLength
  12962. );
  12963. end;
  12964. // Dynamic version of NtQueryInformationToken
  12965. function ZwQueryInformationToken(
  12966. TokenHandle : HANDLE;
  12967. TokenInformationClass : TOKEN_INFORMATION_CLASS;
  12968. TokenInformation : PVOID;
  12969. TokenInformationLength : ULONG;
  12970. ReturnLength : PULONG
  12971. ): NTSTATUS; stdcall;
  12972. begin
  12973. GetProcedureAddress(_NtQueryInformationToken, ntdll, 'NtQueryInformationToken');
  12974. Result := TFNNtQueryInformationToken(_NtQueryInformationToken)(
  12975. TokenHandle, TokenInformationClass, TokenInformation, TokenInformationLength, ReturnLength
  12976. );
  12977. end;
  12978. // Dynamic version of NtQueryInstallUILanguage
  12979. function NtQueryInstallUILanguage(
  12980. LanguageId : PLANGID
  12981. ): NTSTATUS; stdcall;
  12982. begin
  12983. GetProcedureAddress(_NtQueryInstallUILanguage, ntdll, 'NtQueryInstallUILanguage');
  12984. Result := TFNNtQueryInstallUILanguage(_NtQueryInstallUILanguage)(
  12985. LanguageId
  12986. );
  12987. end;
  12988. // Dynamic version of NtQueryInstallUILanguage
  12989. function ZwQueryInstallUILanguage(
  12990. LanguageId : PLANGID
  12991. ): NTSTATUS; stdcall;
  12992. begin
  12993. GetProcedureAddress(_NtQueryInstallUILanguage, ntdll, 'NtQueryInstallUILanguage');
  12994. Result := TFNNtQueryInstallUILanguage(_NtQueryInstallUILanguage)(
  12995. LanguageId
  12996. );
  12997. end;
  12998. // Dynamic version of NtQueryIntervalProfile
  12999. function NtQueryIntervalProfile(
  13000. Source : KPROFILE_SOURCE;
  13001. Interval : PULONG
  13002. ): NTSTATUS; stdcall;
  13003. begin
  13004. GetProcedureAddress(_NtQueryIntervalProfile, ntdll, 'NtQueryIntervalProfile');
  13005. Result := TFNNtQueryIntervalProfile(_NtQueryIntervalProfile)(
  13006. Source, Interval
  13007. );
  13008. end;
  13009. // Dynamic version of NtQueryIntervalProfile
  13010. function ZwQueryIntervalProfile(
  13011. Source : KPROFILE_SOURCE;
  13012. Interval : PULONG
  13013. ): NTSTATUS; stdcall;
  13014. begin
  13015. GetProcedureAddress(_NtQueryIntervalProfile, ntdll, 'NtQueryIntervalProfile');
  13016. Result := TFNNtQueryIntervalProfile(_NtQueryIntervalProfile)(
  13017. Source, Interval
  13018. );
  13019. end;
  13020. // Dynamic version of NtQueryIoCompletion
  13021. function NtQueryIoCompletion(
  13022. IoCompletionHandle : HANDLE;
  13023. IoCompletionInformationClass : IO_COMPLETION_INFORMATION_CLASS;
  13024. IoCompletionInformation : PVOID;
  13025. IoCompletionInformationLength : ULONG;
  13026. ResultLength : PULONG
  13027. ): NTSTATUS; stdcall;
  13028. begin
  13029. GetProcedureAddress(_NtQueryIoCompletion, ntdll, 'NtQueryIoCompletion');
  13030. Result := TFNNtQueryIoCompletion(_NtQueryIoCompletion)(
  13031. IoCompletionHandle, IoCompletionInformationClass, IoCompletionInformation, IoCompletionInformationLength, ResultLength
  13032. );
  13033. end;
  13034. // Dynamic version of NtQueryIoCompletion
  13035. function ZwQueryIoCompletion(
  13036. IoCompletionHandle : HANDLE;
  13037. IoCompletionInformationClass : IO_COMPLETION_INFORMATION_CLASS;
  13038. IoCompletionInformation : PVOID;
  13039. IoCompletionInformationLength : ULONG;
  13040. ResultLength : PULONG
  13041. ): NTSTATUS; stdcall;
  13042. begin
  13043. GetProcedureAddress(_NtQueryIoCompletion, ntdll, 'NtQueryIoCompletion');
  13044. Result := TFNNtQueryIoCompletion(_NtQueryIoCompletion)(
  13045. IoCompletionHandle, IoCompletionInformationClass, IoCompletionInformation, IoCompletionInformationLength, ResultLength
  13046. );
  13047. end;
  13048. // Dynamic version of NtQueryKey
  13049. function NtQueryKey(
  13050. KeyHandle : HANDLE;
  13051. KeyInformationClass : KEY_INFORMATION_CLASS;
  13052. KeyInformation : PVOID;
  13053. KeyInformationLength : ULONG;
  13054. ResultLength : PULONG
  13055. ): NTSTATUS; stdcall;
  13056. begin
  13057. GetProcedureAddress(_NtQueryKey, ntdll, 'NtQueryKey');
  13058. Result := TFNNtQueryKey(_NtQueryKey)(
  13059. KeyHandle, KeyInformationClass, KeyInformation, KeyInformationLength, ResultLength
  13060. );
  13061. end;
  13062. // Dynamic version of NtQueryKey
  13063. function ZwQueryKey(
  13064. KeyHandle : HANDLE;
  13065. KeyInformationClass : KEY_INFORMATION_CLASS;
  13066. KeyInformation : PVOID;
  13067. KeyInformationLength : ULONG;
  13068. ResultLength : PULONG
  13069. ): NTSTATUS; stdcall;
  13070. begin
  13071. GetProcedureAddress(_NtQueryKey, ntdll, 'NtQueryKey');
  13072. Result := TFNNtQueryKey(_NtQueryKey)(
  13073. KeyHandle, KeyInformationClass, KeyInformation, KeyInformationLength, ResultLength
  13074. );
  13075. end;
  13076. // Dynamic version of NtQueryMultipleValueKey
  13077. function NtQueryMultipleValueKey(
  13078. KeyHandle : HANDLE;
  13079. ValueList : PKEY_VALUE_ENTRY;
  13080. NumberOfValues : ULONG;
  13081. Buffer : PVOID;
  13082. Length : PULONG;
  13083. ReturnLength : PULONG
  13084. ): NTSTATUS; stdcall;
  13085. begin
  13086. GetProcedureAddress(_NtQueryMultipleValueKey, ntdll, 'NtQueryMultipleValueKey');
  13087. Result := TFNNtQueryMultipleValueKey(_NtQueryMultipleValueKey)(
  13088. KeyHandle, ValueList, NumberOfValues, Buffer, Length, ReturnLength
  13089. );
  13090. end;
  13091. // Dynamic version of NtQueryMultipleValueKey
  13092. function ZwQueryMultipleValueKey(
  13093. KeyHandle : HANDLE;
  13094. ValueList : PKEY_VALUE_ENTRY;
  13095. NumberOfValues : ULONG;
  13096. Buffer : PVOID;
  13097. Length : PULONG;
  13098. ReturnLength : PULONG
  13099. ): NTSTATUS; stdcall;
  13100. begin
  13101. GetProcedureAddress(_NtQueryMultipleValueKey, ntdll, 'NtQueryMultipleValueKey');
  13102. Result := TFNNtQueryMultipleValueKey(_NtQueryMultipleValueKey)(
  13103. KeyHandle, ValueList, NumberOfValues, Buffer, Length, ReturnLength
  13104. );
  13105. end;
  13106. // Dynamic version of NtQueryMutant
  13107. function NtQueryMutant(
  13108. MutantHandle : HANDLE;
  13109. MutantInformationClass : MUTANT_INFORMATION_CLASS;
  13110. MutantInformation : PVOID;
  13111. MutantInformationLength : ULONG;
  13112. ResultLength : PULONG
  13113. ): NTSTATUS; stdcall;
  13114. begin
  13115. GetProcedureAddress(_NtQueryMutant, ntdll, 'NtQueryMutant');
  13116. Result := TFNNtQueryMutant(_NtQueryMutant)(
  13117. MutantHandle, MutantInformationClass, MutantInformation, MutantInformationLength, ResultLength
  13118. );
  13119. end;
  13120. // Dynamic version of NtQueryMutant
  13121. function ZwQueryMutant(
  13122. MutantHandle : HANDLE;
  13123. MutantInformationClass : MUTANT_INFORMATION_CLASS;
  13124. MutantInformation : PVOID;
  13125. MutantInformationLength : ULONG;
  13126. ResultLength : PULONG
  13127. ): NTSTATUS; stdcall;
  13128. begin
  13129. GetProcedureAddress(_NtQueryMutant, ntdll, 'NtQueryMutant');
  13130. Result := TFNNtQueryMutant(_NtQueryMutant)(
  13131. MutantHandle, MutantInformationClass, MutantInformation, MutantInformationLength, ResultLength
  13132. );
  13133. end;
  13134. // Dynamic version of NtQueryObject
  13135. function NtQueryObject(
  13136. ObjectHandle : HANDLE;
  13137. ObjectInformationClass : OBJECT_INFORMATION_CLASS;
  13138. ObjectInformation : PVOID;
  13139. ObjectInformationLength : ULONG;
  13140. ReturnLength : PULONG
  13141. ): NTSTATUS; stdcall;
  13142. begin
  13143. GetProcedureAddress(_NtQueryObject, ntdll, 'NtQueryObject');
  13144. Result := TFNNtQueryObject(_NtQueryObject)(
  13145. ObjectHandle, ObjectInformationClass, ObjectInformation, ObjectInformationLength, ReturnLength
  13146. );
  13147. end;
  13148. // Dynamic version of NtQueryObject
  13149. function ZwQueryObject(
  13150. ObjectHandle : HANDLE;
  13151. ObjectInformationClass : OBJECT_INFORMATION_CLASS;
  13152. ObjectInformation : PVOID;
  13153. ObjectInformationLength : ULONG;
  13154. ReturnLength : PULONG
  13155. ): NTSTATUS; stdcall;
  13156. begin
  13157. GetProcedureAddress(_NtQueryObject, ntdll, 'NtQueryObject');
  13158. Result := TFNNtQueryObject(_NtQueryObject)(
  13159. ObjectHandle, ObjectInformationClass, ObjectInformation, ObjectInformationLength, ReturnLength
  13160. );
  13161. end;
  13162. // Dynamic version of NtQueryOpenSubKeys
  13163. function NtQueryOpenSubKeys(
  13164. KeyObjectAttributes : POBJECT_ATTRIBUTES;
  13165. NumberOfKey : PULONG
  13166. ): NTSTATUS; stdcall;
  13167. begin
  13168. GetProcedureAddress(_NtQueryOpenSubKeys, ntdll, 'NtQueryOpenSubKeys');
  13169. Result := TFNNtQueryOpenSubKeys(_NtQueryOpenSubKeys)(
  13170. KeyObjectAttributes, NumberOfKey
  13171. );
  13172. end;
  13173. // Dynamic version of NtQueryOpenSubKeys
  13174. function ZwQueryOpenSubKeys(
  13175. KeyObjectAttributes : POBJECT_ATTRIBUTES;
  13176. NumberOfKey : PULONG
  13177. ): NTSTATUS; stdcall;
  13178. begin
  13179. GetProcedureAddress(_NtQueryOpenSubKeys, ntdll, 'NtQueryOpenSubKeys');
  13180. Result := TFNNtQueryOpenSubKeys(_NtQueryOpenSubKeys)(
  13181. KeyObjectAttributes, NumberOfKey
  13182. );
  13183. end;
  13184. // Dynamic version of NtQueryPerformanceCounter
  13185. function NtQueryPerformanceCounter(
  13186. PerformanceCount : PLARGE_INTEGER;
  13187. PerformanceFrequency : PLARGE_INTEGER
  13188. ): NTSTATUS; stdcall;
  13189. begin
  13190. GetProcedureAddress(_NtQueryPerformanceCounter, ntdll, 'NtQueryPerformanceCounter');
  13191. Result := TFNNtQueryPerformanceCounter(_NtQueryPerformanceCounter)(
  13192. PerformanceCount, PerformanceFrequency
  13193. );
  13194. end;
  13195. // Dynamic version of NtQueryPerformanceCounter
  13196. function ZwQueryPerformanceCounter(
  13197. PerformanceCount : PLARGE_INTEGER;
  13198. PerformanceFrequency : PLARGE_INTEGER
  13199. ): NTSTATUS; stdcall;
  13200. begin
  13201. GetProcedureAddress(_NtQueryPerformanceCounter, ntdll, 'NtQueryPerformanceCounter');
  13202. Result := TFNNtQueryPerformanceCounter(_NtQueryPerformanceCounter)(
  13203. PerformanceCount, PerformanceFrequency
  13204. );
  13205. end;
  13206. // Dynamic version of NtQueryPortInformationProcess
  13207. function NtQueryPortInformationProcess(): ULONG; stdcall;
  13208. begin
  13209. GetProcedureAddress(_NtQueryPortInformationProcess, ntdll, 'NtQueryPortInformationProcess');
  13210. Result := TFNNtQueryPortInformationProcess(_NtQueryPortInformationProcess)();
  13211. end;
  13212. // Dynamic version of NtQueryPortInformationProcess
  13213. function ZwQueryPortInformationProcess(): ULONG; stdcall;
  13214. begin
  13215. GetProcedureAddress(_NtQueryPortInformationProcess, ntdll, 'NtQueryPortInformationProcess');
  13216. Result := TFNNtQueryPortInformationProcess(_NtQueryPortInformationProcess)();
  13217. end;
  13218. // Dynamic version of NtQueryQuotaInformationFile
  13219. function NtQueryQuotaInformationFile(
  13220. FileHandle : HANDLE;
  13221. IoStatusBlock : PIO_STATUS_BLOCK;
  13222. Buffer : PFILE_USER_QUOTA_INFORMATION;
  13223. BufferLength : ULONG;
  13224. ReturnSingleEntry : BOOLEAN;
  13225. QuotaList : PFILE_QUOTA_LIST_INFORMATION;
  13226. QuotaListLength : ULONG;
  13227. ResumeSid : PSID;
  13228. RestartScan : BOOLEAN
  13229. ): NTSTATUS; stdcall;
  13230. begin
  13231. GetProcedureAddress(_NtQueryQuotaInformationFile, ntdll, 'NtQueryQuotaInformationFile');
  13232. Result := TFNNtQueryQuotaInformationFile(_NtQueryQuotaInformationFile)(
  13233. FileHandle, IoStatusBlock, Buffer, BufferLength, ReturnSingleEntry, QuotaList, QuotaListLength, ResumeSid, RestartScan
  13234. );
  13235. end;
  13236. // Dynamic version of NtQueryQuotaInformationFile
  13237. function ZwQueryQuotaInformationFile(
  13238. FileHandle : HANDLE;
  13239. IoStatusBlock : PIO_STATUS_BLOCK;
  13240. Buffer : PFILE_USER_QUOTA_INFORMATION;
  13241. BufferLength : ULONG;
  13242. ReturnSingleEntry : BOOLEAN;
  13243. QuotaList : PFILE_QUOTA_LIST_INFORMATION;
  13244. QuotaListLength : ULONG;
  13245. ResumeSid : PSID;
  13246. RestartScan : BOOLEAN
  13247. ): NTSTATUS; stdcall;
  13248. begin
  13249. GetProcedureAddress(_NtQueryQuotaInformationFile, ntdll, 'NtQueryQuotaInformationFile');
  13250. Result := TFNNtQueryQuotaInformationFile(_NtQueryQuotaInformationFile)(
  13251. FileHandle, IoStatusBlock, Buffer, BufferLength, ReturnSingleEntry, QuotaList, QuotaListLength, ResumeSid, RestartScan
  13252. );
  13253. end;
  13254. // Dynamic version of NtQuerySection
  13255. function NtQuerySection(
  13256. SectionHandle : HANDLE;
  13257. SectionInformationClass : SECTION_INFORMATION_CLASS;
  13258. SectionInformation : PVOID;
  13259. SectionInformationLength : ULONG;
  13260. ResultLength : PULONG
  13261. ): NTSTATUS; stdcall;
  13262. begin
  13263. GetProcedureAddress(_NtQuerySection, ntdll, 'NtQuerySection');
  13264. Result := TFNNtQuerySection(_NtQuerySection)(
  13265. SectionHandle, SectionInformationClass, SectionInformation, SectionInformationLength, ResultLength
  13266. );
  13267. end;
  13268. // Dynamic version of NtQuerySection
  13269. function ZwQuerySection(
  13270. SectionHandle : HANDLE;
  13271. SectionInformationClass : SECTION_INFORMATION_CLASS;
  13272. SectionInformation : PVOID;
  13273. SectionInformationLength : ULONG;
  13274. ResultLength : PULONG
  13275. ): NTSTATUS; stdcall;
  13276. begin
  13277. GetProcedureAddress(_NtQuerySection, ntdll, 'NtQuerySection');
  13278. Result := TFNNtQuerySection(_NtQuerySection)(
  13279. SectionHandle, SectionInformationClass, SectionInformation, SectionInformationLength, ResultLength
  13280. );
  13281. end;
  13282. // Dynamic version of NtQuerySecurityObject
  13283. function NtQuerySecurityObject(
  13284. Handle : HANDLE;
  13285. RequestedInformation : SECURITY_INFORMATION;
  13286. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  13287. SecurityDescriptorLength : ULONG;
  13288. ReturnLength : PULONG
  13289. ): NTSTATUS; stdcall;
  13290. begin
  13291. GetProcedureAddress(_NtQuerySecurityObject, ntdll, 'NtQuerySecurityObject');
  13292. Result := TFNNtQuerySecurityObject(_NtQuerySecurityObject)(
  13293. Handle, RequestedInformation, SecurityDescriptor, SecurityDescriptorLength, ReturnLength
  13294. );
  13295. end;
  13296. // Dynamic version of NtQuerySecurityObject
  13297. function ZwQuerySecurityObject(
  13298. Handle : HANDLE;
  13299. RequestedInformation : SECURITY_INFORMATION;
  13300. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  13301. SecurityDescriptorLength : ULONG;
  13302. ReturnLength : PULONG
  13303. ): NTSTATUS; stdcall;
  13304. begin
  13305. GetProcedureAddress(_NtQuerySecurityObject, ntdll, 'NtQuerySecurityObject');
  13306. Result := TFNNtQuerySecurityObject(_NtQuerySecurityObject)(
  13307. Handle, RequestedInformation, SecurityDescriptor, SecurityDescriptorLength, ReturnLength
  13308. );
  13309. end;
  13310. // Dynamic version of NtQuerySemaphore
  13311. function NtQuerySemaphore(
  13312. SemaphoreHandle : HANDLE;
  13313. SemaphoreInformationClass : SEMAPHORE_INFORMATION_CLASS;
  13314. SemaphoreInformation : PVOID;
  13315. SemaphoreInformationLength : ULONG;
  13316. ResultLength : PULONG
  13317. ): NTSTATUS; stdcall;
  13318. begin
  13319. GetProcedureAddress(_NtQuerySemaphore, ntdll, 'NtQuerySemaphore');
  13320. Result := TFNNtQuerySemaphore(_NtQuerySemaphore)(
  13321. SemaphoreHandle, SemaphoreInformationClass, SemaphoreInformation, SemaphoreInformationLength, ResultLength
  13322. );
  13323. end;
  13324. // Dynamic version of NtQuerySemaphore
  13325. function ZwQuerySemaphore(
  13326. SemaphoreHandle : HANDLE;
  13327. SemaphoreInformationClass : SEMAPHORE_INFORMATION_CLASS;
  13328. SemaphoreInformation : PVOID;
  13329. SemaphoreInformationLength : ULONG;
  13330. ResultLength : PULONG
  13331. ): NTSTATUS; stdcall;
  13332. begin
  13333. GetProcedureAddress(_NtQuerySemaphore, ntdll, 'NtQuerySemaphore');
  13334. Result := TFNNtQuerySemaphore(_NtQuerySemaphore)(
  13335. SemaphoreHandle, SemaphoreInformationClass, SemaphoreInformation, SemaphoreInformationLength, ResultLength
  13336. );
  13337. end;
  13338. // Dynamic version of NtQuerySymbolicLinkObject
  13339. function NtQuerySymbolicLinkObject(
  13340. SymbolicLinkHandle : HANDLE;
  13341. TargetName : PUNICODE_STRING;
  13342. ReturnLength : PULONG
  13343. ): NTSTATUS; stdcall;
  13344. begin
  13345. GetProcedureAddress(_NtQuerySymbolicLinkObject, ntdll, 'NtQuerySymbolicLinkObject');
  13346. Result := TFNNtQuerySymbolicLinkObject(_NtQuerySymbolicLinkObject)(
  13347. SymbolicLinkHandle, TargetName, ReturnLength
  13348. );
  13349. end;
  13350. // Dynamic version of NtQuerySymbolicLinkObject
  13351. function ZwQuerySymbolicLinkObject(
  13352. SymbolicLinkHandle : HANDLE;
  13353. TargetName : PUNICODE_STRING;
  13354. ReturnLength : PULONG
  13355. ): NTSTATUS; stdcall;
  13356. begin
  13357. GetProcedureAddress(_NtQuerySymbolicLinkObject, ntdll, 'NtQuerySymbolicLinkObject');
  13358. Result := TFNNtQuerySymbolicLinkObject(_NtQuerySymbolicLinkObject)(
  13359. SymbolicLinkHandle, TargetName, ReturnLength
  13360. );
  13361. end;
  13362. // Dynamic version of NtQuerySystemEnvironmentValue
  13363. function NtQuerySystemEnvironmentValue(
  13364. Name : PUNICODE_STRING;
  13365. Value : PVOID;
  13366. ValueLength : ULONG;
  13367. ReturnLength : PULONG
  13368. ): NTSTATUS; stdcall;
  13369. begin
  13370. GetProcedureAddress(_NtQuerySystemEnvironmentValue, ntdll, 'NtQuerySystemEnvironmentValue');
  13371. Result := TFNNtQuerySystemEnvironmentValue(_NtQuerySystemEnvironmentValue)(
  13372. Name, Value, ValueLength, ReturnLength
  13373. );
  13374. end;
  13375. // Dynamic version of NtQuerySystemEnvironmentValue
  13376. function ZwQuerySystemEnvironmentValue(
  13377. Name : PUNICODE_STRING;
  13378. Value : PVOID;
  13379. ValueLength : ULONG;
  13380. ReturnLength : PULONG
  13381. ): NTSTATUS; stdcall;
  13382. begin
  13383. GetProcedureAddress(_NtQuerySystemEnvironmentValue, ntdll, 'NtQuerySystemEnvironmentValue');
  13384. Result := TFNNtQuerySystemEnvironmentValue(_NtQuerySystemEnvironmentValue)(
  13385. Name, Value, ValueLength, ReturnLength
  13386. );
  13387. end;
  13388. {$IFNDEF JWA_INCLUDEMODE}
  13389. // Dynamic version of NtQuerySystemInformation
  13390. function NtQuerySystemInformation(
  13391. SystemInformationClass : SYSTEM_INFORMATION_CLASS;
  13392. SystemInformation : PVOID;
  13393. SystemInformationLength : ULONG;
  13394. ReturnLength : PULONG
  13395. ): NTSTATUS; stdcall;
  13396. begin
  13397. GetProcedureAddress(_NtQuerySystemInformation, ntdll, 'NtQuerySystemInformation');
  13398. Result := TFNNtQuerySystemInformation(_NtQuerySystemInformation)(
  13399. SystemInformationClass, SystemInformation, SystemInformationLength, ReturnLength
  13400. );
  13401. end;
  13402. {$ENDIF JWA_INCLUDEMODE}
  13403. // Dynamic version of NtQuerySystemInformation
  13404. function ZwQuerySystemInformation(
  13405. SystemInformationClass : SYSTEM_INFORMATION_CLASS;
  13406. SystemInformation : PVOID;
  13407. SystemInformationLength : ULONG;
  13408. ReturnLength : PULONG
  13409. ): NTSTATUS; stdcall;
  13410. begin
  13411. GetProcedureAddress(_NtQuerySystemInformation, ntdll, 'NtQuerySystemInformation');
  13412. Result := TFNNtQuerySystemInformation(_NtQuerySystemInformation)(
  13413. SystemInformationClass, SystemInformation, SystemInformationLength, ReturnLength
  13414. );
  13415. end;
  13416. {$IFNDEF JWA_INCLUDEMODE}
  13417. // Dynamic version of NtQuerySystemTime
  13418. function NtQuerySystemTime(
  13419. CurrentTime : PLARGE_INTEGER
  13420. ): NTSTATUS; stdcall;
  13421. begin
  13422. GetProcedureAddress(_NtQuerySystemTime, ntdll, 'NtQuerySystemTime');
  13423. Result := TFNNtQuerySystemTime(_NtQuerySystemTime)(
  13424. CurrentTime
  13425. );
  13426. end;
  13427. {$ENDIF JWA_INCLUDEMODE}
  13428. // Dynamic version of NtQuerySystemTime
  13429. function ZwQuerySystemTime(
  13430. CurrentTime : PLARGE_INTEGER
  13431. ): NTSTATUS; stdcall;
  13432. begin
  13433. GetProcedureAddress(_NtQuerySystemTime, ntdll, 'NtQuerySystemTime');
  13434. Result := TFNNtQuerySystemTime(_NtQuerySystemTime)(
  13435. CurrentTime
  13436. );
  13437. end;
  13438. // Dynamic version of NtQueryTimer
  13439. function NtQueryTimer(
  13440. TimerHandle : HANDLE;
  13441. TimerInformationClass : TIMER_INFORMATION_CLASS;
  13442. TimerInformation : PVOID;
  13443. TimerInformationLength : ULONG;
  13444. ResultLength : PULONG
  13445. ): NTSTATUS; stdcall;
  13446. begin
  13447. GetProcedureAddress(_NtQueryTimer, ntdll, 'NtQueryTimer');
  13448. Result := TFNNtQueryTimer(_NtQueryTimer)(
  13449. TimerHandle, TimerInformationClass, TimerInformation, TimerInformationLength, ResultLength
  13450. );
  13451. end;
  13452. // Dynamic version of NtQueryTimer
  13453. function ZwQueryTimer(
  13454. TimerHandle : HANDLE;
  13455. TimerInformationClass : TIMER_INFORMATION_CLASS;
  13456. TimerInformation : PVOID;
  13457. TimerInformationLength : ULONG;
  13458. ResultLength : PULONG
  13459. ): NTSTATUS; stdcall;
  13460. begin
  13461. GetProcedureAddress(_NtQueryTimer, ntdll, 'NtQueryTimer');
  13462. Result := TFNNtQueryTimer(_NtQueryTimer)(
  13463. TimerHandle, TimerInformationClass, TimerInformation, TimerInformationLength, ResultLength
  13464. );
  13465. end;
  13466. // Dynamic version of NtQueryTimerResolution
  13467. function NtQueryTimerResolution(
  13468. CoarsestResolution : PULONG;
  13469. FinestResolution : PULONG;
  13470. ActualResolution : PULONG
  13471. ): NTSTATUS; stdcall;
  13472. begin
  13473. GetProcedureAddress(_NtQueryTimerResolution, ntdll, 'NtQueryTimerResolution');
  13474. Result := TFNNtQueryTimerResolution(_NtQueryTimerResolution)(
  13475. CoarsestResolution, FinestResolution, ActualResolution
  13476. );
  13477. end;
  13478. // Dynamic version of NtQueryTimerResolution
  13479. function ZwQueryTimerResolution(
  13480. CoarsestResolution : PULONG;
  13481. FinestResolution : PULONG;
  13482. ActualResolution : PULONG
  13483. ): NTSTATUS; stdcall;
  13484. begin
  13485. GetProcedureAddress(_NtQueryTimerResolution, ntdll, 'NtQueryTimerResolution');
  13486. Result := TFNNtQueryTimerResolution(_NtQueryTimerResolution)(
  13487. CoarsestResolution, FinestResolution, ActualResolution
  13488. );
  13489. end;
  13490. // Dynamic version of NtQueryValueKey
  13491. function NtQueryValueKey(
  13492. KeyHandle : HANDLE;
  13493. ValueName : PUNICODE_STRING;
  13494. KeyValueInformationClass : KEY_VALUE_INFORMATION_CLASS;
  13495. KeyValueInformation : PVOID;
  13496. KeyValueInformationLength : ULONG;
  13497. ResultLength : PULONG
  13498. ): NTSTATUS; stdcall;
  13499. begin
  13500. GetProcedureAddress(_NtQueryValueKey, ntdll, 'NtQueryValueKey');
  13501. Result := TFNNtQueryValueKey(_NtQueryValueKey)(
  13502. KeyHandle, ValueName, KeyValueInformationClass, KeyValueInformation, KeyValueInformationLength, ResultLength
  13503. );
  13504. end;
  13505. // Dynamic version of NtQueryValueKey
  13506. function ZwQueryValueKey(
  13507. KeyHandle : HANDLE;
  13508. ValueName : PUNICODE_STRING;
  13509. KeyValueInformationClass : KEY_VALUE_INFORMATION_CLASS;
  13510. KeyValueInformation : PVOID;
  13511. KeyValueInformationLength : ULONG;
  13512. ResultLength : PULONG
  13513. ): NTSTATUS; stdcall;
  13514. begin
  13515. GetProcedureAddress(_NtQueryValueKey, ntdll, 'NtQueryValueKey');
  13516. Result := TFNNtQueryValueKey(_NtQueryValueKey)(
  13517. KeyHandle, ValueName, KeyValueInformationClass, KeyValueInformation, KeyValueInformationLength, ResultLength
  13518. );
  13519. end;
  13520. // Dynamic version of NtQueryVirtualMemory
  13521. function NtQueryVirtualMemory(
  13522. ProcessHandle : HANDLE;
  13523. BaseAddress : PVOID;
  13524. MemoryInformationClass : MEMORY_INFORMATION_CLASS;
  13525. MemoryInformation : PVOID;
  13526. MemoryInformationLength : ULONG;
  13527. ReturnLength : PULONG
  13528. ): NTSTATUS; stdcall;
  13529. begin
  13530. GetProcedureAddress(_NtQueryVirtualMemory, ntdll, 'NtQueryVirtualMemory');
  13531. Result := TFNNtQueryVirtualMemory(_NtQueryVirtualMemory)(
  13532. ProcessHandle, BaseAddress, MemoryInformationClass, MemoryInformation, MemoryInformationLength, ReturnLength
  13533. );
  13534. end;
  13535. // Dynamic version of NtQueryVirtualMemory
  13536. function ZwQueryVirtualMemory(
  13537. ProcessHandle : HANDLE;
  13538. BaseAddress : PVOID;
  13539. MemoryInformationClass : MEMORY_INFORMATION_CLASS;
  13540. MemoryInformation : PVOID;
  13541. MemoryInformationLength : ULONG;
  13542. ReturnLength : PULONG
  13543. ): NTSTATUS; stdcall;
  13544. begin
  13545. GetProcedureAddress(_NtQueryVirtualMemory, ntdll, 'NtQueryVirtualMemory');
  13546. Result := TFNNtQueryVirtualMemory(_NtQueryVirtualMemory)(
  13547. ProcessHandle, BaseAddress, MemoryInformationClass, MemoryInformation, MemoryInformationLength, ReturnLength
  13548. );
  13549. end;
  13550. // Dynamic version of NtQueryVolumeInformationFile
  13551. function NtQueryVolumeInformationFile(
  13552. FileHandle : HANDLE;
  13553. IoStatusBlock : PIO_STATUS_BLOCK;
  13554. VolumeInformation : PVOID;
  13555. VolumeInformationLength : ULONG;
  13556. VolumeInformationClass : FS_INFORMATION_CLASS
  13557. ): NTSTATUS; stdcall;
  13558. begin
  13559. GetProcedureAddress(_NtQueryVolumeInformationFile, ntdll, 'NtQueryVolumeInformationFile');
  13560. Result := TFNNtQueryVolumeInformationFile(_NtQueryVolumeInformationFile)(
  13561. FileHandle, IoStatusBlock, VolumeInformation, VolumeInformationLength, VolumeInformationClass
  13562. );
  13563. end;
  13564. // Dynamic version of NtQueryVolumeInformationFile
  13565. function ZwQueryVolumeInformationFile(
  13566. FileHandle : HANDLE;
  13567. IoStatusBlock : PIO_STATUS_BLOCK;
  13568. VolumeInformation : PVOID;
  13569. VolumeInformationLength : ULONG;
  13570. VolumeInformationClass : FS_INFORMATION_CLASS
  13571. ): NTSTATUS; stdcall;
  13572. begin
  13573. GetProcedureAddress(_NtQueryVolumeInformationFile, ntdll, 'NtQueryVolumeInformationFile');
  13574. Result := TFNNtQueryVolumeInformationFile(_NtQueryVolumeInformationFile)(
  13575. FileHandle, IoStatusBlock, VolumeInformation, VolumeInformationLength, VolumeInformationClass
  13576. );
  13577. end;
  13578. // Dynamic version of NtQueueApcThread
  13579. function NtQueueApcThread(
  13580. ThreadHandle : HANDLE;
  13581. ApcRoutine : PKNORMAL_ROUTINE;
  13582. ApcContext : PVOID;
  13583. Argument1 : PVOID;
  13584. Argument2 : PVOID
  13585. ): NTSTATUS; stdcall;
  13586. begin
  13587. GetProcedureAddress(_NtQueueApcThread, ntdll, 'NtQueueApcThread');
  13588. Result := TFNNtQueueApcThread(_NtQueueApcThread)(
  13589. ThreadHandle, ApcRoutine, ApcContext, Argument1, Argument2
  13590. );
  13591. end;
  13592. // Dynamic version of NtQueueApcThread
  13593. function ZwQueueApcThread(
  13594. ThreadHandle : HANDLE;
  13595. ApcRoutine : PKNORMAL_ROUTINE;
  13596. ApcContext : PVOID;
  13597. Argument1 : PVOID;
  13598. Argument2 : PVOID
  13599. ): NTSTATUS; stdcall;
  13600. begin
  13601. GetProcedureAddress(_NtQueueApcThread, ntdll, 'NtQueueApcThread');
  13602. Result := TFNNtQueueApcThread(_NtQueueApcThread)(
  13603. ThreadHandle, ApcRoutine, ApcContext, Argument1, Argument2
  13604. );
  13605. end;
  13606. // Dynamic version of NtRaiseException
  13607. function NtRaiseException(
  13608. ExceptionRecord : PEXCEPTION_RECORD;
  13609. Context : PCONTEXT;
  13610. SearchFrames : BOOLEAN
  13611. ): NTSTATUS; stdcall;
  13612. begin
  13613. GetProcedureAddress(_NtRaiseException, ntdll, 'NtRaiseException');
  13614. Result := TFNNtRaiseException(_NtRaiseException)(
  13615. ExceptionRecord, Context, SearchFrames
  13616. );
  13617. end;
  13618. // Dynamic version of NtRaiseException
  13619. function ZwRaiseException(
  13620. ExceptionRecord : PEXCEPTION_RECORD;
  13621. Context : PCONTEXT;
  13622. SearchFrames : BOOLEAN
  13623. ): NTSTATUS; stdcall;
  13624. begin
  13625. GetProcedureAddress(_NtRaiseException, ntdll, 'NtRaiseException');
  13626. Result := TFNNtRaiseException(_NtRaiseException)(
  13627. ExceptionRecord, Context, SearchFrames
  13628. );
  13629. end;
  13630. // Dynamic version of NtRaiseHardError
  13631. function NtRaiseHardError(
  13632. Status : NTSTATUS;
  13633. NumberOfArguments : ULONG;
  13634. StringArgumentsMask : ULONG;
  13635. Arguments : PULONG;
  13636. MessageBoxType : ULONG;
  13637. MessageBoxResult : PULONG
  13638. ): NTSTATUS; stdcall;
  13639. begin
  13640. GetProcedureAddress(_NtRaiseHardError, ntdll, 'NtRaiseHardError');
  13641. Result := TFNNtRaiseHardError(_NtRaiseHardError)(
  13642. Status, NumberOfArguments, StringArgumentsMask, Arguments, MessageBoxType, MessageBoxResult
  13643. );
  13644. end;
  13645. // Dynamic version of NtRaiseHardError
  13646. function ZwRaiseHardError(
  13647. Status : NTSTATUS;
  13648. NumberOfArguments : ULONG;
  13649. StringArgumentsMask : ULONG;
  13650. Arguments : PULONG;
  13651. MessageBoxType : ULONG;
  13652. MessageBoxResult : PULONG
  13653. ): NTSTATUS; stdcall;
  13654. begin
  13655. GetProcedureAddress(_NtRaiseHardError, ntdll, 'NtRaiseHardError');
  13656. Result := TFNNtRaiseHardError(_NtRaiseHardError)(
  13657. Status, NumberOfArguments, StringArgumentsMask, Arguments, MessageBoxType, MessageBoxResult
  13658. );
  13659. end;
  13660. // Dynamic version of NtReadFile
  13661. function NtReadFile(
  13662. FileHandle : HANDLE;
  13663. Event : HANDLE;
  13664. ApcRoutine : PIO_APC_ROUTINE;
  13665. ApcContext : PVOID;
  13666. IoStatusBlock : PIO_STATUS_BLOCK;
  13667. Buffer : PVOID;
  13668. Length : ULONG;
  13669. ByteOffset : PLARGE_INTEGER;
  13670. Key : PULONG
  13671. ): NTSTATUS; stdcall;
  13672. begin
  13673. GetProcedureAddress(_NtReadFile, ntdll, 'NtReadFile');
  13674. Result := TFNNtReadFile(_NtReadFile)(
  13675. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, Buffer, Length, ByteOffset, Key
  13676. );
  13677. end;
  13678. // Dynamic version of NtReadFile
  13679. function ZwReadFile(
  13680. FileHandle : HANDLE;
  13681. Event : HANDLE;
  13682. ApcRoutine : PIO_APC_ROUTINE;
  13683. ApcContext : PVOID;
  13684. IoStatusBlock : PIO_STATUS_BLOCK;
  13685. Buffer : PVOID;
  13686. Length : ULONG;
  13687. ByteOffset : PLARGE_INTEGER;
  13688. Key : PULONG
  13689. ): NTSTATUS; stdcall;
  13690. begin
  13691. GetProcedureAddress(_NtReadFile, ntdll, 'NtReadFile');
  13692. Result := TFNNtReadFile(_NtReadFile)(
  13693. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, Buffer, Length, ByteOffset, Key
  13694. );
  13695. end;
  13696. // Dynamic version of NtReadFileScatter
  13697. function NtReadFileScatter(
  13698. FileHandle : HANDLE;
  13699. Event : HANDLE;
  13700. ApcRoutine : PIO_APC_ROUTINE;
  13701. ApcContext : PVOID;
  13702. IoStatusBlock : PIO_STATUS_BLOCK;
  13703. Buffer : PFILE_SEGMENT_ELEMENT;
  13704. Length : ULONG;
  13705. ByteOffset : PLARGE_INTEGER;
  13706. Key : PULONG
  13707. ): NTSTATUS; stdcall;
  13708. begin
  13709. GetProcedureAddress(_NtReadFileScatter, ntdll, 'NtReadFileScatter');
  13710. Result := TFNNtReadFileScatter(_NtReadFileScatter)(
  13711. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, Buffer, Length, ByteOffset, Key
  13712. );
  13713. end;
  13714. // Dynamic version of NtReadFileScatter
  13715. function ZwReadFileScatter(
  13716. FileHandle : HANDLE;
  13717. Event : HANDLE;
  13718. ApcRoutine : PIO_APC_ROUTINE;
  13719. ApcContext : PVOID;
  13720. IoStatusBlock : PIO_STATUS_BLOCK;
  13721. Buffer : PFILE_SEGMENT_ELEMENT;
  13722. Length : ULONG;
  13723. ByteOffset : PLARGE_INTEGER;
  13724. Key : PULONG
  13725. ): NTSTATUS; stdcall;
  13726. begin
  13727. GetProcedureAddress(_NtReadFileScatter, ntdll, 'NtReadFileScatter');
  13728. Result := TFNNtReadFileScatter(_NtReadFileScatter)(
  13729. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, Buffer, Length, ByteOffset, Key
  13730. );
  13731. end;
  13732. // Dynamic version of NtReadRequestData
  13733. function NtReadRequestData(
  13734. PortHandle : HANDLE;
  13735. Message : PPORT_MESSAGE;
  13736. Index : ULONG;
  13737. Buffer : PVOID;
  13738. BufferLength : ULONG;
  13739. ReturnLength : PULONG
  13740. ): NTSTATUS; stdcall;
  13741. begin
  13742. GetProcedureAddress(_NtReadRequestData, ntdll, 'NtReadRequestData');
  13743. Result := TFNNtReadRequestData(_NtReadRequestData)(
  13744. PortHandle, Message, Index, Buffer, BufferLength, ReturnLength
  13745. );
  13746. end;
  13747. // Dynamic version of NtReadRequestData
  13748. function ZwReadRequestData(
  13749. PortHandle : HANDLE;
  13750. Message : PPORT_MESSAGE;
  13751. Index : ULONG;
  13752. Buffer : PVOID;
  13753. BufferLength : ULONG;
  13754. ReturnLength : PULONG
  13755. ): NTSTATUS; stdcall;
  13756. begin
  13757. GetProcedureAddress(_NtReadRequestData, ntdll, 'NtReadRequestData');
  13758. Result := TFNNtReadRequestData(_NtReadRequestData)(
  13759. PortHandle, Message, Index, Buffer, BufferLength, ReturnLength
  13760. );
  13761. end;
  13762. // Dynamic version of NtReadVirtualMemory
  13763. function NtReadVirtualMemory(
  13764. ProcessHandle : HANDLE;
  13765. BaseAddress : PVOID;
  13766. Buffer : PVOID;
  13767. BufferLength : ULONG;
  13768. ReturnLength : PULONG
  13769. ): NTSTATUS; stdcall;
  13770. begin
  13771. GetProcedureAddress(_NtReadVirtualMemory, ntdll, 'NtReadVirtualMemory');
  13772. Result := TFNNtReadVirtualMemory(_NtReadVirtualMemory)(
  13773. ProcessHandle, BaseAddress, Buffer, BufferLength, ReturnLength
  13774. );
  13775. end;
  13776. // Dynamic version of NtReadVirtualMemory
  13777. function ZwReadVirtualMemory(
  13778. ProcessHandle : HANDLE;
  13779. BaseAddress : PVOID;
  13780. Buffer : PVOID;
  13781. BufferLength : ULONG;
  13782. ReturnLength : PULONG
  13783. ): NTSTATUS; stdcall;
  13784. begin
  13785. GetProcedureAddress(_NtReadVirtualMemory, ntdll, 'NtReadVirtualMemory');
  13786. Result := TFNNtReadVirtualMemory(_NtReadVirtualMemory)(
  13787. ProcessHandle, BaseAddress, Buffer, BufferLength, ReturnLength
  13788. );
  13789. end;
  13790. // Dynamic version of NtRegisterThreadTerminatePort
  13791. function NtRegisterThreadTerminatePort(
  13792. PortHandle : HANDLE
  13793. ): NTSTATUS; stdcall;
  13794. begin
  13795. GetProcedureAddress(_NtRegisterThreadTerminatePort, ntdll, 'NtRegisterThreadTerminatePort');
  13796. Result := TFNNtRegisterThreadTerminatePort(_NtRegisterThreadTerminatePort)(
  13797. PortHandle
  13798. );
  13799. end;
  13800. // Dynamic version of NtRegisterThreadTerminatePort
  13801. function ZwRegisterThreadTerminatePort(
  13802. PortHandle : HANDLE
  13803. ): NTSTATUS; stdcall;
  13804. begin
  13805. GetProcedureAddress(_NtRegisterThreadTerminatePort, ntdll, 'NtRegisterThreadTerminatePort');
  13806. Result := TFNNtRegisterThreadTerminatePort(_NtRegisterThreadTerminatePort)(
  13807. PortHandle
  13808. );
  13809. end;
  13810. // Dynamic version of NtReleaseMutant
  13811. function NtReleaseMutant(
  13812. MutantHandle : HANDLE;
  13813. PreviousState : PULONG
  13814. ): NTSTATUS; stdcall;
  13815. begin
  13816. GetProcedureAddress(_NtReleaseMutant, ntdll, 'NtReleaseMutant');
  13817. Result := TFNNtReleaseMutant(_NtReleaseMutant)(
  13818. MutantHandle, PreviousState
  13819. );
  13820. end;
  13821. // Dynamic version of NtReleaseMutant
  13822. function ZwReleaseMutant(
  13823. MutantHandle : HANDLE;
  13824. PreviousState : PULONG
  13825. ): NTSTATUS; stdcall;
  13826. begin
  13827. GetProcedureAddress(_NtReleaseMutant, ntdll, 'NtReleaseMutant');
  13828. Result := TFNNtReleaseMutant(_NtReleaseMutant)(
  13829. MutantHandle, PreviousState
  13830. );
  13831. end;
  13832. // Dynamic version of NtReleaseSemaphore
  13833. function NtReleaseSemaphore(
  13834. SemaphoreHandle : HANDLE;
  13835. ReleaseCount : LONG;
  13836. PreviousCount : PLONG
  13837. ): NTSTATUS; stdcall;
  13838. begin
  13839. GetProcedureAddress(_NtReleaseSemaphore, ntdll, 'NtReleaseSemaphore');
  13840. Result := TFNNtReleaseSemaphore(_NtReleaseSemaphore)(
  13841. SemaphoreHandle, ReleaseCount, PreviousCount
  13842. );
  13843. end;
  13844. // Dynamic version of NtReleaseSemaphore
  13845. function ZwReleaseSemaphore(
  13846. SemaphoreHandle : HANDLE;
  13847. ReleaseCount : LONG;
  13848. PreviousCount : PLONG
  13849. ): NTSTATUS; stdcall;
  13850. begin
  13851. GetProcedureAddress(_NtReleaseSemaphore, ntdll, 'NtReleaseSemaphore');
  13852. Result := TFNNtReleaseSemaphore(_NtReleaseSemaphore)(
  13853. SemaphoreHandle, ReleaseCount, PreviousCount
  13854. );
  13855. end;
  13856. // Dynamic version of NtRemoveIoCompletion
  13857. function NtRemoveIoCompletion(
  13858. IoCompletionHandle : HANDLE;
  13859. CompletionKey : PULONG;
  13860. CompletionValue : PULONG;
  13861. IoStatusBlock : PIO_STATUS_BLOCK;
  13862. Timeout : PLARGE_INTEGER
  13863. ): NTSTATUS; stdcall;
  13864. begin
  13865. GetProcedureAddress(_NtRemoveIoCompletion, ntdll, 'NtRemoveIoCompletion');
  13866. Result := TFNNtRemoveIoCompletion(_NtRemoveIoCompletion)(
  13867. IoCompletionHandle, CompletionKey, CompletionValue, IoStatusBlock, Timeout
  13868. );
  13869. end;
  13870. // Dynamic version of NtRemoveIoCompletion
  13871. function ZwRemoveIoCompletion(
  13872. IoCompletionHandle : HANDLE;
  13873. CompletionKey : PULONG;
  13874. CompletionValue : PULONG;
  13875. IoStatusBlock : PIO_STATUS_BLOCK;
  13876. Timeout : PLARGE_INTEGER
  13877. ): NTSTATUS; stdcall;
  13878. begin
  13879. GetProcedureAddress(_NtRemoveIoCompletion, ntdll, 'NtRemoveIoCompletion');
  13880. Result := TFNNtRemoveIoCompletion(_NtRemoveIoCompletion)(
  13881. IoCompletionHandle, CompletionKey, CompletionValue, IoStatusBlock, Timeout
  13882. );
  13883. end;
  13884. // Dynamic version of NtRemoveProcessDebug
  13885. function NtRemoveProcessDebug(
  13886. hProcess : HANDLE;
  13887. hDebugObject : HANDLE
  13888. ): NTSTATUS; stdcall;
  13889. begin
  13890. GetProcedureAddress(_NtRemoveProcessDebug, ntdll, 'NtRemoveProcessDebug');
  13891. Result := TFNNtRemoveProcessDebug(_NtRemoveProcessDebug)(
  13892. hProcess, hDebugObject
  13893. );
  13894. end;
  13895. // Dynamic version of NtRemoveProcessDebug
  13896. function ZwRemoveProcessDebug(
  13897. hProcess : HANDLE;
  13898. hDebugObject : HANDLE
  13899. ): NTSTATUS; stdcall;
  13900. begin
  13901. GetProcedureAddress(_NtRemoveProcessDebug, ntdll, 'NtRemoveProcessDebug');
  13902. Result := TFNNtRemoveProcessDebug(_NtRemoveProcessDebug)(
  13903. hProcess, hDebugObject
  13904. );
  13905. end;
  13906. // Dynamic version of NtReplaceKey
  13907. function NtReplaceKey(
  13908. NewFileObjectAttributes : POBJECT_ATTRIBUTES;
  13909. KeyHandle : HANDLE;
  13910. OldFileObjectAttributes : POBJECT_ATTRIBUTES
  13911. ): NTSTATUS; stdcall;
  13912. begin
  13913. GetProcedureAddress(_NtReplaceKey, ntdll, 'NtReplaceKey');
  13914. Result := TFNNtReplaceKey(_NtReplaceKey)(
  13915. NewFileObjectAttributes, KeyHandle, OldFileObjectAttributes
  13916. );
  13917. end;
  13918. // Dynamic version of NtReplaceKey
  13919. function ZwReplaceKey(
  13920. NewFileObjectAttributes : POBJECT_ATTRIBUTES;
  13921. KeyHandle : HANDLE;
  13922. OldFileObjectAttributes : POBJECT_ATTRIBUTES
  13923. ): NTSTATUS; stdcall;
  13924. begin
  13925. GetProcedureAddress(_NtReplaceKey, ntdll, 'NtReplaceKey');
  13926. Result := TFNNtReplaceKey(_NtReplaceKey)(
  13927. NewFileObjectAttributes, KeyHandle, OldFileObjectAttributes
  13928. );
  13929. end;
  13930. // Dynamic version of NtReplyPort
  13931. function NtReplyPort(
  13932. PortHandle : HANDLE;
  13933. ReplyMessage : PPORT_MESSAGE
  13934. ): NTSTATUS; stdcall;
  13935. begin
  13936. GetProcedureAddress(_NtReplyPort, ntdll, 'NtReplyPort');
  13937. Result := TFNNtReplyPort(_NtReplyPort)(
  13938. PortHandle, ReplyMessage
  13939. );
  13940. end;
  13941. // Dynamic version of NtReplyPort
  13942. function ZwReplyPort(
  13943. PortHandle : HANDLE;
  13944. ReplyMessage : PPORT_MESSAGE
  13945. ): NTSTATUS; stdcall;
  13946. begin
  13947. GetProcedureAddress(_NtReplyPort, ntdll, 'NtReplyPort');
  13948. Result := TFNNtReplyPort(_NtReplyPort)(
  13949. PortHandle, ReplyMessage
  13950. );
  13951. end;
  13952. // Dynamic version of NtReplyWaitReceivePort
  13953. function NtReplyWaitReceivePort(
  13954. PortHandle : HANDLE;
  13955. PortIdentifier : PULONG;
  13956. ReplyMessage : PPORT_MESSAGE;
  13957. Message : PPORT_MESSAGE
  13958. ): NTSTATUS; stdcall;
  13959. begin
  13960. GetProcedureAddress(_NtReplyWaitReceivePort, ntdll, 'NtReplyWaitReceivePort');
  13961. Result := TFNNtReplyWaitReceivePort(_NtReplyWaitReceivePort)(
  13962. PortHandle, PortIdentifier, ReplyMessage, Message
  13963. );
  13964. end;
  13965. // Dynamic version of NtReplyWaitReceivePort
  13966. function ZwReplyWaitReceivePort(
  13967. PortHandle : HANDLE;
  13968. PortIdentifier : PULONG;
  13969. ReplyMessage : PPORT_MESSAGE;
  13970. Message : PPORT_MESSAGE
  13971. ): NTSTATUS; stdcall;
  13972. begin
  13973. GetProcedureAddress(_NtReplyWaitReceivePort, ntdll, 'NtReplyWaitReceivePort');
  13974. Result := TFNNtReplyWaitReceivePort(_NtReplyWaitReceivePort)(
  13975. PortHandle, PortIdentifier, ReplyMessage, Message
  13976. );
  13977. end;
  13978. // Dynamic version of NtReplyWaitReceivePortEx
  13979. function NtReplyWaitReceivePortEx(
  13980. PortHandle : HANDLE;
  13981. PortIdentifier : PULONG;
  13982. ReplyMessage : PPORT_MESSAGE;
  13983. Message : PPORT_MESSAGE;
  13984. Timeout : PLARGE_INTEGER
  13985. ): NTSTATUS; stdcall;
  13986. begin
  13987. GetProcedureAddress(_NtReplyWaitReceivePortEx, ntdll, 'NtReplyWaitReceivePortEx');
  13988. Result := TFNNtReplyWaitReceivePortEx(_NtReplyWaitReceivePortEx)(
  13989. PortHandle, PortIdentifier, ReplyMessage, Message, Timeout
  13990. );
  13991. end;
  13992. // Dynamic version of NtReplyWaitReceivePortEx
  13993. function ZwReplyWaitReceivePortEx(
  13994. PortHandle : HANDLE;
  13995. PortIdentifier : PULONG;
  13996. ReplyMessage : PPORT_MESSAGE;
  13997. Message : PPORT_MESSAGE;
  13998. Timeout : PLARGE_INTEGER
  13999. ): NTSTATUS; stdcall;
  14000. begin
  14001. GetProcedureAddress(_NtReplyWaitReceivePortEx, ntdll, 'NtReplyWaitReceivePortEx');
  14002. Result := TFNNtReplyWaitReceivePortEx(_NtReplyWaitReceivePortEx)(
  14003. PortHandle, PortIdentifier, ReplyMessage, Message, Timeout
  14004. );
  14005. end;
  14006. // Dynamic version of NtReplyWaitReplyPort
  14007. function NtReplyWaitReplyPort(
  14008. PortHandle : HANDLE;
  14009. ReplyMessage : PPORT_MESSAGE
  14010. ): NTSTATUS; stdcall;
  14011. begin
  14012. GetProcedureAddress(_NtReplyWaitReplyPort, ntdll, 'NtReplyWaitReplyPort');
  14013. Result := TFNNtReplyWaitReplyPort(_NtReplyWaitReplyPort)(
  14014. PortHandle, ReplyMessage
  14015. );
  14016. end;
  14017. // Dynamic version of NtReplyWaitReplyPort
  14018. function ZwReplyWaitReplyPort(
  14019. PortHandle : HANDLE;
  14020. ReplyMessage : PPORT_MESSAGE
  14021. ): NTSTATUS; stdcall;
  14022. begin
  14023. GetProcedureAddress(_NtReplyWaitReplyPort, ntdll, 'NtReplyWaitReplyPort');
  14024. Result := TFNNtReplyWaitReplyPort(_NtReplyWaitReplyPort)(
  14025. PortHandle, ReplyMessage
  14026. );
  14027. end;
  14028. // Dynamic version of NtReplyWaitSendChannel
  14029. function NtReplyWaitSendChannel(
  14030. x : PVOID;
  14031. y : PVOID;
  14032. z : PVOID
  14033. ): NTSTATUS; stdcall;
  14034. begin
  14035. GetProcedureAddress(_NtReplyWaitSendChannel, ntdll, 'NtReplyWaitSendChannel');
  14036. Result := TFNNtReplyWaitSendChannel(_NtReplyWaitSendChannel)(
  14037. x, y, z
  14038. );
  14039. end;
  14040. // Dynamic version of NtReplyWaitSendChannel
  14041. function ZwReplyWaitSendChannel(
  14042. x : PVOID;
  14043. y : PVOID;
  14044. z : PVOID
  14045. ): NTSTATUS; stdcall;
  14046. begin
  14047. GetProcedureAddress(_NtReplyWaitSendChannel, ntdll, 'NtReplyWaitSendChannel');
  14048. Result := TFNNtReplyWaitSendChannel(_NtReplyWaitSendChannel)(
  14049. x, y, z
  14050. );
  14051. end;
  14052. // Dynamic version of NtRequestDeviceWakeup
  14053. function NtRequestDeviceWakeup(
  14054. DeviceHandle : HANDLE
  14055. ): NTSTATUS; stdcall;
  14056. begin
  14057. GetProcedureAddress(_NtRequestDeviceWakeup, ntdll, 'NtRequestDeviceWakeup');
  14058. Result := TFNNtRequestDeviceWakeup(_NtRequestDeviceWakeup)(
  14059. DeviceHandle
  14060. );
  14061. end;
  14062. // Dynamic version of NtRequestDeviceWakeup
  14063. function ZwRequestDeviceWakeup(
  14064. DeviceHandle : HANDLE
  14065. ): NTSTATUS; stdcall;
  14066. begin
  14067. GetProcedureAddress(_NtRequestDeviceWakeup, ntdll, 'NtRequestDeviceWakeup');
  14068. Result := TFNNtRequestDeviceWakeup(_NtRequestDeviceWakeup)(
  14069. DeviceHandle
  14070. );
  14071. end;
  14072. // Dynamic version of NtRequestPort
  14073. function NtRequestPort(
  14074. PortHandle : HANDLE;
  14075. RequestMessage : PPORT_MESSAGE
  14076. ): NTSTATUS; stdcall;
  14077. begin
  14078. GetProcedureAddress(_NtRequestPort, ntdll, 'NtRequestPort');
  14079. Result := TFNNtRequestPort(_NtRequestPort)(
  14080. PortHandle, RequestMessage
  14081. );
  14082. end;
  14083. // Dynamic version of NtRequestPort
  14084. function ZwRequestPort(
  14085. PortHandle : HANDLE;
  14086. RequestMessage : PPORT_MESSAGE
  14087. ): NTSTATUS; stdcall;
  14088. begin
  14089. GetProcedureAddress(_NtRequestPort, ntdll, 'NtRequestPort');
  14090. Result := TFNNtRequestPort(_NtRequestPort)(
  14091. PortHandle, RequestMessage
  14092. );
  14093. end;
  14094. // Dynamic version of NtRequestWaitReplyPort
  14095. function NtRequestWaitReplyPort(
  14096. PortHandle : HANDLE;
  14097. RequestMessage : PPORT_MESSAGE;
  14098. ReplyMessage : PPORT_MESSAGE
  14099. ): NTSTATUS; stdcall;
  14100. begin
  14101. GetProcedureAddress(_NtRequestWaitReplyPort, ntdll, 'NtRequestWaitReplyPort');
  14102. Result := TFNNtRequestWaitReplyPort(_NtRequestWaitReplyPort)(
  14103. PortHandle, RequestMessage, ReplyMessage
  14104. );
  14105. end;
  14106. // Dynamic version of NtRequestWaitReplyPort
  14107. function ZwRequestWaitReplyPort(
  14108. PortHandle : HANDLE;
  14109. RequestMessage : PPORT_MESSAGE;
  14110. ReplyMessage : PPORT_MESSAGE
  14111. ): NTSTATUS; stdcall;
  14112. begin
  14113. GetProcedureAddress(_NtRequestWaitReplyPort, ntdll, 'NtRequestWaitReplyPort');
  14114. Result := TFNNtRequestWaitReplyPort(_NtRequestWaitReplyPort)(
  14115. PortHandle, RequestMessage, ReplyMessage
  14116. );
  14117. end;
  14118. // Dynamic version of NtRequestWakeupLatency
  14119. function NtRequestWakeupLatency(
  14120. Latency : LATENCY_TIME
  14121. ): NTSTATUS; stdcall;
  14122. begin
  14123. GetProcedureAddress(_NtRequestWakeupLatency, ntdll, 'NtRequestWakeupLatency');
  14124. Result := TFNNtRequestWakeupLatency(_NtRequestWakeupLatency)(
  14125. Latency
  14126. );
  14127. end;
  14128. // Dynamic version of NtRequestWakeupLatency
  14129. function ZwRequestWakeupLatency(
  14130. Latency : LATENCY_TIME
  14131. ): NTSTATUS; stdcall;
  14132. begin
  14133. GetProcedureAddress(_NtRequestWakeupLatency, ntdll, 'NtRequestWakeupLatency');
  14134. Result := TFNNtRequestWakeupLatency(_NtRequestWakeupLatency)(
  14135. Latency
  14136. );
  14137. end;
  14138. // Dynamic version of NtResetEvent
  14139. function NtResetEvent(
  14140. EventHandle : HANDLE;
  14141. PreviousState : PULONG
  14142. ): NTSTATUS; stdcall;
  14143. begin
  14144. GetProcedureAddress(_NtResetEvent, ntdll, 'NtResetEvent');
  14145. Result := TFNNtResetEvent(_NtResetEvent)(
  14146. EventHandle, PreviousState
  14147. );
  14148. end;
  14149. // Dynamic version of NtResetEvent
  14150. function ZwResetEvent(
  14151. EventHandle : HANDLE;
  14152. PreviousState : PULONG
  14153. ): NTSTATUS; stdcall;
  14154. begin
  14155. GetProcedureAddress(_NtResetEvent, ntdll, 'NtResetEvent');
  14156. Result := TFNNtResetEvent(_NtResetEvent)(
  14157. EventHandle, PreviousState
  14158. );
  14159. end;
  14160. // Dynamic version of NtResetWriteWatch
  14161. function NtResetWriteWatch(
  14162. ProcessHandle : HANDLE;
  14163. BaseAddress : PVOID;
  14164. RegionSize : ULONG
  14165. ): NTSTATUS; stdcall;
  14166. begin
  14167. GetProcedureAddress(_NtResetWriteWatch, ntdll, 'NtResetWriteWatch');
  14168. Result := TFNNtResetWriteWatch(_NtResetWriteWatch)(
  14169. ProcessHandle, BaseAddress, RegionSize
  14170. );
  14171. end;
  14172. // Dynamic version of NtResetWriteWatch
  14173. function ZwResetWriteWatch(
  14174. ProcessHandle : HANDLE;
  14175. BaseAddress : PVOID;
  14176. RegionSize : ULONG
  14177. ): NTSTATUS; stdcall;
  14178. begin
  14179. GetProcedureAddress(_NtResetWriteWatch, ntdll, 'NtResetWriteWatch');
  14180. Result := TFNNtResetWriteWatch(_NtResetWriteWatch)(
  14181. ProcessHandle, BaseAddress, RegionSize
  14182. );
  14183. end;
  14184. // Dynamic version of NtRestoreKey
  14185. function NtRestoreKey(
  14186. KeyHandle : HANDLE;
  14187. FileHandle : HANDLE;
  14188. Flags : ULONG
  14189. ): NTSTATUS; stdcall;
  14190. begin
  14191. GetProcedureAddress(_NtRestoreKey, ntdll, 'NtRestoreKey');
  14192. Result := TFNNtRestoreKey(_NtRestoreKey)(
  14193. KeyHandle, FileHandle, Flags
  14194. );
  14195. end;
  14196. // Dynamic version of NtRestoreKey
  14197. function ZwRestoreKey(
  14198. KeyHandle : HANDLE;
  14199. FileHandle : HANDLE;
  14200. Flags : ULONG
  14201. ): NTSTATUS; stdcall;
  14202. begin
  14203. GetProcedureAddress(_NtRestoreKey, ntdll, 'NtRestoreKey');
  14204. Result := TFNNtRestoreKey(_NtRestoreKey)(
  14205. KeyHandle, FileHandle, Flags
  14206. );
  14207. end;
  14208. // Dynamic version of NtResumeProcess
  14209. function NtResumeProcess(
  14210. hProcess : HANDLE
  14211. ): NTSTATUS; stdcall;
  14212. begin
  14213. GetProcedureAddress(_NtResumeProcess, ntdll, 'NtResumeProcess');
  14214. Result := TFNNtResumeProcess(_NtResumeProcess)(
  14215. hProcess
  14216. );
  14217. end;
  14218. // Dynamic version of NtResumeProcess
  14219. function ZwResumeProcess(
  14220. hProcess : HANDLE
  14221. ): NTSTATUS; stdcall;
  14222. begin
  14223. GetProcedureAddress(_NtResumeProcess, ntdll, 'NtResumeProcess');
  14224. Result := TFNNtResumeProcess(_NtResumeProcess)(
  14225. hProcess
  14226. );
  14227. end;
  14228. // Dynamic version of NtResumeThread
  14229. function NtResumeThread(
  14230. hThread : HANDLE;
  14231. dwResumeCount : PULONG
  14232. ): NTSTATUS; stdcall;
  14233. begin
  14234. GetProcedureAddress(_NtResumeThread, ntdll, 'NtResumeThread');
  14235. Result := TFNNtResumeThread(_NtResumeThread)(
  14236. hThread, dwResumeCount
  14237. );
  14238. end;
  14239. // Dynamic version of NtResumeThread
  14240. function ZwResumeThread(
  14241. hThread : HANDLE;
  14242. dwResumeCount : PULONG
  14243. ): NTSTATUS; stdcall;
  14244. begin
  14245. GetProcedureAddress(_NtResumeThread, ntdll, 'NtResumeThread');
  14246. Result := TFNNtResumeThread(_NtResumeThread)(
  14247. hThread, dwResumeCount
  14248. );
  14249. end;
  14250. // Dynamic version of NtSaveKey
  14251. function NtSaveKey(
  14252. KeyHandle : HANDLE;
  14253. FileHandle : HANDLE
  14254. ): NTSTATUS; stdcall;
  14255. begin
  14256. GetProcedureAddress(_NtSaveKey, ntdll, 'NtSaveKey');
  14257. Result := TFNNtSaveKey(_NtSaveKey)(
  14258. KeyHandle, FileHandle
  14259. );
  14260. end;
  14261. // Dynamic version of NtSaveKey
  14262. function ZwSaveKey(
  14263. KeyHandle : HANDLE;
  14264. FileHandle : HANDLE
  14265. ): NTSTATUS; stdcall;
  14266. begin
  14267. GetProcedureAddress(_NtSaveKey, ntdll, 'NtSaveKey');
  14268. Result := TFNNtSaveKey(_NtSaveKey)(
  14269. KeyHandle, FileHandle
  14270. );
  14271. end;
  14272. // Dynamic version of NtSaveKeyEx
  14273. function NtSaveKeyEx(
  14274. KeyHandle : HANDLE;
  14275. FileHandle : HANDLE;
  14276. Flags : DWORD
  14277. ): NTSTATUS; stdcall;
  14278. begin
  14279. GetProcedureAddress(_NtSaveKeyEx, ntdll, 'NtSaveKeyEx');
  14280. Result := TFNNtSaveKeyEx(_NtSaveKeyEx)(
  14281. KeyHandle, FileHandle, Flags
  14282. );
  14283. end;
  14284. // Dynamic version of NtSaveKeyEx
  14285. function ZwSaveKeyEx(
  14286. KeyHandle : HANDLE;
  14287. FileHandle : HANDLE;
  14288. Flags : DWORD
  14289. ): NTSTATUS; stdcall;
  14290. begin
  14291. GetProcedureAddress(_NtSaveKeyEx, ntdll, 'NtSaveKeyEx');
  14292. Result := TFNNtSaveKeyEx(_NtSaveKeyEx)(
  14293. KeyHandle, FileHandle, Flags
  14294. );
  14295. end;
  14296. // Dynamic version of NtSaveMergedKeys
  14297. function NtSaveMergedKeys(
  14298. KeyHandle1 : HANDLE;
  14299. KeyHandle2 : HANDLE;
  14300. FileHandle : HANDLE
  14301. ): NTSTATUS; stdcall;
  14302. begin
  14303. GetProcedureAddress(_NtSaveMergedKeys, ntdll, 'NtSaveMergedKeys');
  14304. Result := TFNNtSaveMergedKeys(_NtSaveMergedKeys)(
  14305. KeyHandle1, KeyHandle2, FileHandle
  14306. );
  14307. end;
  14308. // Dynamic version of NtSaveMergedKeys
  14309. function ZwSaveMergedKeys(
  14310. KeyHandle1 : HANDLE;
  14311. KeyHandle2 : HANDLE;
  14312. FileHandle : HANDLE
  14313. ): NTSTATUS; stdcall;
  14314. begin
  14315. GetProcedureAddress(_NtSaveMergedKeys, ntdll, 'NtSaveMergedKeys');
  14316. Result := TFNNtSaveMergedKeys(_NtSaveMergedKeys)(
  14317. KeyHandle1, KeyHandle2, FileHandle
  14318. );
  14319. end;
  14320. // Dynamic version of NtSecureConnectPort
  14321. function NtSecureConnectPort(
  14322. PortHandle : PHANDLE;
  14323. PortName : PUNICODE_STRING;
  14324. SecurityQos : PSECURITY_QUALITY_OF_SERVICE;
  14325. WriteSection : PPORT_SECTION_WRITE;
  14326. ServerSid : PSID;
  14327. ReadSection : PPORT_SECTION_READ;
  14328. MaxMessageSize : PULONG;
  14329. ConnectData : PVOID;
  14330. ConnectDataLength : PULONG
  14331. ): NTSTATUS; stdcall;
  14332. begin
  14333. GetProcedureAddress(_NtSecureConnectPort, ntdll, 'NtSecureConnectPort');
  14334. Result := TFNNtSecureConnectPort(_NtSecureConnectPort)(
  14335. PortHandle, PortName, SecurityQos, WriteSection, ServerSid, ReadSection, MaxMessageSize, ConnectData, ConnectDataLength
  14336. );
  14337. end;
  14338. // Dynamic version of NtSecureConnectPort
  14339. function ZwSecureConnectPort(
  14340. PortHandle : PHANDLE;
  14341. PortName : PUNICODE_STRING;
  14342. SecurityQos : PSECURITY_QUALITY_OF_SERVICE;
  14343. WriteSection : PPORT_SECTION_WRITE;
  14344. ServerSid : PSID;
  14345. ReadSection : PPORT_SECTION_READ;
  14346. MaxMessageSize : PULONG;
  14347. ConnectData : PVOID;
  14348. ConnectDataLength : PULONG
  14349. ): NTSTATUS; stdcall;
  14350. begin
  14351. GetProcedureAddress(_NtSecureConnectPort, ntdll, 'NtSecureConnectPort');
  14352. Result := TFNNtSecureConnectPort(_NtSecureConnectPort)(
  14353. PortHandle, PortName, SecurityQos, WriteSection, ServerSid, ReadSection, MaxMessageSize, ConnectData, ConnectDataLength
  14354. );
  14355. end;
  14356. // Dynamic version of NtSendWaitReplyChannel
  14357. function NtSendWaitReplyChannel(
  14358. x : PVOID;
  14359. y : PVOID;
  14360. z : PVOID;
  14361. z2 : PVOID
  14362. ): NTSTATUS; stdcall;
  14363. begin
  14364. GetProcedureAddress(_NtSendWaitReplyChannel, ntdll, 'NtSendWaitReplyChannel');
  14365. Result := TFNNtSendWaitReplyChannel(_NtSendWaitReplyChannel)(
  14366. x, y, z, z2
  14367. );
  14368. end;
  14369. // Dynamic version of NtSendWaitReplyChannel
  14370. function ZwSendWaitReplyChannel(
  14371. x : PVOID;
  14372. y : PVOID;
  14373. z : PVOID;
  14374. z2 : PVOID
  14375. ): NTSTATUS; stdcall;
  14376. begin
  14377. GetProcedureAddress(_NtSendWaitReplyChannel, ntdll, 'NtSendWaitReplyChannel');
  14378. Result := TFNNtSendWaitReplyChannel(_NtSendWaitReplyChannel)(
  14379. x, y, z, z2
  14380. );
  14381. end;
  14382. // Dynamic version of NtSetContextChannel
  14383. function NtSetContextChannel(
  14384. x : PVOID
  14385. ): NTSTATUS; stdcall;
  14386. begin
  14387. GetProcedureAddress(_NtSetContextChannel, ntdll, 'NtSetContextChannel');
  14388. Result := TFNNtSetContextChannel(_NtSetContextChannel)(
  14389. x
  14390. );
  14391. end;
  14392. // Dynamic version of NtSetContextChannel
  14393. function ZwSetContextChannel(
  14394. x : PVOID
  14395. ): NTSTATUS; stdcall;
  14396. begin
  14397. GetProcedureAddress(_NtSetContextChannel, ntdll, 'NtSetContextChannel');
  14398. Result := TFNNtSetContextChannel(_NtSetContextChannel)(
  14399. x
  14400. );
  14401. end;
  14402. // Dynamic version of NtSetContextThread
  14403. function NtSetContextThread(
  14404. ThreadHandle : HANDLE;
  14405. Context : PCONTEXT
  14406. ): NTSTATUS; stdcall;
  14407. begin
  14408. GetProcedureAddress(_NtSetContextThread, ntdll, 'NtSetContextThread');
  14409. Result := TFNNtSetContextThread(_NtSetContextThread)(
  14410. ThreadHandle, Context
  14411. );
  14412. end;
  14413. // Dynamic version of NtSetContextThread
  14414. function ZwSetContextThread(
  14415. ThreadHandle : HANDLE;
  14416. Context : PCONTEXT
  14417. ): NTSTATUS; stdcall;
  14418. begin
  14419. GetProcedureAddress(_NtSetContextThread, ntdll, 'NtSetContextThread');
  14420. Result := TFNNtSetContextThread(_NtSetContextThread)(
  14421. ThreadHandle, Context
  14422. );
  14423. end;
  14424. // Dynamic version of NtSetDefaultHardErrorPort
  14425. function NtSetDefaultHardErrorPort(
  14426. PortHandle : HANDLE
  14427. ): NTSTATUS; stdcall;
  14428. begin
  14429. GetProcedureAddress(_NtSetDefaultHardErrorPort, ntdll, 'NtSetDefaultHardErrorPort');
  14430. Result := TFNNtSetDefaultHardErrorPort(_NtSetDefaultHardErrorPort)(
  14431. PortHandle
  14432. );
  14433. end;
  14434. // Dynamic version of NtSetDefaultHardErrorPort
  14435. function ZwSetDefaultHardErrorPort(
  14436. PortHandle : HANDLE
  14437. ): NTSTATUS; stdcall;
  14438. begin
  14439. GetProcedureAddress(_NtSetDefaultHardErrorPort, ntdll, 'NtSetDefaultHardErrorPort');
  14440. Result := TFNNtSetDefaultHardErrorPort(_NtSetDefaultHardErrorPort)(
  14441. PortHandle
  14442. );
  14443. end;
  14444. // Dynamic version of NtSetDefaultLocale
  14445. function NtSetDefaultLocale(
  14446. ThreadOrSystem : BOOLEAN;
  14447. Locale : LCID
  14448. ): NTSTATUS; stdcall;
  14449. begin
  14450. GetProcedureAddress(_NtSetDefaultLocale, ntdll, 'NtSetDefaultLocale');
  14451. Result := TFNNtSetDefaultLocale(_NtSetDefaultLocale)(
  14452. ThreadOrSystem, Locale
  14453. );
  14454. end;
  14455. // Dynamic version of NtSetDefaultLocale
  14456. function ZwSetDefaultLocale(
  14457. ThreadOrSystem : BOOLEAN;
  14458. Locale : LCID
  14459. ): NTSTATUS; stdcall;
  14460. begin
  14461. GetProcedureAddress(_NtSetDefaultLocale, ntdll, 'NtSetDefaultLocale');
  14462. Result := TFNNtSetDefaultLocale(_NtSetDefaultLocale)(
  14463. ThreadOrSystem, Locale
  14464. );
  14465. end;
  14466. // Dynamic version of NtSetDefaultUILanguage
  14467. function NtSetDefaultUILanguage(
  14468. LanguageId : LANGID
  14469. ): NTSTATUS; stdcall;
  14470. begin
  14471. GetProcedureAddress(_NtSetDefaultUILanguage, ntdll, 'NtSetDefaultUILanguage');
  14472. Result := TFNNtSetDefaultUILanguage(_NtSetDefaultUILanguage)(
  14473. LanguageId
  14474. );
  14475. end;
  14476. // Dynamic version of NtSetDefaultUILanguage
  14477. function ZwSetDefaultUILanguage(
  14478. LanguageId : LANGID
  14479. ): NTSTATUS; stdcall;
  14480. begin
  14481. GetProcedureAddress(_NtSetDefaultUILanguage, ntdll, 'NtSetDefaultUILanguage');
  14482. Result := TFNNtSetDefaultUILanguage(_NtSetDefaultUILanguage)(
  14483. LanguageId
  14484. );
  14485. end;
  14486. // Dynamic version of NtSetEaFile
  14487. function NtSetEaFile(
  14488. FileHandle : HANDLE;
  14489. IoStatusBlock : PIO_STATUS_BLOCK;
  14490. Buffer : PFILE_FULL_EA_INFORMATION;
  14491. BufferLength : ULONG
  14492. ): NTSTATUS; stdcall;
  14493. begin
  14494. GetProcedureAddress(_NtSetEaFile, ntdll, 'NtSetEaFile');
  14495. Result := TFNNtSetEaFile(_NtSetEaFile)(
  14496. FileHandle, IoStatusBlock, Buffer, BufferLength
  14497. );
  14498. end;
  14499. // Dynamic version of NtSetEaFile
  14500. function ZwSetEaFile(
  14501. FileHandle : HANDLE;
  14502. IoStatusBlock : PIO_STATUS_BLOCK;
  14503. Buffer : PFILE_FULL_EA_INFORMATION;
  14504. BufferLength : ULONG
  14505. ): NTSTATUS; stdcall;
  14506. begin
  14507. GetProcedureAddress(_NtSetEaFile, ntdll, 'NtSetEaFile');
  14508. Result := TFNNtSetEaFile(_NtSetEaFile)(
  14509. FileHandle, IoStatusBlock, Buffer, BufferLength
  14510. );
  14511. end;
  14512. // Dynamic version of NtSetEvent
  14513. function NtSetEvent(
  14514. EventHandle : HANDLE;
  14515. PreviousState : PULONG
  14516. ): NTSTATUS; stdcall;
  14517. begin
  14518. GetProcedureAddress(_NtSetEvent, ntdll, 'NtSetEvent');
  14519. Result := TFNNtSetEvent(_NtSetEvent)(
  14520. EventHandle, PreviousState
  14521. );
  14522. end;
  14523. // Dynamic version of NtSetEvent
  14524. function ZwSetEvent(
  14525. EventHandle : HANDLE;
  14526. PreviousState : PULONG
  14527. ): NTSTATUS; stdcall;
  14528. begin
  14529. GetProcedureAddress(_NtSetEvent, ntdll, 'NtSetEvent');
  14530. Result := TFNNtSetEvent(_NtSetEvent)(
  14531. EventHandle, PreviousState
  14532. );
  14533. end;
  14534. // Dynamic version of NtSetHighEventPair
  14535. function NtSetHighEventPair(
  14536. EventPairHandle : HANDLE
  14537. ): NTSTATUS; stdcall;
  14538. begin
  14539. GetProcedureAddress(_NtSetHighEventPair, ntdll, 'NtSetHighEventPair');
  14540. Result := TFNNtSetHighEventPair(_NtSetHighEventPair)(
  14541. EventPairHandle
  14542. );
  14543. end;
  14544. // Dynamic version of NtSetHighEventPair
  14545. function ZwSetHighEventPair(
  14546. EventPairHandle : HANDLE
  14547. ): NTSTATUS; stdcall;
  14548. begin
  14549. GetProcedureAddress(_NtSetHighEventPair, ntdll, 'NtSetHighEventPair');
  14550. Result := TFNNtSetHighEventPair(_NtSetHighEventPair)(
  14551. EventPairHandle
  14552. );
  14553. end;
  14554. // Dynamic version of NtSetHighWaitLowEventPair
  14555. function NtSetHighWaitLowEventPair(
  14556. EventPairHandle : HANDLE
  14557. ): NTSTATUS; stdcall;
  14558. begin
  14559. GetProcedureAddress(_NtSetHighWaitLowEventPair, ntdll, 'NtSetHighWaitLowEventPair');
  14560. Result := TFNNtSetHighWaitLowEventPair(_NtSetHighWaitLowEventPair)(
  14561. EventPairHandle
  14562. );
  14563. end;
  14564. // Dynamic version of NtSetHighWaitLowEventPair
  14565. function ZwSetHighWaitLowEventPair(
  14566. EventPairHandle : HANDLE
  14567. ): NTSTATUS; stdcall;
  14568. begin
  14569. GetProcedureAddress(_NtSetHighWaitLowEventPair, ntdll, 'NtSetHighWaitLowEventPair');
  14570. Result := TFNNtSetHighWaitLowEventPair(_NtSetHighWaitLowEventPair)(
  14571. EventPairHandle
  14572. );
  14573. end;
  14574. // Dynamic version of NtSetHighWaitLowThread
  14575. function NtSetHighWaitLowThread(): NTSTATUS; stdcall;
  14576. begin
  14577. GetProcedureAddress(_NtSetHighWaitLowThread, ntdll, 'NtSetHighWaitLowThread');
  14578. Result := TFNNtSetHighWaitLowThread(_NtSetHighWaitLowThread)();
  14579. end;
  14580. // Dynamic version of NtSetHighWaitLowThread
  14581. function ZwSetHighWaitLowThread(): NTSTATUS; stdcall;
  14582. begin
  14583. GetProcedureAddress(_NtSetHighWaitLowThread, ntdll, 'NtSetHighWaitLowThread');
  14584. Result := TFNNtSetHighWaitLowThread(_NtSetHighWaitLowThread)();
  14585. end;
  14586. // Dynamic version of NtSetInformationFile
  14587. function NtSetInformationFile(
  14588. FileHandle : HANDLE;
  14589. IoStatusBlock : PIO_STATUS_BLOCK;
  14590. FileInformation : PVOID;
  14591. FileInformationLength : ULONG;
  14592. FileInformationClass : FILE_INFORMATION_CLASS
  14593. ): NTSTATUS; stdcall;
  14594. begin
  14595. GetProcedureAddress(_NtSetInformationFile, ntdll, 'NtSetInformationFile');
  14596. Result := TFNNtSetInformationFile(_NtSetInformationFile)(
  14597. FileHandle, IoStatusBlock, FileInformation, FileInformationLength, FileInformationClass
  14598. );
  14599. end;
  14600. // Dynamic version of NtSetInformationFile
  14601. function ZwSetInformationFile(
  14602. FileHandle : HANDLE;
  14603. IoStatusBlock : PIO_STATUS_BLOCK;
  14604. FileInformation : PVOID;
  14605. FileInformationLength : ULONG;
  14606. FileInformationClass : FILE_INFORMATION_CLASS
  14607. ): NTSTATUS; stdcall;
  14608. begin
  14609. GetProcedureAddress(_NtSetInformationFile, ntdll, 'NtSetInformationFile');
  14610. Result := TFNNtSetInformationFile(_NtSetInformationFile)(
  14611. FileHandle, IoStatusBlock, FileInformation, FileInformationLength, FileInformationClass
  14612. );
  14613. end;
  14614. // Dynamic version of NtSetInformationJobObject
  14615. function NtSetInformationJobObject(
  14616. JobHandle : HANDLE;
  14617. JobInformationClass : JOBOBJECTINFOCLASS;
  14618. JobInformation : PVOID;
  14619. JobInformationLength : ULONG
  14620. ): NTSTATUS; stdcall;
  14621. begin
  14622. GetProcedureAddress(_NtSetInformationJobObject, ntdll, 'NtSetInformationJobObject');
  14623. Result := TFNNtSetInformationJobObject(_NtSetInformationJobObject)(
  14624. JobHandle, JobInformationClass, JobInformation, JobInformationLength
  14625. );
  14626. end;
  14627. // Dynamic version of NtSetInformationJobObject
  14628. function ZwSetInformationJobObject(
  14629. JobHandle : HANDLE;
  14630. JobInformationClass : JOBOBJECTINFOCLASS;
  14631. JobInformation : PVOID;
  14632. JobInformationLength : ULONG
  14633. ): NTSTATUS; stdcall;
  14634. begin
  14635. GetProcedureAddress(_NtSetInformationJobObject, ntdll, 'NtSetInformationJobObject');
  14636. Result := TFNNtSetInformationJobObject(_NtSetInformationJobObject)(
  14637. JobHandle, JobInformationClass, JobInformation, JobInformationLength
  14638. );
  14639. end;
  14640. // Dynamic version of NtSetInformationKey
  14641. function NtSetInformationKey(
  14642. KeyHandle : HANDLE;
  14643. KeyInformationClass : KEY_SET_INFORMATION_CLASS;
  14644. KeyInformation : PVOID;
  14645. KeyInformationLength : ULONG
  14646. ): NTSTATUS; stdcall;
  14647. begin
  14648. GetProcedureAddress(_NtSetInformationKey, ntdll, 'NtSetInformationKey');
  14649. Result := TFNNtSetInformationKey(_NtSetInformationKey)(
  14650. KeyHandle, KeyInformationClass, KeyInformation, KeyInformationLength
  14651. );
  14652. end;
  14653. // Dynamic version of NtSetInformationKey
  14654. function ZwSetInformationKey(
  14655. KeyHandle : HANDLE;
  14656. KeyInformationClass : KEY_SET_INFORMATION_CLASS;
  14657. KeyInformation : PVOID;
  14658. KeyInformationLength : ULONG
  14659. ): NTSTATUS; stdcall;
  14660. begin
  14661. GetProcedureAddress(_NtSetInformationKey, ntdll, 'NtSetInformationKey');
  14662. Result := TFNNtSetInformationKey(_NtSetInformationKey)(
  14663. KeyHandle, KeyInformationClass, KeyInformation, KeyInformationLength
  14664. );
  14665. end;
  14666. // Dynamic version of NtSetInformationObject
  14667. function NtSetInformationObject(
  14668. ObjectHandle : HANDLE;
  14669. ObjectInformationClass : OBJECT_INFORMATION_CLASS;
  14670. ObjectInformation : PVOID;
  14671. ObjectInformationLength : ULONG
  14672. ): NTSTATUS; stdcall;
  14673. begin
  14674. GetProcedureAddress(_NtSetInformationObject, ntdll, 'NtSetInformationObject');
  14675. Result := TFNNtSetInformationObject(_NtSetInformationObject)(
  14676. ObjectHandle, ObjectInformationClass, ObjectInformation, ObjectInformationLength
  14677. );
  14678. end;
  14679. // Dynamic version of NtSetInformationObject
  14680. function ZwSetInformationObject(
  14681. ObjectHandle : HANDLE;
  14682. ObjectInformationClass : OBJECT_INFORMATION_CLASS;
  14683. ObjectInformation : PVOID;
  14684. ObjectInformationLength : ULONG
  14685. ): NTSTATUS; stdcall;
  14686. begin
  14687. GetProcedureAddress(_NtSetInformationObject, ntdll, 'NtSetInformationObject');
  14688. Result := TFNNtSetInformationObject(_NtSetInformationObject)(
  14689. ObjectHandle, ObjectInformationClass, ObjectInformation, ObjectInformationLength
  14690. );
  14691. end;
  14692. // Dynamic version of NtSetInformationProcess
  14693. function NtSetInformationProcess(
  14694. ProcessHandle : HANDLE;
  14695. ProcessInformationClass : PROCESSINFOCLASS;
  14696. ProcessInformation : PVOID;
  14697. ProcessInformationLength : ULONG
  14698. ): NTSTATUS; stdcall;
  14699. begin
  14700. GetProcedureAddress(_NtSetInformationProcess, ntdll, 'NtSetInformationProcess');
  14701. Result := TFNNtSetInformationProcess(_NtSetInformationProcess)(
  14702. ProcessHandle, ProcessInformationClass, ProcessInformation, ProcessInformationLength
  14703. );
  14704. end;
  14705. // Dynamic version of NtSetInformationProcess
  14706. function ZwSetInformationProcess(
  14707. ProcessHandle : HANDLE;
  14708. ProcessInformationClass : PROCESSINFOCLASS;
  14709. ProcessInformation : PVOID;
  14710. ProcessInformationLength : ULONG
  14711. ): NTSTATUS; stdcall;
  14712. begin
  14713. GetProcedureAddress(_NtSetInformationProcess, ntdll, 'NtSetInformationProcess');
  14714. Result := TFNNtSetInformationProcess(_NtSetInformationProcess)(
  14715. ProcessHandle, ProcessInformationClass, ProcessInformation, ProcessInformationLength
  14716. );
  14717. end;
  14718. // Dynamic version of NtSetInformationThread
  14719. function NtSetInformationThread(
  14720. ThreadHandle : HANDLE;
  14721. ThreadInformationClass : THREADINFOCLASS;
  14722. ThreadInformation : PVOID;
  14723. ThreadInformationLength : ULONG
  14724. ): NTSTATUS; stdcall;
  14725. begin
  14726. GetProcedureAddress(_NtSetInformationThread, ntdll, 'NtSetInformationThread');
  14727. Result := TFNNtSetInformationThread(_NtSetInformationThread)(
  14728. ThreadHandle, ThreadInformationClass, ThreadInformation, ThreadInformationLength
  14729. );
  14730. end;
  14731. // Dynamic version of NtSetInformationThread
  14732. function ZwSetInformationThread(
  14733. ThreadHandle : HANDLE;
  14734. ThreadInformationClass : THREADINFOCLASS;
  14735. ThreadInformation : PVOID;
  14736. ThreadInformationLength : ULONG
  14737. ): NTSTATUS; stdcall;
  14738. begin
  14739. GetProcedureAddress(_NtSetInformationThread, ntdll, 'NtSetInformationThread');
  14740. Result := TFNNtSetInformationThread(_NtSetInformationThread)(
  14741. ThreadHandle, ThreadInformationClass, ThreadInformation, ThreadInformationLength
  14742. );
  14743. end;
  14744. // Dynamic version of NtSetInformationToken
  14745. function NtSetInformationToken(
  14746. TokenHandle : HANDLE;
  14747. TokenInformationClass : TOKEN_INFORMATION_CLASS;
  14748. TokenInformation : PVOID;
  14749. TokenInformationLength : ULONG
  14750. ): NTSTATUS; stdcall;
  14751. begin
  14752. GetProcedureAddress(_NtSetInformationToken, ntdll, 'NtSetInformationToken');
  14753. Result := TFNNtSetInformationToken(_NtSetInformationToken)(
  14754. TokenHandle, TokenInformationClass, TokenInformation, TokenInformationLength
  14755. );
  14756. end;
  14757. // Dynamic version of NtSetInformationToken
  14758. function ZwSetInformationToken(
  14759. TokenHandle : HANDLE;
  14760. TokenInformationClass : TOKEN_INFORMATION_CLASS;
  14761. TokenInformation : PVOID;
  14762. TokenInformationLength : ULONG
  14763. ): NTSTATUS; stdcall;
  14764. begin
  14765. GetProcedureAddress(_NtSetInformationToken, ntdll, 'NtSetInformationToken');
  14766. Result := TFNNtSetInformationToken(_NtSetInformationToken)(
  14767. TokenHandle, TokenInformationClass, TokenInformation, TokenInformationLength
  14768. );
  14769. end;
  14770. // Dynamic version of NtSetIntervalProfile
  14771. function NtSetIntervalProfile(
  14772. Interval : ULONG;
  14773. Source : KPROFILE_SOURCE
  14774. ): NTSTATUS; stdcall;
  14775. begin
  14776. GetProcedureAddress(_NtSetIntervalProfile, ntdll, 'NtSetIntervalProfile');
  14777. Result := TFNNtSetIntervalProfile(_NtSetIntervalProfile)(
  14778. Interval, Source
  14779. );
  14780. end;
  14781. // Dynamic version of NtSetIntervalProfile
  14782. function ZwSetIntervalProfile(
  14783. Interval : ULONG;
  14784. Source : KPROFILE_SOURCE
  14785. ): NTSTATUS; stdcall;
  14786. begin
  14787. GetProcedureAddress(_NtSetIntervalProfile, ntdll, 'NtSetIntervalProfile');
  14788. Result := TFNNtSetIntervalProfile(_NtSetIntervalProfile)(
  14789. Interval, Source
  14790. );
  14791. end;
  14792. // Dynamic version of NtSetIoCompletion
  14793. function NtSetIoCompletion(
  14794. IoCompletionHandle : HANDLE;
  14795. CompletionKey : ULONG;
  14796. CompletionValue : ULONG;
  14797. Status : NTSTATUS;
  14798. Information : ULONG
  14799. ): NTSTATUS; stdcall;
  14800. begin
  14801. GetProcedureAddress(_NtSetIoCompletion, ntdll, 'NtSetIoCompletion');
  14802. Result := TFNNtSetIoCompletion(_NtSetIoCompletion)(
  14803. IoCompletionHandle, CompletionKey, CompletionValue, Status, Information
  14804. );
  14805. end;
  14806. // Dynamic version of NtSetIoCompletion
  14807. function ZwSetIoCompletion(
  14808. IoCompletionHandle : HANDLE;
  14809. CompletionKey : ULONG;
  14810. CompletionValue : ULONG;
  14811. Status : NTSTATUS;
  14812. Information : ULONG
  14813. ): NTSTATUS; stdcall;
  14814. begin
  14815. GetProcedureAddress(_NtSetIoCompletion, ntdll, 'NtSetIoCompletion');
  14816. Result := TFNNtSetIoCompletion(_NtSetIoCompletion)(
  14817. IoCompletionHandle, CompletionKey, CompletionValue, Status, Information
  14818. );
  14819. end;
  14820. // Dynamic version of NtSetLdtEntries
  14821. function NtSetLdtEntries(
  14822. Selector1 : ULONG;
  14823. LdtEntry1 : LDT_ENTRY;
  14824. Selector2 : ULONG;
  14825. LdtEntry2 : LDT_ENTRY
  14826. ): NTSTATUS; stdcall;
  14827. begin
  14828. GetProcedureAddress(_NtSetLdtEntries, ntdll, 'NtSetLdtEntries');
  14829. Result := TFNNtSetLdtEntries(_NtSetLdtEntries)(
  14830. Selector1, LdtEntry1, Selector2, LdtEntry2
  14831. );
  14832. end;
  14833. // Dynamic version of NtSetLdtEntries
  14834. function ZwSetLdtEntries(
  14835. Selector1 : ULONG;
  14836. LdtEntry1 : LDT_ENTRY;
  14837. Selector2 : ULONG;
  14838. LdtEntry2 : LDT_ENTRY
  14839. ): NTSTATUS; stdcall;
  14840. begin
  14841. GetProcedureAddress(_NtSetLdtEntries, ntdll, 'NtSetLdtEntries');
  14842. Result := TFNNtSetLdtEntries(_NtSetLdtEntries)(
  14843. Selector1, LdtEntry1, Selector2, LdtEntry2
  14844. );
  14845. end;
  14846. // Dynamic version of NtSetLowEventPair
  14847. function NtSetLowEventPair(
  14848. EventPairHandle : HANDLE
  14849. ): NTSTATUS; stdcall;
  14850. begin
  14851. GetProcedureAddress(_NtSetLowEventPair, ntdll, 'NtSetLowEventPair');
  14852. Result := TFNNtSetLowEventPair(_NtSetLowEventPair)(
  14853. EventPairHandle
  14854. );
  14855. end;
  14856. // Dynamic version of NtSetLowEventPair
  14857. function ZwSetLowEventPair(
  14858. EventPairHandle : HANDLE
  14859. ): NTSTATUS; stdcall;
  14860. begin
  14861. GetProcedureAddress(_NtSetLowEventPair, ntdll, 'NtSetLowEventPair');
  14862. Result := TFNNtSetLowEventPair(_NtSetLowEventPair)(
  14863. EventPairHandle
  14864. );
  14865. end;
  14866. // Dynamic version of NtSetLowWaitHighEventPair
  14867. function NtSetLowWaitHighEventPair(
  14868. EventPairHandle : HANDLE
  14869. ): NTSTATUS; stdcall;
  14870. begin
  14871. GetProcedureAddress(_NtSetLowWaitHighEventPair, ntdll, 'NtSetLowWaitHighEventPair');
  14872. Result := TFNNtSetLowWaitHighEventPair(_NtSetLowWaitHighEventPair)(
  14873. EventPairHandle
  14874. );
  14875. end;
  14876. // Dynamic version of NtSetLowWaitHighEventPair
  14877. function ZwSetLowWaitHighEventPair(
  14878. EventPairHandle : HANDLE
  14879. ): NTSTATUS; stdcall;
  14880. begin
  14881. GetProcedureAddress(_NtSetLowWaitHighEventPair, ntdll, 'NtSetLowWaitHighEventPair');
  14882. Result := TFNNtSetLowWaitHighEventPair(_NtSetLowWaitHighEventPair)(
  14883. EventPairHandle
  14884. );
  14885. end;
  14886. // Dynamic version of NtSetLowWaitHighThread
  14887. function NtSetLowWaitHighThread(): NTSTATUS; stdcall;
  14888. begin
  14889. GetProcedureAddress(_NtSetLowWaitHighThread, ntdll, 'NtSetLowWaitHighThread');
  14890. Result := TFNNtSetLowWaitHighThread(_NtSetLowWaitHighThread)();
  14891. end;
  14892. // Dynamic version of NtSetLowWaitHighThread
  14893. function ZwSetLowWaitHighThread(): NTSTATUS; stdcall;
  14894. begin
  14895. GetProcedureAddress(_NtSetLowWaitHighThread, ntdll, 'NtSetLowWaitHighThread');
  14896. Result := TFNNtSetLowWaitHighThread(_NtSetLowWaitHighThread)();
  14897. end;
  14898. // Dynamic version of NtSetQuotaInformationFile
  14899. function NtSetQuotaInformationFile(
  14900. FileHandle : HANDLE;
  14901. IoStatusBlock : PIO_STATUS_BLOCK;
  14902. Buffer : PFILE_USER_QUOTA_INFORMATION;
  14903. BufferLength : ULONG
  14904. ): NTSTATUS; stdcall;
  14905. begin
  14906. GetProcedureAddress(_NtSetQuotaInformationFile, ntdll, 'NtSetQuotaInformationFile');
  14907. Result := TFNNtSetQuotaInformationFile(_NtSetQuotaInformationFile)(
  14908. FileHandle, IoStatusBlock, Buffer, BufferLength
  14909. );
  14910. end;
  14911. // Dynamic version of NtSetQuotaInformationFile
  14912. function ZwSetQuotaInformationFile(
  14913. FileHandle : HANDLE;
  14914. IoStatusBlock : PIO_STATUS_BLOCK;
  14915. Buffer : PFILE_USER_QUOTA_INFORMATION;
  14916. BufferLength : ULONG
  14917. ): NTSTATUS; stdcall;
  14918. begin
  14919. GetProcedureAddress(_NtSetQuotaInformationFile, ntdll, 'NtSetQuotaInformationFile');
  14920. Result := TFNNtSetQuotaInformationFile(_NtSetQuotaInformationFile)(
  14921. FileHandle, IoStatusBlock, Buffer, BufferLength
  14922. );
  14923. end;
  14924. // Dynamic version of NtSetSecurityObject
  14925. function NtSetSecurityObject(
  14926. Handle : HANDLE;
  14927. SecurityInformation : SECURITY_INFORMATION;
  14928. SecurityDescriptor : PSECURITY_DESCRIPTOR
  14929. ): NTSTATUS; stdcall;
  14930. begin
  14931. GetProcedureAddress(_NtSetSecurityObject, ntdll, 'NtSetSecurityObject');
  14932. Result := TFNNtSetSecurityObject(_NtSetSecurityObject)(
  14933. Handle, SecurityInformation, SecurityDescriptor
  14934. );
  14935. end;
  14936. // Dynamic version of NtSetSecurityObject
  14937. function ZwSetSecurityObject(
  14938. Handle : HANDLE;
  14939. SecurityInformation : SECURITY_INFORMATION;
  14940. SecurityDescriptor : PSECURITY_DESCRIPTOR
  14941. ): NTSTATUS; stdcall;
  14942. begin
  14943. GetProcedureAddress(_NtSetSecurityObject, ntdll, 'NtSetSecurityObject');
  14944. Result := TFNNtSetSecurityObject(_NtSetSecurityObject)(
  14945. Handle, SecurityInformation, SecurityDescriptor
  14946. );
  14947. end;
  14948. // Dynamic version of NtSetSystemEnvironmentValue
  14949. function NtSetSystemEnvironmentValue(
  14950. Name : PUNICODE_STRING;
  14951. Value : PUNICODE_STRING
  14952. ): NTSTATUS; stdcall;
  14953. begin
  14954. GetProcedureAddress(_NtSetSystemEnvironmentValue, ntdll, 'NtSetSystemEnvironmentValue');
  14955. Result := TFNNtSetSystemEnvironmentValue(_NtSetSystemEnvironmentValue)(
  14956. Name, Value
  14957. );
  14958. end;
  14959. // Dynamic version of NtSetSystemEnvironmentValue
  14960. function ZwSetSystemEnvironmentValue(
  14961. Name : PUNICODE_STRING;
  14962. Value : PUNICODE_STRING
  14963. ): NTSTATUS; stdcall;
  14964. begin
  14965. GetProcedureAddress(_NtSetSystemEnvironmentValue, ntdll, 'NtSetSystemEnvironmentValue');
  14966. Result := TFNNtSetSystemEnvironmentValue(_NtSetSystemEnvironmentValue)(
  14967. Name, Value
  14968. );
  14969. end;
  14970. // Dynamic version of NtSetSystemInformation
  14971. function NtSetSystemInformation(
  14972. SystemInformationClass : SYSTEM_INFORMATION_CLASS;
  14973. SystemInformation : PVOID;
  14974. SystemInformationLength : ULONG
  14975. ): NTSTATUS; stdcall;
  14976. begin
  14977. GetProcedureAddress(_NtSetSystemInformation, ntdll, 'NtSetSystemInformation');
  14978. Result := TFNNtSetSystemInformation(_NtSetSystemInformation)(
  14979. SystemInformationClass, SystemInformation, SystemInformationLength
  14980. );
  14981. end;
  14982. // Dynamic version of NtSetSystemInformation
  14983. function ZwSetSystemInformation(
  14984. SystemInformationClass : SYSTEM_INFORMATION_CLASS;
  14985. SystemInformation : PVOID;
  14986. SystemInformationLength : ULONG
  14987. ): NTSTATUS; stdcall;
  14988. begin
  14989. GetProcedureAddress(_NtSetSystemInformation, ntdll, 'NtSetSystemInformation');
  14990. Result := TFNNtSetSystemInformation(_NtSetSystemInformation)(
  14991. SystemInformationClass, SystemInformation, SystemInformationLength
  14992. );
  14993. end;
  14994. // Dynamic version of NtSetSystemPowerState
  14995. function NtSetSystemPowerState(
  14996. SystemAction : POWER_ACTION;
  14997. MinSystemState : SYSTEM_POWER_STATE;
  14998. Flags : ULONG
  14999. ): NTSTATUS; stdcall;
  15000. begin
  15001. GetProcedureAddress(_NtSetSystemPowerState, ntdll, 'NtSetSystemPowerState');
  15002. Result := TFNNtSetSystemPowerState(_NtSetSystemPowerState)(
  15003. SystemAction, MinSystemState, Flags
  15004. );
  15005. end;
  15006. // Dynamic version of NtSetSystemPowerState
  15007. function ZwSetSystemPowerState(
  15008. SystemAction : POWER_ACTION;
  15009. MinSystemState : SYSTEM_POWER_STATE;
  15010. Flags : ULONG
  15011. ): NTSTATUS; stdcall;
  15012. begin
  15013. GetProcedureAddress(_NtSetSystemPowerState, ntdll, 'NtSetSystemPowerState');
  15014. Result := TFNNtSetSystemPowerState(_NtSetSystemPowerState)(
  15015. SystemAction, MinSystemState, Flags
  15016. );
  15017. end;
  15018. // Dynamic version of NtSetSystemTime
  15019. function NtSetSystemTime(
  15020. NewTime : PLARGE_INTEGER;
  15021. OldTime : PLARGE_INTEGER
  15022. ): NTSTATUS; stdcall;
  15023. begin
  15024. GetProcedureAddress(_NtSetSystemTime, ntdll, 'NtSetSystemTime');
  15025. Result := TFNNtSetSystemTime(_NtSetSystemTime)(
  15026. NewTime, OldTime
  15027. );
  15028. end;
  15029. // Dynamic version of NtSetSystemTime
  15030. function ZwSetSystemTime(
  15031. NewTime : PLARGE_INTEGER;
  15032. OldTime : PLARGE_INTEGER
  15033. ): NTSTATUS; stdcall;
  15034. begin
  15035. GetProcedureAddress(_NtSetSystemTime, ntdll, 'NtSetSystemTime');
  15036. Result := TFNNtSetSystemTime(_NtSetSystemTime)(
  15037. NewTime, OldTime
  15038. );
  15039. end;
  15040. // Dynamic version of NtSetThreadExecutionState
  15041. function NtSetThreadExecutionState(
  15042. ExecutionState : EXECUTION_STATE;
  15043. PreviousExecutionState : PEXECUTION_STATE
  15044. ): NTSTATUS; stdcall;
  15045. begin
  15046. GetProcedureAddress(_NtSetThreadExecutionState, ntdll, 'NtSetThreadExecutionState');
  15047. Result := TFNNtSetThreadExecutionState(_NtSetThreadExecutionState)(
  15048. ExecutionState, PreviousExecutionState
  15049. );
  15050. end;
  15051. // Dynamic version of NtSetThreadExecutionState
  15052. function ZwSetThreadExecutionState(
  15053. ExecutionState : EXECUTION_STATE;
  15054. PreviousExecutionState : PEXECUTION_STATE
  15055. ): NTSTATUS; stdcall;
  15056. begin
  15057. GetProcedureAddress(_NtSetThreadExecutionState, ntdll, 'NtSetThreadExecutionState');
  15058. Result := TFNNtSetThreadExecutionState(_NtSetThreadExecutionState)(
  15059. ExecutionState, PreviousExecutionState
  15060. );
  15061. end;
  15062. // Dynamic version of NtSetTimer
  15063. function NtSetTimer(
  15064. TimerHandle : HANDLE;
  15065. DueTime : PLARGE_INTEGER;
  15066. TimerApcRoutine : PTIMER_APC_ROUTINE;
  15067. TimerContext : PVOID;
  15068. Resume : BOOLEAN;
  15069. Period : LONG;
  15070. PreviousState : PBOOLEAN
  15071. ): NTSTATUS; stdcall;
  15072. begin
  15073. GetProcedureAddress(_NtSetTimer, ntdll, 'NtSetTimer');
  15074. Result := TFNNtSetTimer(_NtSetTimer)(
  15075. TimerHandle, DueTime, TimerApcRoutine, TimerContext, Resume, Period, PreviousState
  15076. );
  15077. end;
  15078. // Dynamic version of NtSetTimer
  15079. function ZwSetTimer(
  15080. TimerHandle : HANDLE;
  15081. DueTime : PLARGE_INTEGER;
  15082. TimerApcRoutine : PTIMER_APC_ROUTINE;
  15083. TimerContext : PVOID;
  15084. Resume : BOOLEAN;
  15085. Period : LONG;
  15086. PreviousState : PBOOLEAN
  15087. ): NTSTATUS; stdcall;
  15088. begin
  15089. GetProcedureAddress(_NtSetTimer, ntdll, 'NtSetTimer');
  15090. Result := TFNNtSetTimer(_NtSetTimer)(
  15091. TimerHandle, DueTime, TimerApcRoutine, TimerContext, Resume, Period, PreviousState
  15092. );
  15093. end;
  15094. // Dynamic version of NtSetTimerResolution
  15095. function NtSetTimerResolution(
  15096. RequestedResolution : ULONG;
  15097. Set_ : BOOLEAN;
  15098. ActualResolution : PULONG
  15099. ): NTSTATUS; stdcall;
  15100. begin
  15101. GetProcedureAddress(_NtSetTimerResolution, ntdll, 'NtSetTimerResolution');
  15102. Result := TFNNtSetTimerResolution(_NtSetTimerResolution)(
  15103. RequestedResolution, Set_, ActualResolution
  15104. );
  15105. end;
  15106. // Dynamic version of NtSetTimerResolution
  15107. function ZwSetTimerResolution(
  15108. RequestedResolution : ULONG;
  15109. Set_ : BOOLEAN;
  15110. ActualResolution : PULONG
  15111. ): NTSTATUS; stdcall;
  15112. begin
  15113. GetProcedureAddress(_NtSetTimerResolution, ntdll, 'NtSetTimerResolution');
  15114. Result := TFNNtSetTimerResolution(_NtSetTimerResolution)(
  15115. RequestedResolution, Set_, ActualResolution
  15116. );
  15117. end;
  15118. // Dynamic version of NtSetUuidSeed
  15119. function NtSetUuidSeed(
  15120. UuidSeed : PUCHAR
  15121. ): NTSTATUS; stdcall;
  15122. begin
  15123. GetProcedureAddress(_NtSetUuidSeed, ntdll, 'NtSetUuidSeed');
  15124. Result := TFNNtSetUuidSeed(_NtSetUuidSeed)(
  15125. UuidSeed
  15126. );
  15127. end;
  15128. // Dynamic version of NtSetUuidSeed
  15129. function ZwSetUuidSeed(
  15130. UuidSeed : PUCHAR
  15131. ): NTSTATUS; stdcall;
  15132. begin
  15133. GetProcedureAddress(_NtSetUuidSeed, ntdll, 'NtSetUuidSeed');
  15134. Result := TFNNtSetUuidSeed(_NtSetUuidSeed)(
  15135. UuidSeed
  15136. );
  15137. end;
  15138. // Dynamic version of NtSetValueKey
  15139. function NtSetValueKey(
  15140. KeyHandle : HANDLE;
  15141. ValueName : PUNICODE_STRING;
  15142. TitleIndex : ULONG;
  15143. Type_ : ULONG;
  15144. Data : PVOID;
  15145. DataSize : ULONG
  15146. ): NTSTATUS; stdcall;
  15147. begin
  15148. GetProcedureAddress(_NtSetValueKey, ntdll, 'NtSetValueKey');
  15149. Result := TFNNtSetValueKey(_NtSetValueKey)(
  15150. KeyHandle, ValueName, TitleIndex, Type_, Data, DataSize
  15151. );
  15152. end;
  15153. // Dynamic version of NtSetValueKey
  15154. function ZwSetValueKey(
  15155. KeyHandle : HANDLE;
  15156. ValueName : PUNICODE_STRING;
  15157. TitleIndex : ULONG;
  15158. Type_ : ULONG;
  15159. Data : PVOID;
  15160. DataSize : ULONG
  15161. ): NTSTATUS; stdcall;
  15162. begin
  15163. GetProcedureAddress(_NtSetValueKey, ntdll, 'NtSetValueKey');
  15164. Result := TFNNtSetValueKey(_NtSetValueKey)(
  15165. KeyHandle, ValueName, TitleIndex, Type_, Data, DataSize
  15166. );
  15167. end;
  15168. // Dynamic version of NtSetVolumeInformationFile
  15169. function NtSetVolumeInformationFile(
  15170. FileHandle : HANDLE;
  15171. IoStatusBlock : PIO_STATUS_BLOCK;
  15172. Buffer : PVOID;
  15173. BufferLength : ULONG;
  15174. VolumeInformationClass : FS_INFORMATION_CLASS
  15175. ): NTSTATUS; stdcall;
  15176. begin
  15177. GetProcedureAddress(_NtSetVolumeInformationFile, ntdll, 'NtSetVolumeInformationFile');
  15178. Result := TFNNtSetVolumeInformationFile(_NtSetVolumeInformationFile)(
  15179. FileHandle, IoStatusBlock, Buffer, BufferLength, VolumeInformationClass
  15180. );
  15181. end;
  15182. // Dynamic version of NtSetVolumeInformationFile
  15183. function ZwSetVolumeInformationFile(
  15184. FileHandle : HANDLE;
  15185. IoStatusBlock : PIO_STATUS_BLOCK;
  15186. Buffer : PVOID;
  15187. BufferLength : ULONG;
  15188. VolumeInformationClass : FS_INFORMATION_CLASS
  15189. ): NTSTATUS; stdcall;
  15190. begin
  15191. GetProcedureAddress(_NtSetVolumeInformationFile, ntdll, 'NtSetVolumeInformationFile');
  15192. Result := TFNNtSetVolumeInformationFile(_NtSetVolumeInformationFile)(
  15193. FileHandle, IoStatusBlock, Buffer, BufferLength, VolumeInformationClass
  15194. );
  15195. end;
  15196. // Dynamic version of NtShutdownSystem
  15197. function NtShutdownSystem(
  15198. Action : SHUTDOWN_ACTION
  15199. ): NTSTATUS; stdcall;
  15200. begin
  15201. GetProcedureAddress(_NtShutdownSystem, ntdll, 'NtShutdownSystem');
  15202. Result := TFNNtShutdownSystem(_NtShutdownSystem)(
  15203. Action
  15204. );
  15205. end;
  15206. // Dynamic version of NtShutdownSystem
  15207. function ZwShutdownSystem(
  15208. Action : SHUTDOWN_ACTION
  15209. ): NTSTATUS; stdcall;
  15210. begin
  15211. GetProcedureAddress(_NtShutdownSystem, ntdll, 'NtShutdownSystem');
  15212. Result := TFNNtShutdownSystem(_NtShutdownSystem)(
  15213. Action
  15214. );
  15215. end;
  15216. // Dynamic version of NtSignalAndWaitForSingleObject
  15217. function NtSignalAndWaitForSingleObject(
  15218. HandleToSignal : HANDLE;
  15219. HandleToWait : HANDLE;
  15220. Alertable : BOOLEAN;
  15221. Timeout : PLARGE_INTEGER
  15222. ): NTSTATUS; stdcall;
  15223. begin
  15224. GetProcedureAddress(_NtSignalAndWaitForSingleObject, ntdll, 'NtSignalAndWaitForSingleObject');
  15225. Result := TFNNtSignalAndWaitForSingleObject(_NtSignalAndWaitForSingleObject)(
  15226. HandleToSignal, HandleToWait, Alertable, Timeout
  15227. );
  15228. end;
  15229. // Dynamic version of NtSignalAndWaitForSingleObject
  15230. function ZwSignalAndWaitForSingleObject(
  15231. HandleToSignal : HANDLE;
  15232. HandleToWait : HANDLE;
  15233. Alertable : BOOLEAN;
  15234. Timeout : PLARGE_INTEGER
  15235. ): NTSTATUS; stdcall;
  15236. begin
  15237. GetProcedureAddress(_NtSignalAndWaitForSingleObject, ntdll, 'NtSignalAndWaitForSingleObject');
  15238. Result := TFNNtSignalAndWaitForSingleObject(_NtSignalAndWaitForSingleObject)(
  15239. HandleToSignal, HandleToWait, Alertable, Timeout
  15240. );
  15241. end;
  15242. // Dynamic version of NtStartProfile
  15243. function NtStartProfile(
  15244. ProfileHandle : HANDLE
  15245. ): NTSTATUS; stdcall;
  15246. begin
  15247. GetProcedureAddress(_NtStartProfile, ntdll, 'NtStartProfile');
  15248. Result := TFNNtStartProfile(_NtStartProfile)(
  15249. ProfileHandle
  15250. );
  15251. end;
  15252. // Dynamic version of NtStartProfile
  15253. function ZwStartProfile(
  15254. ProfileHandle : HANDLE
  15255. ): NTSTATUS; stdcall;
  15256. begin
  15257. GetProcedureAddress(_NtStartProfile, ntdll, 'NtStartProfile');
  15258. Result := TFNNtStartProfile(_NtStartProfile)(
  15259. ProfileHandle
  15260. );
  15261. end;
  15262. // Dynamic version of NtStopProfile
  15263. function NtStopProfile(
  15264. ProfileHandle : HANDLE
  15265. ): NTSTATUS; stdcall;
  15266. begin
  15267. GetProcedureAddress(_NtStopProfile, ntdll, 'NtStopProfile');
  15268. Result := TFNNtStopProfile(_NtStopProfile)(
  15269. ProfileHandle
  15270. );
  15271. end;
  15272. // Dynamic version of NtStopProfile
  15273. function ZwStopProfile(
  15274. ProfileHandle : HANDLE
  15275. ): NTSTATUS; stdcall;
  15276. begin
  15277. GetProcedureAddress(_NtStopProfile, ntdll, 'NtStopProfile');
  15278. Result := TFNNtStopProfile(_NtStopProfile)(
  15279. ProfileHandle
  15280. );
  15281. end;
  15282. // Dynamic version of NtSuspendProcess
  15283. function NtSuspendProcess(
  15284. hProcess : HANDLE
  15285. ): NTSTATUS; stdcall;
  15286. begin
  15287. GetProcedureAddress(_NtSuspendProcess, ntdll, 'NtSuspendProcess');
  15288. Result := TFNNtSuspendProcess(_NtSuspendProcess)(
  15289. hProcess
  15290. );
  15291. end;
  15292. // Dynamic version of NtSuspendProcess
  15293. function ZwSuspendProcess(
  15294. hProcess : HANDLE
  15295. ): NTSTATUS; stdcall;
  15296. begin
  15297. GetProcedureAddress(_NtSuspendProcess, ntdll, 'NtSuspendProcess');
  15298. Result := TFNNtSuspendProcess(_NtSuspendProcess)(
  15299. hProcess
  15300. );
  15301. end;
  15302. // Dynamic version of NtSuspendThread
  15303. function NtSuspendThread(
  15304. hThread : HANDLE;
  15305. dwLastResumeCount : PULONG
  15306. ): NTSTATUS; stdcall;
  15307. begin
  15308. GetProcedureAddress(_NtSuspendThread, ntdll, 'NtSuspendThread');
  15309. Result := TFNNtSuspendThread(_NtSuspendThread)(
  15310. hThread, dwLastResumeCount
  15311. );
  15312. end;
  15313. // Dynamic version of NtSuspendThread
  15314. function ZwSuspendThread(
  15315. hThread : HANDLE;
  15316. dwLastResumeCount : PULONG
  15317. ): NTSTATUS; stdcall;
  15318. begin
  15319. GetProcedureAddress(_NtSuspendThread, ntdll, 'NtSuspendThread');
  15320. Result := TFNNtSuspendThread(_NtSuspendThread)(
  15321. hThread, dwLastResumeCount
  15322. );
  15323. end;
  15324. // Dynamic version of NtSystemDebugControl
  15325. function NtSystemDebugControl(
  15326. ControlCode : DEBUG_CONTROL_CODE;
  15327. InputBuffer : PVOID;
  15328. InputBufferLength : ULONG;
  15329. OutputBuffer : PVOID;
  15330. OutputBufferLength : ULONG;
  15331. ReturnLength : PULONG
  15332. ): NTSTATUS; stdcall;
  15333. begin
  15334. GetProcedureAddress(_NtSystemDebugControl, ntdll, 'NtSystemDebugControl');
  15335. Result := TFNNtSystemDebugControl(_NtSystemDebugControl)(
  15336. ControlCode, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength, ReturnLength
  15337. );
  15338. end;
  15339. // Dynamic version of NtSystemDebugControl
  15340. function ZwSystemDebugControl(
  15341. ControlCode : DEBUG_CONTROL_CODE;
  15342. InputBuffer : PVOID;
  15343. InputBufferLength : ULONG;
  15344. OutputBuffer : PVOID;
  15345. OutputBufferLength : ULONG;
  15346. ReturnLength : PULONG
  15347. ): NTSTATUS; stdcall;
  15348. begin
  15349. GetProcedureAddress(_NtSystemDebugControl, ntdll, 'NtSystemDebugControl');
  15350. Result := TFNNtSystemDebugControl(_NtSystemDebugControl)(
  15351. ControlCode, InputBuffer, InputBufferLength, OutputBuffer, OutputBufferLength, ReturnLength
  15352. );
  15353. end;
  15354. // Dynamic version of NtTerminateJobObject
  15355. function NtTerminateJobObject(
  15356. JobHandle : HANDLE;
  15357. ExitStatus : NTSTATUS
  15358. ): NTSTATUS; stdcall;
  15359. begin
  15360. GetProcedureAddress(_NtTerminateJobObject, ntdll, 'NtTerminateJobObject');
  15361. Result := TFNNtTerminateJobObject(_NtTerminateJobObject)(
  15362. JobHandle, ExitStatus
  15363. );
  15364. end;
  15365. // Dynamic version of NtTerminateJobObject
  15366. function ZwTerminateJobObject(
  15367. JobHandle : HANDLE;
  15368. ExitStatus : NTSTATUS
  15369. ): NTSTATUS; stdcall;
  15370. begin
  15371. GetProcedureAddress(_NtTerminateJobObject, ntdll, 'NtTerminateJobObject');
  15372. Result := TFNNtTerminateJobObject(_NtTerminateJobObject)(
  15373. JobHandle, ExitStatus
  15374. );
  15375. end;
  15376. // Dynamic version of NtTerminateProcess
  15377. function NtTerminateProcess(
  15378. ProcessHandle : HANDLE;
  15379. ExitStatus : NTSTATUS
  15380. ): NTSTATUS; stdcall;
  15381. begin
  15382. GetProcedureAddress(_NtTerminateProcess, ntdll, 'NtTerminateProcess');
  15383. Result := TFNNtTerminateProcess(_NtTerminateProcess)(
  15384. ProcessHandle, ExitStatus
  15385. );
  15386. end;
  15387. // Dynamic version of NtTerminateProcess
  15388. function ZwTerminateProcess(
  15389. ProcessHandle : HANDLE;
  15390. ExitStatus : NTSTATUS
  15391. ): NTSTATUS; stdcall;
  15392. begin
  15393. GetProcedureAddress(_NtTerminateProcess, ntdll, 'NtTerminateProcess');
  15394. Result := TFNNtTerminateProcess(_NtTerminateProcess)(
  15395. ProcessHandle, ExitStatus
  15396. );
  15397. end;
  15398. // Dynamic version of NtTerminateThread
  15399. function NtTerminateThread(
  15400. ThreadHandle : HANDLE;
  15401. ExitStatus : NTSTATUS
  15402. ): NTSTATUS; stdcall;
  15403. begin
  15404. GetProcedureAddress(_NtTerminateThread, ntdll, 'NtTerminateThread');
  15405. Result := TFNNtTerminateThread(_NtTerminateThread)(
  15406. ThreadHandle, ExitStatus
  15407. );
  15408. end;
  15409. // Dynamic version of NtTerminateThread
  15410. function ZwTerminateThread(
  15411. ThreadHandle : HANDLE;
  15412. ExitStatus : NTSTATUS
  15413. ): NTSTATUS; stdcall;
  15414. begin
  15415. GetProcedureAddress(_NtTerminateThread, ntdll, 'NtTerminateThread');
  15416. Result := TFNNtTerminateThread(_NtTerminateThread)(
  15417. ThreadHandle, ExitStatus
  15418. );
  15419. end;
  15420. // Dynamic version of NtTestAlert
  15421. function NtTestAlert(): NTSTATUS; stdcall;
  15422. begin
  15423. GetProcedureAddress(_NtTestAlert, ntdll, 'NtTestAlert');
  15424. Result := TFNNtTestAlert(_NtTestAlert)();
  15425. end;
  15426. // Dynamic version of NtTestAlert
  15427. function ZwTestAlert(): NTSTATUS; stdcall;
  15428. begin
  15429. GetProcedureAddress(_NtTestAlert, ntdll, 'NtTestAlert');
  15430. Result := TFNNtTestAlert(_NtTestAlert)();
  15431. end;
  15432. // Dynamic version of NtUnloadDriver
  15433. function NtUnloadDriver(
  15434. DriverServiceName : PUNICODE_STRING
  15435. ): NTSTATUS; stdcall;
  15436. begin
  15437. GetProcedureAddress(_NtUnloadDriver, ntdll, 'NtUnloadDriver');
  15438. Result := TFNNtUnloadDriver(_NtUnloadDriver)(
  15439. DriverServiceName
  15440. );
  15441. end;
  15442. // Dynamic version of NtUnloadDriver
  15443. function ZwUnloadDriver(
  15444. DriverServiceName : PUNICODE_STRING
  15445. ): NTSTATUS; stdcall;
  15446. begin
  15447. GetProcedureAddress(_NtUnloadDriver, ntdll, 'NtUnloadDriver');
  15448. Result := TFNNtUnloadDriver(_NtUnloadDriver)(
  15449. DriverServiceName
  15450. );
  15451. end;
  15452. // Dynamic version of NtUnloadKey
  15453. function NtUnloadKey(
  15454. KeyObjectAttributes : POBJECT_ATTRIBUTES
  15455. ): NTSTATUS; stdcall;
  15456. begin
  15457. GetProcedureAddress(_NtUnloadKey, ntdll, 'NtUnloadKey');
  15458. Result := TFNNtUnloadKey(_NtUnloadKey)(
  15459. KeyObjectAttributes
  15460. );
  15461. end;
  15462. // Dynamic version of NtUnloadKey
  15463. function ZwUnloadKey(
  15464. KeyObjectAttributes : POBJECT_ATTRIBUTES
  15465. ): NTSTATUS; stdcall;
  15466. begin
  15467. GetProcedureAddress(_NtUnloadKey, ntdll, 'NtUnloadKey');
  15468. Result := TFNNtUnloadKey(_NtUnloadKey)(
  15469. KeyObjectAttributes
  15470. );
  15471. end;
  15472. // Dynamic version of NtUnlockFile
  15473. function NtUnlockFile(
  15474. FileHandle : HANDLE;
  15475. IoStatusBlock : PIO_STATUS_BLOCK;
  15476. LockOffset : PULARGE_INTEGER;
  15477. LockLength : PULARGE_INTEGER;
  15478. Key : ULONG
  15479. ): NTSTATUS; stdcall;
  15480. begin
  15481. GetProcedureAddress(_NtUnlockFile, ntdll, 'NtUnlockFile');
  15482. Result := TFNNtUnlockFile(_NtUnlockFile)(
  15483. FileHandle, IoStatusBlock, LockOffset, LockLength, Key
  15484. );
  15485. end;
  15486. // Dynamic version of NtUnlockFile
  15487. function ZwUnlockFile(
  15488. FileHandle : HANDLE;
  15489. IoStatusBlock : PIO_STATUS_BLOCK;
  15490. LockOffset : PULARGE_INTEGER;
  15491. LockLength : PULARGE_INTEGER;
  15492. Key : ULONG
  15493. ): NTSTATUS; stdcall;
  15494. begin
  15495. GetProcedureAddress(_NtUnlockFile, ntdll, 'NtUnlockFile');
  15496. Result := TFNNtUnlockFile(_NtUnlockFile)(
  15497. FileHandle, IoStatusBlock, LockOffset, LockLength, Key
  15498. );
  15499. end;
  15500. // Dynamic version of NtUnlockVirtualMemory
  15501. function NtUnlockVirtualMemory(
  15502. ProcessHandle : HANDLE;
  15503. BaseAddress : PPVOID;
  15504. LockSize : PULONG;
  15505. LockType : ULONG
  15506. ): NTSTATUS; stdcall;
  15507. begin
  15508. GetProcedureAddress(_NtUnlockVirtualMemory, ntdll, 'NtUnlockVirtualMemory');
  15509. Result := TFNNtUnlockVirtualMemory(_NtUnlockVirtualMemory)(
  15510. ProcessHandle, BaseAddress, LockSize, LockType
  15511. );
  15512. end;
  15513. // Dynamic version of NtUnlockVirtualMemory
  15514. function ZwUnlockVirtualMemory(
  15515. ProcessHandle : HANDLE;
  15516. BaseAddress : PPVOID;
  15517. LockSize : PULONG;
  15518. LockType : ULONG
  15519. ): NTSTATUS; stdcall;
  15520. begin
  15521. GetProcedureAddress(_NtUnlockVirtualMemory, ntdll, 'NtUnlockVirtualMemory');
  15522. Result := TFNNtUnlockVirtualMemory(_NtUnlockVirtualMemory)(
  15523. ProcessHandle, BaseAddress, LockSize, LockType
  15524. );
  15525. end;
  15526. // Dynamic version of NtUnmapViewOfSection
  15527. function NtUnmapViewOfSection(
  15528. ProcessHandle : HANDLE;
  15529. BaseAddress : PVOID
  15530. ): NTSTATUS; stdcall;
  15531. begin
  15532. GetProcedureAddress(_NtUnmapViewOfSection, ntdll, 'NtUnmapViewOfSection');
  15533. Result := TFNNtUnmapViewOfSection(_NtUnmapViewOfSection)(
  15534. ProcessHandle, BaseAddress
  15535. );
  15536. end;
  15537. // Dynamic version of NtUnmapViewOfSection
  15538. function ZwUnmapViewOfSection(
  15539. ProcessHandle : HANDLE;
  15540. BaseAddress : PVOID
  15541. ): NTSTATUS; stdcall;
  15542. begin
  15543. GetProcedureAddress(_NtUnmapViewOfSection, ntdll, 'NtUnmapViewOfSection');
  15544. Result := TFNNtUnmapViewOfSection(_NtUnmapViewOfSection)(
  15545. ProcessHandle, BaseAddress
  15546. );
  15547. end;
  15548. // Dynamic version of NtVdmControl
  15549. function NtVdmControl(
  15550. ControlCode : ULONG;
  15551. ControlData : PVOID
  15552. ): NTSTATUS; stdcall;
  15553. begin
  15554. GetProcedureAddress(_NtVdmControl, ntdll, 'NtVdmControl');
  15555. Result := TFNNtVdmControl(_NtVdmControl)(
  15556. ControlCode, ControlData
  15557. );
  15558. end;
  15559. // Dynamic version of NtVdmControl
  15560. function ZwVdmControl(
  15561. ControlCode : ULONG;
  15562. ControlData : PVOID
  15563. ): NTSTATUS; stdcall;
  15564. begin
  15565. GetProcedureAddress(_NtVdmControl, ntdll, 'NtVdmControl');
  15566. Result := TFNNtVdmControl(_NtVdmControl)(
  15567. ControlCode, ControlData
  15568. );
  15569. end;
  15570. // Dynamic version of NtW32Call
  15571. function NtW32Call(
  15572. RoutineIndex : ULONG;
  15573. Argument : PVOID;
  15574. ArgumentLength : ULONG;
  15575. Result_ : PPVOID;
  15576. ResultLength : PULONG
  15577. ): NTSTATUS; stdcall;
  15578. begin
  15579. GetProcedureAddress(_NtW32Call, ntdll, 'NtW32Call');
  15580. Result := TFNNtW32Call(_NtW32Call)(
  15581. RoutineIndex, Argument, ArgumentLength, Result_, ResultLength
  15582. );
  15583. end;
  15584. // Dynamic version of NtW32Call
  15585. function ZwW32Call(
  15586. RoutineIndex : ULONG;
  15587. Argument : PVOID;
  15588. ArgumentLength : ULONG;
  15589. Result_ : PPVOID;
  15590. ResultLength : PULONG
  15591. ): NTSTATUS; stdcall;
  15592. begin
  15593. GetProcedureAddress(_NtW32Call, ntdll, 'NtW32Call');
  15594. Result := TFNNtW32Call(_NtW32Call)(
  15595. RoutineIndex, Argument, ArgumentLength, Result_, ResultLength
  15596. );
  15597. end;
  15598. // Dynamic version of NtWaitForMultipleObjects
  15599. function NtWaitForMultipleObjects(
  15600. HandleCount : ULONG;
  15601. Handles : PHANDLE;
  15602. WaitType : WAIT_TYPE;
  15603. Alertable : BOOLEAN;
  15604. Timeout : PLARGE_INTEGER
  15605. ): NTSTATUS; stdcall;
  15606. begin
  15607. GetProcedureAddress(_NtWaitForMultipleObjects, ntdll, 'NtWaitForMultipleObjects');
  15608. Result := TFNNtWaitForMultipleObjects(_NtWaitForMultipleObjects)(
  15609. HandleCount, Handles, WaitType, Alertable, Timeout
  15610. );
  15611. end;
  15612. // Dynamic version of NtWaitForMultipleObjects
  15613. function ZwWaitForMultipleObjects(
  15614. HandleCount : ULONG;
  15615. Handles : PHANDLE;
  15616. WaitType : WAIT_TYPE;
  15617. Alertable : BOOLEAN;
  15618. Timeout : PLARGE_INTEGER
  15619. ): NTSTATUS; stdcall;
  15620. begin
  15621. GetProcedureAddress(_NtWaitForMultipleObjects, ntdll, 'NtWaitForMultipleObjects');
  15622. Result := TFNNtWaitForMultipleObjects(_NtWaitForMultipleObjects)(
  15623. HandleCount, Handles, WaitType, Alertable, Timeout
  15624. );
  15625. end;
  15626. {$IFNDEF JWA_INCLUDEMODE}
  15627. // Dynamic version of NtWaitForSingleObject
  15628. function NtWaitForSingleObject(
  15629. Handle : HANDLE;
  15630. Alertable : BOOLEAN;
  15631. Timeout : PLARGE_INTEGER
  15632. ): NTSTATUS; stdcall;
  15633. begin
  15634. GetProcedureAddress(_NtWaitForSingleObject, ntdll, 'NtWaitForSingleObject');
  15635. Result := TFNNtWaitForSingleObject(_NtWaitForSingleObject)(
  15636. Handle, Alertable, Timeout
  15637. );
  15638. end;
  15639. {$ENDIF JWA_INCLUDEMODE}
  15640. // Dynamic version of NtWaitForSingleObject
  15641. function ZwWaitForSingleObject(
  15642. Handle : HANDLE;
  15643. Alertable : BOOLEAN;
  15644. Timeout : PLARGE_INTEGER
  15645. ): NTSTATUS; stdcall;
  15646. begin
  15647. GetProcedureAddress(_NtWaitForSingleObject, ntdll, 'NtWaitForSingleObject');
  15648. Result := TFNNtWaitForSingleObject(_NtWaitForSingleObject)(
  15649. Handle, Alertable, Timeout
  15650. );
  15651. end;
  15652. // Dynamic version of NtWaitHighEventPair
  15653. function NtWaitHighEventPair(
  15654. EventPairHandle : HANDLE
  15655. ): NTSTATUS; stdcall;
  15656. begin
  15657. GetProcedureAddress(_NtWaitHighEventPair, ntdll, 'NtWaitHighEventPair');
  15658. Result := TFNNtWaitHighEventPair(_NtWaitHighEventPair)(
  15659. EventPairHandle
  15660. );
  15661. end;
  15662. // Dynamic version of NtWaitHighEventPair
  15663. function ZwWaitHighEventPair(
  15664. EventPairHandle : HANDLE
  15665. ): NTSTATUS; stdcall;
  15666. begin
  15667. GetProcedureAddress(_NtWaitHighEventPair, ntdll, 'NtWaitHighEventPair');
  15668. Result := TFNNtWaitHighEventPair(_NtWaitHighEventPair)(
  15669. EventPairHandle
  15670. );
  15671. end;
  15672. // Dynamic version of NtWaitLowEventPair
  15673. function NtWaitLowEventPair(
  15674. EventPairHandle : HANDLE
  15675. ): NTSTATUS; stdcall;
  15676. begin
  15677. GetProcedureAddress(_NtWaitLowEventPair, ntdll, 'NtWaitLowEventPair');
  15678. Result := TFNNtWaitLowEventPair(_NtWaitLowEventPair)(
  15679. EventPairHandle
  15680. );
  15681. end;
  15682. // Dynamic version of NtWaitLowEventPair
  15683. function ZwWaitLowEventPair(
  15684. EventPairHandle : HANDLE
  15685. ): NTSTATUS; stdcall;
  15686. begin
  15687. GetProcedureAddress(_NtWaitLowEventPair, ntdll, 'NtWaitLowEventPair');
  15688. Result := TFNNtWaitLowEventPair(_NtWaitLowEventPair)(
  15689. EventPairHandle
  15690. );
  15691. end;
  15692. // Dynamic version of NtWriteFile
  15693. function NtWriteFile(
  15694. FileHandle : HANDLE;
  15695. Event : HANDLE;
  15696. ApcRoutine : PIO_APC_ROUTINE;
  15697. ApcContext : PVOID;
  15698. IoStatusBlock : PIO_STATUS_BLOCK;
  15699. Buffer : PVOID;
  15700. Length : ULONG;
  15701. ByteOffset : PLARGE_INTEGER;
  15702. Key : PULONG
  15703. ): NTSTATUS; stdcall;
  15704. begin
  15705. GetProcedureAddress(_NtWriteFile, ntdll, 'NtWriteFile');
  15706. Result := TFNNtWriteFile(_NtWriteFile)(
  15707. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, Buffer, Length, ByteOffset, Key
  15708. );
  15709. end;
  15710. // Dynamic version of NtWriteFile
  15711. function ZwWriteFile(
  15712. FileHandle : HANDLE;
  15713. Event : HANDLE;
  15714. ApcRoutine : PIO_APC_ROUTINE;
  15715. ApcContext : PVOID;
  15716. IoStatusBlock : PIO_STATUS_BLOCK;
  15717. Buffer : PVOID;
  15718. Length : ULONG;
  15719. ByteOffset : PLARGE_INTEGER;
  15720. Key : PULONG
  15721. ): NTSTATUS; stdcall;
  15722. begin
  15723. GetProcedureAddress(_NtWriteFile, ntdll, 'NtWriteFile');
  15724. Result := TFNNtWriteFile(_NtWriteFile)(
  15725. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, Buffer, Length, ByteOffset, Key
  15726. );
  15727. end;
  15728. // Dynamic version of NtWriteFileGather
  15729. function NtWriteFileGather(
  15730. FileHandle : HANDLE;
  15731. Event : HANDLE;
  15732. ApcRoutine : PIO_APC_ROUTINE;
  15733. ApcContext : PVOID;
  15734. IoStatusBlock : PIO_STATUS_BLOCK;
  15735. Buffer : PFILE_SEGMENT_ELEMENT;
  15736. Length : ULONG;
  15737. ByteOffset : PLARGE_INTEGER;
  15738. Key : PULONG
  15739. ): NTSTATUS; stdcall;
  15740. begin
  15741. GetProcedureAddress(_NtWriteFileGather, ntdll, 'NtWriteFileGather');
  15742. Result := TFNNtWriteFileGather(_NtWriteFileGather)(
  15743. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, Buffer, Length, ByteOffset, Key
  15744. );
  15745. end;
  15746. // Dynamic version of NtWriteFileGather
  15747. function ZwWriteFileGather(
  15748. FileHandle : HANDLE;
  15749. Event : HANDLE;
  15750. ApcRoutine : PIO_APC_ROUTINE;
  15751. ApcContext : PVOID;
  15752. IoStatusBlock : PIO_STATUS_BLOCK;
  15753. Buffer : PFILE_SEGMENT_ELEMENT;
  15754. Length : ULONG;
  15755. ByteOffset : PLARGE_INTEGER;
  15756. Key : PULONG
  15757. ): NTSTATUS; stdcall;
  15758. begin
  15759. GetProcedureAddress(_NtWriteFileGather, ntdll, 'NtWriteFileGather');
  15760. Result := TFNNtWriteFileGather(_NtWriteFileGather)(
  15761. FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, Buffer, Length, ByteOffset, Key
  15762. );
  15763. end;
  15764. // Dynamic version of NtWriteRequestData
  15765. function NtWriteRequestData(
  15766. PortHandle : HANDLE;
  15767. Message : PPORT_MESSAGE;
  15768. Index : ULONG;
  15769. Buffer : PVOID;
  15770. BufferLength : ULONG;
  15771. ReturnLength : PULONG
  15772. ): NTSTATUS; stdcall;
  15773. begin
  15774. GetProcedureAddress(_NtWriteRequestData, ntdll, 'NtWriteRequestData');
  15775. Result := TFNNtWriteRequestData(_NtWriteRequestData)(
  15776. PortHandle, Message, Index, Buffer, BufferLength, ReturnLength
  15777. );
  15778. end;
  15779. // Dynamic version of NtWriteRequestData
  15780. function ZwWriteRequestData(
  15781. PortHandle : HANDLE;
  15782. Message : PPORT_MESSAGE;
  15783. Index : ULONG;
  15784. Buffer : PVOID;
  15785. BufferLength : ULONG;
  15786. ReturnLength : PULONG
  15787. ): NTSTATUS; stdcall;
  15788. begin
  15789. GetProcedureAddress(_NtWriteRequestData, ntdll, 'NtWriteRequestData');
  15790. Result := TFNNtWriteRequestData(_NtWriteRequestData)(
  15791. PortHandle, Message, Index, Buffer, BufferLength, ReturnLength
  15792. );
  15793. end;
  15794. // Dynamic version of NtWriteVirtualMemory
  15795. function NtWriteVirtualMemory(
  15796. ProcessHandle : HANDLE;
  15797. BaseAddress : PVOID;
  15798. Buffer : PVOID;
  15799. BufferLength : ULONG;
  15800. ReturnLength : PULONG
  15801. ): NTSTATUS; stdcall;
  15802. begin
  15803. GetProcedureAddress(_NtWriteVirtualMemory, ntdll, 'NtWriteVirtualMemory');
  15804. Result := TFNNtWriteVirtualMemory(_NtWriteVirtualMemory)(
  15805. ProcessHandle, BaseAddress, Buffer, BufferLength, ReturnLength
  15806. );
  15807. end;
  15808. // Dynamic version of NtWriteVirtualMemory
  15809. function ZwWriteVirtualMemory(
  15810. ProcessHandle : HANDLE;
  15811. BaseAddress : PVOID;
  15812. Buffer : PVOID;
  15813. BufferLength : ULONG;
  15814. ReturnLength : PULONG
  15815. ): NTSTATUS; stdcall;
  15816. begin
  15817. GetProcedureAddress(_NtWriteVirtualMemory, ntdll, 'NtWriteVirtualMemory');
  15818. Result := TFNNtWriteVirtualMemory(_NtWriteVirtualMemory)(
  15819. ProcessHandle, BaseAddress, Buffer, BufferLength, ReturnLength
  15820. );
  15821. end;
  15822. // Dynamic version of NtYieldExecution
  15823. function NtYieldExecution(): NTSTATUS; stdcall;
  15824. begin
  15825. GetProcedureAddress(_NtYieldExecution, ntdll, 'NtYieldExecution');
  15826. Result := TFNNtYieldExecution(_NtYieldExecution)();
  15827. end;
  15828. // Dynamic version of NtYieldExecution
  15829. function ZwYieldExecution(): NTSTATUS; stdcall;
  15830. begin
  15831. GetProcedureAddress(_NtYieldExecution, ntdll, 'NtYieldExecution');
  15832. Result := TFNNtYieldExecution(_NtYieldExecution)();
  15833. end;
  15834. // Dynamic version of RtlAbsoluteToSelfRelativeSD
  15835. function RtlAbsoluteToSelfRelativeSD(
  15836. pAbsoluteSD : PSECURITY_DESCRIPTOR;
  15837. pSelfRelativeSD : PSECURITY_DESCRIPTOR;
  15838. lpdwBufferLength : LPDWORD
  15839. ): NTSTATUS; stdcall;
  15840. begin
  15841. GetProcedureAddress(_RtlAbsoluteToSelfRelativeSD, ntdll, 'RtlAbsoluteToSelfRelativeSD');
  15842. Result := TFNRtlAbsoluteToSelfRelativeSD(_RtlAbsoluteToSelfRelativeSD)(
  15843. pAbsoluteSD, pSelfRelativeSD, lpdwBufferLength
  15844. );
  15845. end;
  15846. // Dynamic version of RtlAcquirePebLock
  15847. procedure RtlAcquirePebLock(); stdcall;
  15848. begin
  15849. GetProcedureAddress(_RtlAcquirePebLock, ntdll, 'RtlAcquirePebLock');
  15850. TFNRtlAcquirePebLock(_RtlAcquirePebLock)();
  15851. end;
  15852. // Dynamic version of RtlAddAccessAllowedAce
  15853. function RtlAddAccessAllowedAce(
  15854. pAcl : PACL;
  15855. dwAceRevision : DWORD;
  15856. AccessMask : ACCESS_MASK;
  15857. pSid : PSID
  15858. ): NTSTATUS; stdcall;
  15859. begin
  15860. GetProcedureAddress(_RtlAddAccessAllowedAce, ntdll, 'RtlAddAccessAllowedAce');
  15861. Result := TFNRtlAddAccessAllowedAce(_RtlAddAccessAllowedAce)(
  15862. pAcl, dwAceRevision, AccessMask, pSid
  15863. );
  15864. end;
  15865. // Dynamic version of RtlAddAccessAllowedAceEx
  15866. function RtlAddAccessAllowedAceEx(
  15867. pAcl : PACL;
  15868. dwAceRevision : DWORD;
  15869. AceFlags : DWORD;
  15870. AccessMask : ACCESS_MASK;
  15871. pSid : PSID
  15872. ): NTSTATUS; stdcall;
  15873. begin
  15874. GetProcedureAddress(_RtlAddAccessAllowedAceEx, ntdll, 'RtlAddAccessAllowedAceEx');
  15875. Result := TFNRtlAddAccessAllowedAceEx(_RtlAddAccessAllowedAceEx)(
  15876. pAcl, dwAceRevision, AceFlags, AccessMask, pSid
  15877. );
  15878. end;
  15879. // Dynamic version of RtlAddAccessDeniedAce
  15880. function RtlAddAccessDeniedAce(
  15881. pAcl : PACL;
  15882. dwAceRevision : DWORD;
  15883. AccessMask : ACCESS_MASK;
  15884. pSid : PSID
  15885. ): NTSTATUS; stdcall;
  15886. begin
  15887. GetProcedureAddress(_RtlAddAccessDeniedAce, ntdll, 'RtlAddAccessDeniedAce');
  15888. Result := TFNRtlAddAccessDeniedAce(_RtlAddAccessDeniedAce)(
  15889. pAcl, dwAceRevision, AccessMask, pSid
  15890. );
  15891. end;
  15892. // Dynamic version of RtlAddAccessDeniedAceEx
  15893. function RtlAddAccessDeniedAceEx(
  15894. pAcl : PACL;
  15895. dwAceRevision : DWORD;
  15896. AceFlags : DWORD;
  15897. AccessMask : ACCESS_MASK;
  15898. pSid : PSID
  15899. ): NTSTATUS; stdcall;
  15900. begin
  15901. GetProcedureAddress(_RtlAddAccessDeniedAceEx, ntdll, 'RtlAddAccessDeniedAceEx');
  15902. Result := TFNRtlAddAccessDeniedAceEx(_RtlAddAccessDeniedAceEx)(
  15903. pAcl, dwAceRevision, AceFlags, AccessMask, pSid
  15904. );
  15905. end;
  15906. // Dynamic version of RtlAddAce
  15907. function RtlAddAce(
  15908. pAcl : PACL;
  15909. dwAceRevision : DWORD;
  15910. dwStartingAceIndex : DWORD;
  15911. pAceList : PVOID;
  15912. nAceListLength : DWORD
  15913. ): NTSTATUS; stdcall;
  15914. begin
  15915. GetProcedureAddress(_RtlAddAce, ntdll, 'RtlAddAce');
  15916. Result := TFNRtlAddAce(_RtlAddAce)(
  15917. pAcl, dwAceRevision, dwStartingAceIndex, pAceList, nAceListLength
  15918. );
  15919. end;
  15920. // Dynamic version of RtlAddAuditAccessAce
  15921. function RtlAddAuditAccessAce(
  15922. pAcl : PACL;
  15923. dwAceRevision : DWORD;
  15924. AccessMask : ACCESS_MASK;
  15925. pSid : PSID;
  15926. bAuditSuccess : BOOLEAN;
  15927. bAuditFailure : BOOLEAN
  15928. ): NTSTATUS; stdcall;
  15929. begin
  15930. GetProcedureAddress(_RtlAddAuditAccessAce, ntdll, 'RtlAddAuditAccessAce');
  15931. Result := TFNRtlAddAuditAccessAce(_RtlAddAuditAccessAce)(
  15932. pAcl, dwAceRevision, AccessMask, pSid, bAuditSuccess, bAuditFailure
  15933. );
  15934. end;
  15935. // Dynamic version of RtlAddAuditAccessAceEx
  15936. function RtlAddAuditAccessAceEx(
  15937. pAcl : PACL;
  15938. dwAceRevision : DWORD;
  15939. AceFlags : DWORD;
  15940. AccessMask : ACCESS_MASK;
  15941. pSid : PSID;
  15942. bAuditSuccess : BOOLEAN;
  15943. bAuditFailure : BOOLEAN
  15944. ): NTSTATUS; stdcall;
  15945. begin
  15946. GetProcedureAddress(_RtlAddAuditAccessAceEx, ntdll, 'RtlAddAuditAccessAceEx');
  15947. Result := TFNRtlAddAuditAccessAceEx(_RtlAddAuditAccessAceEx)(
  15948. pAcl, dwAceRevision, AceFlags, AccessMask, pSid, bAuditSuccess, bAuditFailure
  15949. );
  15950. end;
  15951. // Dynamic version of RtlAddRange
  15952. function RtlAddRange(
  15953. RangeList : PRTL_RANGE_LIST;
  15954. Start : ULONGLONG;
  15955. End_ : ULONGLONG;
  15956. Attributes : UCHAR;
  15957. Flags : ULONG;
  15958. UserData : PVOID;
  15959. Owner : PVOID
  15960. ): NTSTATUS; stdcall;
  15961. begin
  15962. GetProcedureAddress(_RtlAddRange, ntdll, 'RtlAddRange');
  15963. Result := TFNRtlAddRange(_RtlAddRange)(
  15964. RangeList, Start, End_, Attributes, Flags, UserData, Owner
  15965. );
  15966. end;
  15967. // Dynamic version of RtlAddVectoredExceptionHandler
  15968. function RtlAddVectoredExceptionHandler(
  15969. FirstHandler : ULONG;
  15970. VectoredHandler : PVECTORED_EXCEPTION_HANDLER
  15971. ): PVOID; stdcall;
  15972. begin
  15973. GetProcedureAddress(_RtlAddVectoredExceptionHandler, ntdll, 'RtlAddVectoredExceptionHandler');
  15974. Result := TFNRtlAddVectoredExceptionHandler(_RtlAddVectoredExceptionHandler)(
  15975. FirstHandler, VectoredHandler
  15976. );
  15977. end;
  15978. // Dynamic version of RtlAdjustPrivilege
  15979. function RtlAdjustPrivilege(
  15980. Privilege : ULONG;
  15981. Enable : BOOLEAN;
  15982. CurrentThread : BOOLEAN;
  15983. Enabled : PBOOLEAN
  15984. ): NTSTATUS; stdcall;
  15985. begin
  15986. GetProcedureAddress(_RtlAdjustPrivilege, ntdll, 'RtlAdjustPrivilege');
  15987. Result := TFNRtlAdjustPrivilege(_RtlAdjustPrivilege)(
  15988. Privilege, Enable, CurrentThread, Enabled
  15989. );
  15990. end;
  15991. // Dynamic version of RtlAllocateAndInitializeSid
  15992. function RtlAllocateAndInitializeSid(
  15993. pIdentifierAuthority : PSID_IDENTIFIER_AUTHORITY;
  15994. SubAuthorityCount : BYTE;
  15995. nSubAuthority0 : DWORD;
  15996. nSubAuthority1 : DWORD;
  15997. nSubAuthority2 : DWORD;
  15998. nSubAuthority3 : DWORD;
  15999. nSubAuthority4 : DWORD;
  16000. nSubAuthority5 : DWORD;
  16001. nSubAuthority6 : DWORD;
  16002. nSubAuthority7 : DWORD;
  16003. var pSid : PSID
  16004. ): BOOL; stdcall;
  16005. begin
  16006. GetProcedureAddress(_RtlAllocateAndInitializeSid, ntdll, 'RtlAllocateAndInitializeSid');
  16007. Result := TFNRtlAllocateAndInitializeSid(_RtlAllocateAndInitializeSid)(
  16008. pIdentifierAuthority, SubAuthorityCount, nSubAuthority0, nSubAuthority1, nSubAuthority2, nSubAuthority3, nSubAuthority4, nSubAuthority5, nSubAuthority6, nSubAuthority7, pSid
  16009. );
  16010. end;
  16011. // Dynamic version of RtlAllocateHeap
  16012. function RtlAllocateHeap(
  16013. hHeap : HANDLE;
  16014. dwFlags : ULONG;
  16015. Size : ULONG
  16016. ): PVOID; stdcall;
  16017. begin
  16018. GetProcedureAddress(_RtlAllocateHeap, ntdll, 'RtlAllocateHeap');
  16019. Result := TFNRtlAllocateHeap(_RtlAllocateHeap)(
  16020. hHeap, dwFlags, Size
  16021. );
  16022. end;
  16023. // Dynamic version of RtlAnsiCharToUnicodeChar
  16024. function RtlAnsiCharToUnicodeChar(
  16025. AnsiChar : CHAR
  16026. ): WCHAR; stdcall;
  16027. begin
  16028. GetProcedureAddress(_RtlAnsiCharToUnicodeChar, ntdll, 'RtlAnsiCharToUnicodeChar');
  16029. Result := TFNRtlAnsiCharToUnicodeChar(_RtlAnsiCharToUnicodeChar)(
  16030. AnsiChar
  16031. );
  16032. end;
  16033. // Dynamic version of RtlAnsiStringToUnicodeSize
  16034. function RtlAnsiStringToUnicodeSize(
  16035. AnsiString : PANSI_STRING
  16036. ): ULONG; stdcall;
  16037. begin
  16038. GetProcedureAddress(_RtlAnsiStringToUnicodeSize, ntdll, 'RtlAnsiStringToUnicodeSize');
  16039. Result := TFNRtlAnsiStringToUnicodeSize(_RtlAnsiStringToUnicodeSize)(
  16040. AnsiString
  16041. );
  16042. end;
  16043. {$IFNDEF JWA_INCLUDEMODE}
  16044. // Dynamic version of RtlAnsiStringToUnicodeString
  16045. function RtlAnsiStringToUnicodeString(
  16046. DestinationString : PUNICODE_STRING;
  16047. SourceString : PANSI_STRING;
  16048. AllocateDestinationString : BOOLEAN
  16049. ): NTSTATUS; stdcall;
  16050. begin
  16051. GetProcedureAddress(_RtlAnsiStringToUnicodeString, ntdll, 'RtlAnsiStringToUnicodeString');
  16052. Result := TFNRtlAnsiStringToUnicodeString(_RtlAnsiStringToUnicodeString)(
  16053. DestinationString, SourceString, AllocateDestinationString
  16054. );
  16055. end;
  16056. {$ENDIF JWA_INCLUDEMODE}
  16057. // Dynamic version of RtlAppendAsciizToString
  16058. function RtlAppendAsciizToString(
  16059. DestinationString : PSTRING;
  16060. AppendThisString : LPCSTR
  16061. ): NTSTATUS; stdcall;
  16062. begin
  16063. GetProcedureAddress(_RtlAppendAsciizToString, ntdll, 'RtlAppendAsciizToString');
  16064. Result := TFNRtlAppendAsciizToString(_RtlAppendAsciizToString)(
  16065. DestinationString, AppendThisString
  16066. );
  16067. end;
  16068. // Dynamic version of RtlAppendStringToString
  16069. function RtlAppendStringToString(
  16070. DestinationString : PSTRING;
  16071. AppendThisString : PSTRING
  16072. ): NTSTATUS; stdcall;
  16073. begin
  16074. GetProcedureAddress(_RtlAppendStringToString, ntdll, 'RtlAppendStringToString');
  16075. Result := TFNRtlAppendStringToString(_RtlAppendStringToString)(
  16076. DestinationString, AppendThisString
  16077. );
  16078. end;
  16079. // Dynamic version of RtlAppendUnicodeStringToString
  16080. function RtlAppendUnicodeStringToString(
  16081. DestinationString : PUNICODE_STRING;
  16082. SourceString : PUNICODE_STRING
  16083. ): NTSTATUS; stdcall;
  16084. begin
  16085. GetProcedureAddress(_RtlAppendUnicodeStringToString, ntdll, 'RtlAppendUnicodeStringToString');
  16086. Result := TFNRtlAppendUnicodeStringToString(_RtlAppendUnicodeStringToString)(
  16087. DestinationString, SourceString
  16088. );
  16089. end;
  16090. // Dynamic version of RtlAppendUnicodeToString
  16091. function RtlAppendUnicodeToString(
  16092. Destination : PUNICODE_STRING;
  16093. Source : LPCWSTR
  16094. ): NTSTATUS; stdcall;
  16095. begin
  16096. GetProcedureAddress(_RtlAppendUnicodeToString, ntdll, 'RtlAppendUnicodeToString');
  16097. Result := TFNRtlAppendUnicodeToString(_RtlAppendUnicodeToString)(
  16098. Destination, Source
  16099. );
  16100. end;
  16101. // Dynamic version of RtlAreAllAccessesGranted
  16102. function RtlAreAllAccessesGranted(
  16103. GrantedAccess : ACCESS_MASK;
  16104. WantedAccess : ACCESS_MASK
  16105. ): BOOLEAN; stdcall;
  16106. begin
  16107. GetProcedureAddress(_RtlAreAllAccessesGranted, ntdll, 'RtlAreAllAccessesGranted');
  16108. Result := TFNRtlAreAllAccessesGranted(_RtlAreAllAccessesGranted)(
  16109. GrantedAccess, WantedAccess
  16110. );
  16111. end;
  16112. // Dynamic version of RtlAreAnyAccessesGranted
  16113. function RtlAreAnyAccessesGranted(
  16114. GrantedAccess : ACCESS_MASK;
  16115. WantedAccess : ACCESS_MASK
  16116. ): BOOLEAN; stdcall;
  16117. begin
  16118. GetProcedureAddress(_RtlAreAnyAccessesGranted, ntdll, 'RtlAreAnyAccessesGranted');
  16119. Result := TFNRtlAreAnyAccessesGranted(_RtlAreAnyAccessesGranted)(
  16120. GrantedAccess, WantedAccess
  16121. );
  16122. end;
  16123. // Dynamic version of RtlAreBitsClear
  16124. function RtlAreBitsClear(
  16125. BitMapHeader : PRTL_BITMAP;
  16126. StartingIndex : ULONG;
  16127. Length : ULONG
  16128. ): BOOLEAN; stdcall;
  16129. begin
  16130. GetProcedureAddress(_RtlAreBitsClear, ntdll, 'RtlAreBitsClear');
  16131. Result := TFNRtlAreBitsClear(_RtlAreBitsClear)(
  16132. BitMapHeader, StartingIndex, Length
  16133. );
  16134. end;
  16135. // Dynamic version of RtlAreBitsSet
  16136. function RtlAreBitsSet(
  16137. BitMapHeader : PRTL_BITMAP;
  16138. StartingIndex : ULONG;
  16139. Length : ULONG
  16140. ): BOOLEAN; stdcall;
  16141. begin
  16142. GetProcedureAddress(_RtlAreBitsSet, ntdll, 'RtlAreBitsSet');
  16143. Result := TFNRtlAreBitsSet(_RtlAreBitsSet)(
  16144. BitMapHeader, StartingIndex, Length
  16145. );
  16146. end;
  16147. // Dynamic version of RtlAssert
  16148. procedure RtlAssert(
  16149. FailedAssertion : PVOID;
  16150. FileName : PVOID;
  16151. LineNumber : ULONG;
  16152. Message : PCHAR
  16153. ); stdcall;
  16154. begin
  16155. GetProcedureAddress(_RtlAssert, ntdll, 'RtlAssert');
  16156. TFNRtlAssert(_RtlAssert)(
  16157. FailedAssertion, FileName, LineNumber, Message
  16158. );
  16159. end;
  16160. {$IFNDEF JWA_INCLUDEMODE}
  16161. // Dynamic version of RtlCaptureContext
  16162. procedure RtlCaptureContext(
  16163. ContextRecord : PCONTEXT
  16164. ); stdcall;
  16165. begin
  16166. GetProcedureAddress(_RtlCaptureContext, ntdll, 'RtlCaptureContext');
  16167. TFNRtlCaptureContext(_RtlCaptureContext)(
  16168. ContextRecord
  16169. );
  16170. end;
  16171. // Dynamic version of RtlCharToInteger
  16172. function RtlCharToInteger(
  16173. Str : PCSZ;
  16174. Base : ULONG;
  16175. Value : PULONG
  16176. ): NTSTATUS; stdcall;
  16177. begin
  16178. GetProcedureAddress(_RtlCharToInteger, ntdll, 'RtlCharToInteger');
  16179. Result := TFNRtlCharToInteger(_RtlCharToInteger)(
  16180. Str, Base, Value
  16181. );
  16182. end;
  16183. {$ENDIF JWA_INCLUDEMODE}
  16184. // Dynamic version of RtlCheckForOrphanedCriticalSections
  16185. procedure RtlCheckForOrphanedCriticalSections(
  16186. hThread : HANDLE
  16187. ); stdcall;
  16188. begin
  16189. GetProcedureAddress(_RtlCheckForOrphanedCriticalSections, ntdll, 'RtlCheckForOrphanedCriticalSections');
  16190. TFNRtlCheckForOrphanedCriticalSections(_RtlCheckForOrphanedCriticalSections)(
  16191. hThread
  16192. );
  16193. end;
  16194. // Dynamic version of RtlCheckRegistryKey
  16195. function RtlCheckRegistryKey(
  16196. RelativeTo : ULONG;
  16197. Path : PWSTR
  16198. ): NTSTATUS; stdcall;
  16199. begin
  16200. GetProcedureAddress(_RtlCheckRegistryKey, ntdll, 'RtlCheckRegistryKey');
  16201. Result := TFNRtlCheckRegistryKey(_RtlCheckRegistryKey)(
  16202. RelativeTo, Path
  16203. );
  16204. end;
  16205. // Dynamic version of RtlClearAllBits
  16206. procedure RtlClearAllBits(
  16207. BitMapHeader : PRTL_BITMAP
  16208. ); stdcall;
  16209. begin
  16210. GetProcedureAddress(_RtlClearAllBits, ntdll, 'RtlClearAllBits');
  16211. TFNRtlClearAllBits(_RtlClearAllBits)(
  16212. BitMapHeader
  16213. );
  16214. end;
  16215. // Dynamic version of RtlClearBits
  16216. procedure RtlClearBits(
  16217. BitMapHeader : PRTL_BITMAP;
  16218. StartingIndex : ULONG;
  16219. NumberToClear : ULONG
  16220. ); stdcall;
  16221. begin
  16222. GetProcedureAddress(_RtlClearBits, ntdll, 'RtlClearBits');
  16223. TFNRtlClearBits(_RtlClearBits)(
  16224. BitMapHeader, StartingIndex, NumberToClear
  16225. );
  16226. end;
  16227. // Dynamic version of RtlCompactHeap
  16228. function RtlCompactHeap(
  16229. hHeap : HANDLE;
  16230. dwFlags : ULONG
  16231. ): ULONG; stdcall;
  16232. begin
  16233. GetProcedureAddress(_RtlCompactHeap, ntdll, 'RtlCompactHeap');
  16234. Result := TFNRtlCompactHeap(_RtlCompactHeap)(
  16235. hHeap, dwFlags
  16236. );
  16237. end;
  16238. {$IFNDEF JWA_INCLUDEMODE}
  16239. // Dynamic version of RtlCompareMemory
  16240. function RtlCompareMemory(
  16241. Source1 : PVOID;
  16242. Source2 : PVOID;
  16243. Length : SIZE_T
  16244. ): SIZE_T; stdcall;
  16245. begin
  16246. GetProcedureAddress(_RtlCompareMemory, ntdll, 'RtlCompareMemory');
  16247. Result := TFNRtlCompareMemory(_RtlCompareMemory)(
  16248. Source1, Source2, Length
  16249. );
  16250. end;
  16251. {$ENDIF JWA_INCLUDEMODE}
  16252. // Dynamic version of RtlCompareMemoryUlong
  16253. function RtlCompareMemoryUlong(
  16254. Source : PVOID;
  16255. Length : ULONG;
  16256. Value : ULONG
  16257. ): ULONG; stdcall;
  16258. begin
  16259. GetProcedureAddress(_RtlCompareMemoryUlong, ntdll, 'RtlCompareMemoryUlong');
  16260. Result := TFNRtlCompareMemoryUlong(_RtlCompareMemoryUlong)(
  16261. Source, Length, Value
  16262. );
  16263. end;
  16264. // Dynamic version of RtlCompareString
  16265. function RtlCompareString(
  16266. String1 : PSTRING;
  16267. String2 : PSTRING;
  16268. CaseInsensitive : BOOLEAN
  16269. ): LONG; stdcall;
  16270. begin
  16271. GetProcedureAddress(_RtlCompareString, ntdll, 'RtlCompareString');
  16272. Result := TFNRtlCompareString(_RtlCompareString)(
  16273. String1, String2, CaseInsensitive
  16274. );
  16275. end;
  16276. // Dynamic version of RtlCompareUnicodeString
  16277. function RtlCompareUnicodeString(
  16278. String1 : PUNICODE_STRING;
  16279. String2 : PUNICODE_STRING;
  16280. CaseInsensitive : BOOLEAN
  16281. ): LONG; stdcall;
  16282. begin
  16283. GetProcedureAddress(_RtlCompareUnicodeString, ntdll, 'RtlCompareUnicodeString');
  16284. Result := TFNRtlCompareUnicodeString(_RtlCompareUnicodeString)(
  16285. String1, String2, CaseInsensitive
  16286. );
  16287. end;
  16288. // Dynamic version of RtlConvertLongToLargeInteger
  16289. function RtlConvertLongToLargeInteger(
  16290. SignedInteger : LONG
  16291. ): LARGE_INTEGER; stdcall;
  16292. begin
  16293. GetProcedureAddress(_RtlConvertLongToLargeInteger, ntdll, 'RtlConvertLongToLargeInteger');
  16294. Result := TFNRtlConvertLongToLargeInteger(_RtlConvertLongToLargeInteger)(
  16295. SignedInteger
  16296. );
  16297. end;
  16298. // Dynamic version of RtlConvertSidToUnicodeString
  16299. function RtlConvertSidToUnicodeString(
  16300. UnicodeString : PUNICODE_STRING;
  16301. Sid : PSID;
  16302. AllocateDestinationString : BOOLEAN
  16303. ): NTSTATUS; stdcall;
  16304. begin
  16305. GetProcedureAddress(_RtlConvertSidToUnicodeString, ntdll, 'RtlConvertSidToUnicodeString');
  16306. Result := TFNRtlConvertSidToUnicodeString(_RtlConvertSidToUnicodeString)(
  16307. UnicodeString, Sid, AllocateDestinationString
  16308. );
  16309. end;
  16310. // Dynamic version of RtlConvertUlongToLargeInteger
  16311. function RtlConvertUlongToLargeInteger(
  16312. UnsignedInteger : ULONG
  16313. ): LARGE_INTEGER; stdcall;
  16314. begin
  16315. GetProcedureAddress(_RtlConvertUlongToLargeInteger, ntdll, 'RtlConvertUlongToLargeInteger');
  16316. Result := TFNRtlConvertUlongToLargeInteger(_RtlConvertUlongToLargeInteger)(
  16317. UnsignedInteger
  16318. );
  16319. end;
  16320. // Dynamic version of RtlCopyLuid
  16321. procedure RtlCopyLuid(
  16322. Destination : PLUID;
  16323. Source : PLUID
  16324. ); stdcall;
  16325. begin
  16326. GetProcedureAddress(_RtlCopyLuid, ntdll, 'RtlCopyLuid');
  16327. TFNRtlCopyLuid(_RtlCopyLuid)(
  16328. Destination, Source
  16329. );
  16330. end;
  16331. // Dynamic version of RtlCopyRangeList
  16332. function RtlCopyRangeList(
  16333. CopyRangeList : PRTL_RANGE_LIST;
  16334. RangeList : PRTL_RANGE_LIST
  16335. ): NTSTATUS; stdcall;
  16336. begin
  16337. GetProcedureAddress(_RtlCopyRangeList, ntdll, 'RtlCopyRangeList');
  16338. Result := TFNRtlCopyRangeList(_RtlCopyRangeList)(
  16339. CopyRangeList, RangeList
  16340. );
  16341. end;
  16342. // Dynamic version of RtlCopySecurityDescriptor
  16343. function RtlCopySecurityDescriptor(
  16344. Source : PSECURITY_DESCRIPTOR;
  16345. var Destination : PSECURITY_DESCRIPTOR
  16346. ): NTSTATUS; stdcall;
  16347. begin
  16348. GetProcedureAddress(_RtlCopySecurityDescriptor, ntdll, 'RtlCopySecurityDescriptor');
  16349. Result := TFNRtlCopySecurityDescriptor(_RtlCopySecurityDescriptor)(
  16350. Source, Destination
  16351. );
  16352. end;
  16353. // Dynamic version of RtlCopySid
  16354. function RtlCopySid(
  16355. DestinationLength : ULONG;
  16356. Destination : PSID;
  16357. Source : PSID
  16358. ): NTSTATUS; stdcall;
  16359. begin
  16360. GetProcedureAddress(_RtlCopySid, ntdll, 'RtlCopySid');
  16361. Result := TFNRtlCopySid(_RtlCopySid)(
  16362. DestinationLength, Destination, Source
  16363. );
  16364. end;
  16365. // Dynamic version of RtlCopyString
  16366. procedure RtlCopyString(
  16367. DestinationString : PSTRING;
  16368. SourceString : PSTRING
  16369. ); stdcall;
  16370. begin
  16371. GetProcedureAddress(_RtlCopyString, ntdll, 'RtlCopyString');
  16372. TFNRtlCopyString(_RtlCopyString)(
  16373. DestinationString, SourceString
  16374. );
  16375. end;
  16376. // Dynamic version of RtlCopyUnicodeString
  16377. procedure RtlCopyUnicodeString(
  16378. DestinationString : PUNICODE_STRING;
  16379. SourceString : PUNICODE_STRING
  16380. ); stdcall;
  16381. begin
  16382. GetProcedureAddress(_RtlCopyUnicodeString, ntdll, 'RtlCopyUnicodeString');
  16383. TFNRtlCopyUnicodeString(_RtlCopyUnicodeString)(
  16384. DestinationString, SourceString
  16385. );
  16386. end;
  16387. // Dynamic version of RtlCreateAcl
  16388. function RtlCreateAcl(
  16389. pAcl : PACL;
  16390. nAclLength : DWORD;
  16391. dwAclRevision : DWORD
  16392. ): NTSTATUS; stdcall;
  16393. begin
  16394. GetProcedureAddress(_RtlCreateAcl, ntdll, 'RtlCreateAcl');
  16395. Result := TFNRtlCreateAcl(_RtlCreateAcl)(
  16396. pAcl, nAclLength, dwAclRevision
  16397. );
  16398. end;
  16399. // Dynamic version of RtlCreateHeap
  16400. function RtlCreateHeap(
  16401. dwOptions : ULONG;
  16402. Base : PVOID;
  16403. dwMaximumSize : SIZE_T;
  16404. dwInitialSize : SIZE_T;
  16405. UnknownOptional1 : PVOID;
  16406. UnknownOptional2 : PVOID
  16407. ): HANDLE; stdcall;
  16408. begin
  16409. GetProcedureAddress(_RtlCreateHeap, ntdll, 'RtlCreateHeap');
  16410. Result := TFNRtlCreateHeap(_RtlCreateHeap)(
  16411. dwOptions, Base, dwMaximumSize, dwInitialSize, UnknownOptional1, UnknownOptional2
  16412. );
  16413. end;
  16414. // Dynamic version of RtlCreateProcessParameters
  16415. function RtlCreateProcessParameters(
  16416. ProcessParameters : PPRTL_USER_PROCESS_PARAMETERS;
  16417. ImageFile : PUNICODE_STRING;
  16418. DllPath : PUNICODE_STRING;
  16419. CurrentDirectory : PUNICODE_STRING;
  16420. CommandLine : PUNICODE_STRING;
  16421. CreationFlags : ULONG;
  16422. WindowTitle : PUNICODE_STRING;
  16423. Desktop : PUNICODE_STRING;
  16424. Reserved : PUNICODE_STRING;
  16425. Reserved2 : PUNICODE_STRING
  16426. ): NTSTATUS; stdcall;
  16427. begin
  16428. GetProcedureAddress(_RtlCreateProcessParameters, ntdll, 'RtlCreateProcessParameters');
  16429. Result := TFNRtlCreateProcessParameters(_RtlCreateProcessParameters)(
  16430. ProcessParameters, ImageFile, DllPath, CurrentDirectory, CommandLine, CreationFlags, WindowTitle, Desktop, Reserved, Reserved2
  16431. );
  16432. end;
  16433. // Dynamic version of RtlCreateQueryDebugBuffer
  16434. function RtlCreateQueryDebugBuffer(
  16435. Size : ULONG;
  16436. EventPair : BOOLEAN
  16437. ): PDEBUG_BUFFER; stdcall;
  16438. begin
  16439. GetProcedureAddress(_RtlCreateQueryDebugBuffer, ntdll, 'RtlCreateQueryDebugBuffer');
  16440. Result := TFNRtlCreateQueryDebugBuffer(_RtlCreateQueryDebugBuffer)(
  16441. Size, EventPair
  16442. );
  16443. end;
  16444. // Dynamic version of RtlCreateRegistryKey
  16445. function RtlCreateRegistryKey(
  16446. RelativeTo : ULONG;
  16447. Path : PWSTR
  16448. ): NTSTATUS; stdcall;
  16449. begin
  16450. GetProcedureAddress(_RtlCreateRegistryKey, ntdll, 'RtlCreateRegistryKey');
  16451. Result := TFNRtlCreateRegistryKey(_RtlCreateRegistryKey)(
  16452. RelativeTo, Path
  16453. );
  16454. end;
  16455. // Dynamic version of RtlCreateSecurityDescriptor
  16456. function RtlCreateSecurityDescriptor(
  16457. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  16458. Revision : ULONG
  16459. ): NTSTATUS; stdcall;
  16460. begin
  16461. GetProcedureAddress(_RtlCreateSecurityDescriptor, ntdll, 'RtlCreateSecurityDescriptor');
  16462. Result := TFNRtlCreateSecurityDescriptor(_RtlCreateSecurityDescriptor)(
  16463. SecurityDescriptor, Revision
  16464. );
  16465. end;
  16466. // Dynamic version of RtlCreateUnicodeString
  16467. function RtlCreateUnicodeString(
  16468. DestinationString : PUNICODE_STRING;
  16469. SourceString : PWSTR
  16470. ): BOOLEAN; stdcall;
  16471. begin
  16472. GetProcedureAddress(_RtlCreateUnicodeString, ntdll, 'RtlCreateUnicodeString');
  16473. Result := TFNRtlCreateUnicodeString(_RtlCreateUnicodeString)(
  16474. DestinationString, SourceString
  16475. );
  16476. end;
  16477. // Dynamic version of RtlCreateUnicodeStringFromAsciiz
  16478. function RtlCreateUnicodeStringFromAsciiz(
  16479. DestinationString : PUNICODE_STRING;
  16480. SourceString : PCHAR
  16481. ): BOOLEAN; stdcall;
  16482. begin
  16483. GetProcedureAddress(_RtlCreateUnicodeStringFromAsciiz, ntdll, 'RtlCreateUnicodeStringFromAsciiz');
  16484. Result := TFNRtlCreateUnicodeStringFromAsciiz(_RtlCreateUnicodeStringFromAsciiz)(
  16485. DestinationString, SourceString
  16486. );
  16487. end;
  16488. // Dynamic version of RtlCreateUserProcess
  16489. function RtlCreateUserProcess(
  16490. ImageFileName : PUNICODE_STRING;
  16491. Attributes : ULONG;
  16492. ProcessParameters : PRTL_USER_PROCESS_PARAMETERS;
  16493. ProcessSecurityDescriptor : PSECURITY_DESCRIPTOR;
  16494. ThreadSecurityDescriptor : PSECURITY_DESCRIPTOR;
  16495. ParentProcess : HANDLE;
  16496. InheritHandles : BOOLEAN;
  16497. DebugPort : HANDLE;
  16498. ExceptionPort : HANDLE;
  16499. ProcessInfo : PRTL_PROCESS_INFORMATION
  16500. ): NTSTATUS; stdcall;
  16501. begin
  16502. GetProcedureAddress(_RtlCreateUserProcess, ntdll, 'RtlCreateUserProcess');
  16503. Result := TFNRtlCreateUserProcess(_RtlCreateUserProcess)(
  16504. ImageFileName, Attributes, ProcessParameters, ProcessSecurityDescriptor, ThreadSecurityDescriptor, ParentProcess, InheritHandles, DebugPort, ExceptionPort, ProcessInfo
  16505. );
  16506. end;
  16507. // Dynamic version of RtlCreateUserThread
  16508. function RtlCreateUserThread(
  16509. hProcess : HANDLE;
  16510. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  16511. CreateSuspended : BOOLEAN;
  16512. StackZeroBits : ULONG;
  16513. StackReserve : ULONG;
  16514. StackCommit : ULONG;
  16515. lpStartAddress : PTHREAD_START_ROUTINE;
  16516. lpParameter : PVOID;
  16517. phThread : PHANDLE;
  16518. ClientId : PCLIENT_ID
  16519. ): NTSTATUS; stdcall;
  16520. begin
  16521. GetProcedureAddress(_RtlCreateUserThread, ntdll, 'RtlCreateUserThread');
  16522. Result := TFNRtlCreateUserThread(_RtlCreateUserThread)(
  16523. hProcess, SecurityDescriptor, CreateSuspended, StackZeroBits, StackReserve, StackCommit, lpStartAddress, lpParameter, phThread, ClientId
  16524. );
  16525. end;
  16526. // Dynamic version of RtlCutoverTimeToSystemTime
  16527. function RtlCutoverTimeToSystemTime(
  16528. TargetTimeFields : PTIME_FIELDS;
  16529. Time : PLARGE_INTEGER;
  16530. CurrentTime : PLARGE_INTEGER;
  16531. bUnknown : BOOLEAN
  16532. ): BOOLEAN; stdcall;
  16533. begin
  16534. GetProcedureAddress(_RtlCutoverTimeToSystemTime, ntdll, 'RtlCutoverTimeToSystemTime');
  16535. Result := TFNRtlCutoverTimeToSystemTime(_RtlCutoverTimeToSystemTime)(
  16536. TargetTimeFields, Time, CurrentTime, bUnknown
  16537. );
  16538. end;
  16539. // Dynamic version of RtlDeNormalizeProcessParams
  16540. function RtlDeNormalizeProcessParams(
  16541. ProcessParameters : PRTL_USER_PROCESS_PARAMETERS
  16542. ): PRTL_USER_PROCESS_PARAMETERS; stdcall;
  16543. begin
  16544. GetProcedureAddress(_RtlDeNormalizeProcessParams, ntdll, 'RtlDeNormalizeProcessParams');
  16545. Result := TFNRtlDeNormalizeProcessParams(_RtlDeNormalizeProcessParams)(
  16546. ProcessParameters
  16547. );
  16548. end;
  16549. // Dynamic version of RtlDeleteAce
  16550. function RtlDeleteAce(
  16551. pAcl : PACL;
  16552. dwAceIndex : DWORD
  16553. ): NTSTATUS; stdcall;
  16554. begin
  16555. GetProcedureAddress(_RtlDeleteAce, ntdll, 'RtlDeleteAce');
  16556. Result := TFNRtlDeleteAce(_RtlDeleteAce)(
  16557. pAcl, dwAceIndex
  16558. );
  16559. end;
  16560. // Dynamic version of RtlDeleteCriticalSection
  16561. procedure RtlDeleteCriticalSection(
  16562. lpCriticalSection : PRTL_CRITICAL_SECTION
  16563. ); stdcall;
  16564. begin
  16565. GetProcedureAddress(_RtlDeleteCriticalSection, ntdll, 'RtlDeleteCriticalSection');
  16566. TFNRtlDeleteCriticalSection(_RtlDeleteCriticalSection)(
  16567. lpCriticalSection
  16568. );
  16569. end;
  16570. // Dynamic version of RtlDeleteOwnersRanges
  16571. function RtlDeleteOwnersRanges(
  16572. RangeList : PRTL_RANGE_LIST;
  16573. Owner : PVOID
  16574. ): NTSTATUS; stdcall;
  16575. begin
  16576. GetProcedureAddress(_RtlDeleteOwnersRanges, ntdll, 'RtlDeleteOwnersRanges');
  16577. Result := TFNRtlDeleteOwnersRanges(_RtlDeleteOwnersRanges)(
  16578. RangeList, Owner
  16579. );
  16580. end;
  16581. // Dynamic version of RtlDeleteRange
  16582. function RtlDeleteRange(
  16583. RangeList : PRTL_RANGE_LIST;
  16584. Start : ULONGLONG;
  16585. End_ : ULONGLONG;
  16586. Owner : PVOID
  16587. ): NTSTATUS; stdcall;
  16588. begin
  16589. GetProcedureAddress(_RtlDeleteRange, ntdll, 'RtlDeleteRange');
  16590. Result := TFNRtlDeleteRange(_RtlDeleteRange)(
  16591. RangeList, Start, End_, Owner
  16592. );
  16593. end;
  16594. // Dynamic version of RtlDeleteRegistryValue
  16595. function RtlDeleteRegistryValue(
  16596. RelativeTo : ULONG;
  16597. Path : LPCWSTR;
  16598. ValueName : LPCWSTR
  16599. ): NTSTATUS; stdcall;
  16600. begin
  16601. GetProcedureAddress(_RtlDeleteRegistryValue, ntdll, 'RtlDeleteRegistryValue');
  16602. Result := TFNRtlDeleteRegistryValue(_RtlDeleteRegistryValue)(
  16603. RelativeTo, Path, ValueName
  16604. );
  16605. end;
  16606. // Dynamic version of RtlDestroyHeap
  16607. function RtlDestroyHeap(
  16608. HeapHandle : HANDLE
  16609. ): HANDLE; stdcall;
  16610. begin
  16611. GetProcedureAddress(_RtlDestroyHeap, ntdll, 'RtlDestroyHeap');
  16612. Result := TFNRtlDestroyHeap(_RtlDestroyHeap)(
  16613. HeapHandle
  16614. );
  16615. end;
  16616. // Dynamic version of RtlDestroyProcessParameters
  16617. function RtlDestroyProcessParameters(
  16618. ProcessParameters : PRTL_USER_PROCESS_PARAMETERS
  16619. ): NTSTATUS; stdcall;
  16620. begin
  16621. GetProcedureAddress(_RtlDestroyProcessParameters, ntdll, 'RtlDestroyProcessParameters');
  16622. Result := TFNRtlDestroyProcessParameters(_RtlDestroyProcessParameters)(
  16623. ProcessParameters
  16624. );
  16625. end;
  16626. // Dynamic version of RtlDestroyQueryDebugBuffer
  16627. function RtlDestroyQueryDebugBuffer(
  16628. DebugBuffer : PDEBUG_BUFFER
  16629. ): NTSTATUS; stdcall;
  16630. begin
  16631. GetProcedureAddress(_RtlDestroyQueryDebugBuffer, ntdll, 'RtlDestroyQueryDebugBuffer');
  16632. Result := TFNRtlDestroyQueryDebugBuffer(_RtlDestroyQueryDebugBuffer)(
  16633. DebugBuffer
  16634. );
  16635. end;
  16636. // Dynamic version of RtlDetermineDosPathNameType_U
  16637. function RtlDetermineDosPathNameType_U(
  16638. wcsPathNameType : PWSTR
  16639. ): ULONG; stdcall;
  16640. begin
  16641. GetProcedureAddress(_RtlDetermineDosPathNameType_U, ntdll, 'RtlDetermineDosPathNameType_U');
  16642. Result := TFNRtlDetermineDosPathNameType_U(_RtlDetermineDosPathNameType_U)(
  16643. wcsPathNameType
  16644. );
  16645. end;
  16646. // Dynamic version of RtlDnsHostNameToComputerName
  16647. function RtlDnsHostNameToComputerName(
  16648. ComputerName : PUNICODE_STRING;
  16649. DnsName : PUNICODE_STRING;
  16650. AllocateComputerNameString : BOOLEAN
  16651. ): NTSTATUS; stdcall;
  16652. begin
  16653. GetProcedureAddress(_RtlDnsHostNameToComputerName, ntdll, 'RtlDnsHostNameToComputerName');
  16654. Result := TFNRtlDnsHostNameToComputerName(_RtlDnsHostNameToComputerName)(
  16655. ComputerName, DnsName, AllocateComputerNameString
  16656. );
  16657. end;
  16658. // Dynamic version of RtlDoesFileExists_U
  16659. function RtlDoesFileExists_U(
  16660. FileName : PWSTR
  16661. ): BOOLEAN; stdcall;
  16662. begin
  16663. GetProcedureAddress(_RtlDoesFileExists_U, ntdll, 'RtlDoesFileExists_U');
  16664. Result := TFNRtlDoesFileExists_U(_RtlDoesFileExists_U)(
  16665. FileName
  16666. );
  16667. end;
  16668. // Dynamic version of RtlDosPathNameToNtPathName_U
  16669. function RtlDosPathNameToNtPathName_U(
  16670. DosName : PWSTR;
  16671. var NtName : UNICODE_STRING;
  16672. DosFilePath : PPWSTR;
  16673. NtFilePath : PUNICODE_STRING
  16674. ): BOOLEAN; stdcall;
  16675. begin
  16676. GetProcedureAddress(_RtlDosPathNameToNtPathName_U, ntdll, 'RtlDosPathNameToNtPathName_U');
  16677. Result := TFNRtlDosPathNameToNtPathName_U(_RtlDosPathNameToNtPathName_U)(
  16678. DosName, NtName, DosFilePath, NtFilePath
  16679. );
  16680. end;
  16681. // Dynamic version of RtlDosSearchPath_U
  16682. function RtlDosSearchPath_U(
  16683. SearchPath : PWSTR;
  16684. Name : PWSTR;
  16685. Ext : PWSTR;
  16686. cbBuf : ULONG;
  16687. Buffer : PWSTR;
  16688. var Shortname : PWSTR
  16689. ): ULONG; stdcall;
  16690. begin
  16691. GetProcedureAddress(_RtlDosSearchPath_U, ntdll, 'RtlDosSearchPath_U');
  16692. Result := TFNRtlDosSearchPath_U(_RtlDosSearchPath_U)(
  16693. SearchPath, Name, Ext, cbBuf, Buffer, Shortname
  16694. );
  16695. end;
  16696. // Dynamic version of RtlDowncaseUnicodeChar
  16697. function RtlDowncaseUnicodeChar(
  16698. Source : WCHAR
  16699. ): WCHAR; stdcall;
  16700. begin
  16701. GetProcedureAddress(_RtlDowncaseUnicodeChar, ntdll, 'RtlDowncaseUnicodeChar');
  16702. Result := TFNRtlDowncaseUnicodeChar(_RtlDowncaseUnicodeChar)(
  16703. Source
  16704. );
  16705. end;
  16706. // Dynamic version of RtlDowncaseUnicodeString
  16707. function RtlDowncaseUnicodeString(
  16708. DestinationString : PUNICODE_STRING;
  16709. SourceString : PUNICODE_STRING;
  16710. AllocateDestinationString : BOOLEAN
  16711. ): NTSTATUS; stdcall;
  16712. begin
  16713. GetProcedureAddress(_RtlDowncaseUnicodeString, ntdll, 'RtlDowncaseUnicodeString');
  16714. Result := TFNRtlDowncaseUnicodeString(_RtlDowncaseUnicodeString)(
  16715. DestinationString, SourceString, AllocateDestinationString
  16716. );
  16717. end;
  16718. // Dynamic version of RtlDuplicateUnicodeString
  16719. function RtlDuplicateUnicodeString(
  16720. AddTerminatingZero : ULONG;
  16721. Source : PUNICODE_STRING;
  16722. Destination : PUNICODE_STRING
  16723. ): NTSTATUS; stdcall;
  16724. begin
  16725. GetProcedureAddress(_RtlDuplicateUnicodeString, ntdll, 'RtlDuplicateUnicodeString');
  16726. Result := TFNRtlDuplicateUnicodeString(_RtlDuplicateUnicodeString)(
  16727. AddTerminatingZero, Source, Destination
  16728. );
  16729. end;
  16730. // Dynamic version of RtlEnableEarlyCriticalSectionEventCreation
  16731. procedure RtlEnableEarlyCriticalSectionEventCreation(); stdcall;
  16732. begin
  16733. GetProcedureAddress(_RtlEnableEarlyCriticalSectionEventCreation, ntdll, 'RtlEnableEarlyCriticalSectionEventCreation');
  16734. TFNRtlEnableEarlyCriticalSectionEventCreation(_RtlEnableEarlyCriticalSectionEventCreation)();
  16735. end;
  16736. // Dynamic version of RtlEnlargedIntegerMultiply
  16737. function RtlEnlargedIntegerMultiply(
  16738. Multiplicand : LONG;
  16739. Multiplier : LONG
  16740. ): LARGE_INTEGER; stdcall;
  16741. begin
  16742. GetProcedureAddress(_RtlEnlargedIntegerMultiply, ntdll, 'RtlEnlargedIntegerMultiply');
  16743. Result := TFNRtlEnlargedIntegerMultiply(_RtlEnlargedIntegerMultiply)(
  16744. Multiplicand, Multiplier
  16745. );
  16746. end;
  16747. // Dynamic version of RtlEnlargedUnsignedDivide
  16748. function RtlEnlargedUnsignedDivide(
  16749. Dividend : ULARGE_INTEGER;
  16750. Divisor : ULONG;
  16751. Remainder : PULONG
  16752. ): ULONG; stdcall;
  16753. begin
  16754. GetProcedureAddress(_RtlEnlargedUnsignedDivide, ntdll, 'RtlEnlargedUnsignedDivide');
  16755. Result := TFNRtlEnlargedUnsignedDivide(_RtlEnlargedUnsignedDivide)(
  16756. Dividend, Divisor, Remainder
  16757. );
  16758. end;
  16759. // Dynamic version of RtlEnlargedUnsignedMultiply
  16760. function RtlEnlargedUnsignedMultiply(
  16761. Multiplicand : ULONG;
  16762. Multiplier : ULONG
  16763. ): LARGE_INTEGER; stdcall;
  16764. begin
  16765. GetProcedureAddress(_RtlEnlargedUnsignedMultiply, ntdll, 'RtlEnlargedUnsignedMultiply');
  16766. Result := TFNRtlEnlargedUnsignedMultiply(_RtlEnlargedUnsignedMultiply)(
  16767. Multiplicand, Multiplier
  16768. );
  16769. end;
  16770. // Dynamic version of RtlEnterCriticalSection
  16771. procedure RtlEnterCriticalSection(
  16772. lpCriticalSection : PRTL_CRITICAL_SECTION
  16773. ); stdcall;
  16774. begin
  16775. GetProcedureAddress(_RtlEnterCriticalSection, ntdll, 'RtlEnterCriticalSection');
  16776. TFNRtlEnterCriticalSection(_RtlEnterCriticalSection)(
  16777. lpCriticalSection
  16778. );
  16779. end;
  16780. // Dynamic version of RtlEqualComputerName
  16781. function RtlEqualComputerName(
  16782. String1 : PUNICODE_STRING;
  16783. String2 : PUNICODE_STRING
  16784. ): BOOLEAN; stdcall;
  16785. begin
  16786. GetProcedureAddress(_RtlEqualComputerName, ntdll, 'RtlEqualComputerName');
  16787. Result := TFNRtlEqualComputerName(_RtlEqualComputerName)(
  16788. String1, String2
  16789. );
  16790. end;
  16791. // Dynamic version of RtlEqualDomainName
  16792. function RtlEqualDomainName(
  16793. String1 : PUNICODE_STRING;
  16794. String2 : PUNICODE_STRING
  16795. ): BOOLEAN; stdcall;
  16796. begin
  16797. GetProcedureAddress(_RtlEqualDomainName, ntdll, 'RtlEqualDomainName');
  16798. Result := TFNRtlEqualDomainName(_RtlEqualDomainName)(
  16799. String1, String2
  16800. );
  16801. end;
  16802. // Dynamic version of RtlEqualLuid
  16803. function RtlEqualLuid(
  16804. Luid1 : PLUID;
  16805. Luid2 : PLUID
  16806. ): BOOLEAN; stdcall;
  16807. begin
  16808. GetProcedureAddress(_RtlEqualLuid, ntdll, 'RtlEqualLuid');
  16809. Result := TFNRtlEqualLuid(_RtlEqualLuid)(
  16810. Luid1, Luid2
  16811. );
  16812. end;
  16813. // Dynamic version of RtlEqualPrefixSid
  16814. function RtlEqualPrefixSid(
  16815. pSid1 : PSID;
  16816. pSid2 : PSID
  16817. ): BOOLEAN; stdcall;
  16818. begin
  16819. GetProcedureAddress(_RtlEqualPrefixSid, ntdll, 'RtlEqualPrefixSid');
  16820. Result := TFNRtlEqualPrefixSid(_RtlEqualPrefixSid)(
  16821. pSid1, pSid2
  16822. );
  16823. end;
  16824. // Dynamic version of RtlEqualSid
  16825. function RtlEqualSid(
  16826. pSid1 : PSID;
  16827. pSid2 : PSID
  16828. ): BOOLEAN; stdcall;
  16829. begin
  16830. GetProcedureAddress(_RtlEqualSid, ntdll, 'RtlEqualSid');
  16831. Result := TFNRtlEqualSid(_RtlEqualSid)(
  16832. pSid1, pSid2
  16833. );
  16834. end;
  16835. // Dynamic version of RtlEqualString
  16836. function RtlEqualString(
  16837. String1 : PSTRING;
  16838. String2 : PSTRING;
  16839. CaseInsensitive : BOOLEAN
  16840. ): BOOLEAN; stdcall;
  16841. begin
  16842. GetProcedureAddress(_RtlEqualString, ntdll, 'RtlEqualString');
  16843. Result := TFNRtlEqualString(_RtlEqualString)(
  16844. String1, String2, CaseInsensitive
  16845. );
  16846. end;
  16847. // Dynamic version of RtlEqualUnicodeString
  16848. function RtlEqualUnicodeString(
  16849. String1 : PUNICODE_STRING;
  16850. String2 : PUNICODE_STRING;
  16851. CaseInsensitive : BOOLEAN
  16852. ): BOOLEAN; stdcall;
  16853. begin
  16854. GetProcedureAddress(_RtlEqualUnicodeString, ntdll, 'RtlEqualUnicodeString');
  16855. Result := TFNRtlEqualUnicodeString(_RtlEqualUnicodeString)(
  16856. String1, String2, CaseInsensitive
  16857. );
  16858. end;
  16859. // Dynamic version of RtlEraseUnicodeString
  16860. procedure RtlEraseUnicodeString(
  16861. Str : PUNICODE_STRING
  16862. ); stdcall;
  16863. begin
  16864. GetProcedureAddress(_RtlEraseUnicodeString, ntdll, 'RtlEraseUnicodeString');
  16865. TFNRtlEraseUnicodeString(_RtlEraseUnicodeString)(
  16866. Str
  16867. );
  16868. end;
  16869. // Dynamic version of RtlExpandEnvironmentStrings_U
  16870. function RtlExpandEnvironmentStrings_U(
  16871. Environment : PVOID;
  16872. Source : PUNICODE_STRING;
  16873. Destination : PUNICODE_STRING;
  16874. ReturnedLength : PULONG
  16875. ): NTSTATUS; stdcall;
  16876. begin
  16877. GetProcedureAddress(_RtlExpandEnvironmentStrings_U, ntdll, 'RtlExpandEnvironmentStrings_U');
  16878. Result := TFNRtlExpandEnvironmentStrings_U(_RtlExpandEnvironmentStrings_U)(
  16879. Environment, Source, Destination, ReturnedLength
  16880. );
  16881. end;
  16882. // Dynamic version of RtlExtendedIntegerMultiply
  16883. function RtlExtendedIntegerMultiply(
  16884. Multiplicand : LARGE_INTEGER;
  16885. Multiplier : LONG
  16886. ): LARGE_INTEGER; stdcall;
  16887. begin
  16888. GetProcedureAddress(_RtlExtendedIntegerMultiply, ntdll, 'RtlExtendedIntegerMultiply');
  16889. Result := TFNRtlExtendedIntegerMultiply(_RtlExtendedIntegerMultiply)(
  16890. Multiplicand, Multiplier
  16891. );
  16892. end;
  16893. // Dynamic version of RtlExtendedLargeIntegerDivide
  16894. function RtlExtendedLargeIntegerDivide(
  16895. Dividend : LARGE_INTEGER;
  16896. Divisor : ULONG;
  16897. Remainder : PULONG
  16898. ): LARGE_INTEGER; stdcall;
  16899. begin
  16900. GetProcedureAddress(_RtlExtendedLargeIntegerDivide, ntdll, 'RtlExtendedLargeIntegerDivide');
  16901. Result := TFNRtlExtendedLargeIntegerDivide(_RtlExtendedLargeIntegerDivide)(
  16902. Dividend, Divisor, Remainder
  16903. );
  16904. end;
  16905. // Dynamic version of RtlExtendedMagicDivide
  16906. function RtlExtendedMagicDivide(
  16907. Dividend : LARGE_INTEGER;
  16908. MagicDivisor : LARGE_INTEGER;
  16909. ShiftCount : CCHAR
  16910. ): LARGE_INTEGER; stdcall;
  16911. begin
  16912. GetProcedureAddress(_RtlExtendedMagicDivide, ntdll, 'RtlExtendedMagicDivide');
  16913. Result := TFNRtlExtendedMagicDivide(_RtlExtendedMagicDivide)(
  16914. Dividend, MagicDivisor, ShiftCount
  16915. );
  16916. end;
  16917. // Dynamic version of RtlFillMemory
  16918. procedure RtlFillMemory(
  16919. Destination : PVOID;
  16920. Length : SIZE_T;
  16921. Fill : UCHAR
  16922. ); stdcall;
  16923. begin
  16924. GetProcedureAddress(_RtlFillMemory, ntdll, 'RtlFillMemory');
  16925. TFNRtlFillMemory(_RtlFillMemory)(
  16926. Destination, Length, Fill
  16927. );
  16928. end;
  16929. // Dynamic version of RtlFillMemoryUlong
  16930. procedure RtlFillMemoryUlong(
  16931. Destination : PVOID;
  16932. Length : ULONG;
  16933. Fill : ULONG
  16934. ); stdcall;
  16935. begin
  16936. GetProcedureAddress(_RtlFillMemoryUlong, ntdll, 'RtlFillMemoryUlong');
  16937. TFNRtlFillMemoryUlong(_RtlFillMemoryUlong)(
  16938. Destination, Length, Fill
  16939. );
  16940. end;
  16941. // Dynamic version of RtlFindCharInUnicodeString
  16942. function RtlFindCharInUnicodeString(
  16943. dwFlags : ULONG;
  16944. UnicodeString : PUNICODE_STRING;
  16945. CharactersToFind : PUNICODE_STRING;
  16946. Positions : PUSHORT
  16947. ): NTSTATUS; stdcall;
  16948. begin
  16949. GetProcedureAddress(_RtlFindCharInUnicodeString, ntdll, 'RtlFindCharInUnicodeString');
  16950. Result := TFNRtlFindCharInUnicodeString(_RtlFindCharInUnicodeString)(
  16951. dwFlags, UnicodeString, CharactersToFind, Positions
  16952. );
  16953. end;
  16954. // Dynamic version of RtlFindClearBits
  16955. function RtlFindClearBits(
  16956. BitMapHeader : PRTL_BITMAP;
  16957. NumberToFind : ULONG;
  16958. HintIndex : ULONG
  16959. ): ULONG; stdcall;
  16960. begin
  16961. GetProcedureAddress(_RtlFindClearBits, ntdll, 'RtlFindClearBits');
  16962. Result := TFNRtlFindClearBits(_RtlFindClearBits)(
  16963. BitMapHeader, NumberToFind, HintIndex
  16964. );
  16965. end;
  16966. // Dynamic version of RtlFindClearBitsAndSet
  16967. function RtlFindClearBitsAndSet(
  16968. BitMapHeader : PRTL_BITMAP;
  16969. NumberToFind : ULONG;
  16970. HintIndex : ULONG
  16971. ): ULONG; stdcall;
  16972. begin
  16973. GetProcedureAddress(_RtlFindClearBitsAndSet, ntdll, 'RtlFindClearBitsAndSet');
  16974. Result := TFNRtlFindClearBitsAndSet(_RtlFindClearBitsAndSet)(
  16975. BitMapHeader, NumberToFind, HintIndex
  16976. );
  16977. end;
  16978. // Dynamic version of RtlFindLastBackwardRunClear
  16979. function RtlFindLastBackwardRunClear(
  16980. BitMapHeader : PRTL_BITMAP;
  16981. FromIndex : ULONG;
  16982. StartingRunIndex : PULONG
  16983. ): ULONG; stdcall;
  16984. begin
  16985. GetProcedureAddress(_RtlFindLastBackwardRunClear, ntdll, 'RtlFindLastBackwardRunClear');
  16986. Result := TFNRtlFindLastBackwardRunClear(_RtlFindLastBackwardRunClear)(
  16987. BitMapHeader, FromIndex, StartingRunIndex
  16988. );
  16989. end;
  16990. // Dynamic version of RtlFindLeastSignificantBit
  16991. function RtlFindLeastSignificantBit(
  16992. Set_ : ULONGLONG
  16993. ): CCHAR; stdcall;
  16994. begin
  16995. GetProcedureAddress(_RtlFindLeastSignificantBit, ntdll, 'RtlFindLeastSignificantBit');
  16996. Result := TFNRtlFindLeastSignificantBit(_RtlFindLeastSignificantBit)(
  16997. Set_
  16998. );
  16999. end;
  17000. // Dynamic version of RtlFindLongestRunClear
  17001. function RtlFindLongestRunClear(
  17002. BitMapHeader : PRTL_BITMAP;
  17003. StartingIndex : PULONG
  17004. ): ULONG; stdcall;
  17005. begin
  17006. GetProcedureAddress(_RtlFindLongestRunClear, ntdll, 'RtlFindLongestRunClear');
  17007. Result := TFNRtlFindLongestRunClear(_RtlFindLongestRunClear)(
  17008. BitMapHeader, StartingIndex
  17009. );
  17010. end;
  17011. // Dynamic version of RtlFindMostSignificantBit
  17012. function RtlFindMostSignificantBit(
  17013. Set_ : ULONGLONG
  17014. ): CCHAR; stdcall;
  17015. begin
  17016. GetProcedureAddress(_RtlFindMostSignificantBit, ntdll, 'RtlFindMostSignificantBit');
  17017. Result := TFNRtlFindMostSignificantBit(_RtlFindMostSignificantBit)(
  17018. Set_
  17019. );
  17020. end;
  17021. // Dynamic version of RtlFindNextForwardRunClear
  17022. function RtlFindNextForwardRunClear(
  17023. BitMapHeader : PRTL_BITMAP;
  17024. FromIndex : ULONG;
  17025. StartingRunIndex : PULONG
  17026. ): ULONG; stdcall;
  17027. begin
  17028. GetProcedureAddress(_RtlFindNextForwardRunClear, ntdll, 'RtlFindNextForwardRunClear');
  17029. Result := TFNRtlFindNextForwardRunClear(_RtlFindNextForwardRunClear)(
  17030. BitMapHeader, FromIndex, StartingRunIndex
  17031. );
  17032. end;
  17033. // Dynamic version of RtlFindRange
  17034. function RtlFindRange(
  17035. RangeList : PRTL_RANGE_LIST;
  17036. Minimum : ULONGLONG;
  17037. Maximum : ULONGLONG;
  17038. Length : ULONG;
  17039. Alignment : ULONG;
  17040. Flags : ULONG;
  17041. AttributeAvailableMask : UCHAR;
  17042. Context : PVOID;
  17043. Callback : PRTL_CONFLICT_RANGE_CALLBACK;
  17044. Start : PULONGLONG
  17045. ): NTSTATUS; stdcall;
  17046. begin
  17047. GetProcedureAddress(_RtlFindRange, ntdll, 'RtlFindRange');
  17048. Result := TFNRtlFindRange(_RtlFindRange)(
  17049. RangeList, Minimum, Maximum, Length, Alignment, Flags, AttributeAvailableMask, Context, Callback, Start
  17050. );
  17051. end;
  17052. // Dynamic version of RtlFindSetBits
  17053. function RtlFindSetBits(
  17054. BitMapHeader : PRTL_BITMAP;
  17055. NumberToFind : ULONG;
  17056. HintIndex : ULONG
  17057. ): ULONG; stdcall;
  17058. begin
  17059. GetProcedureAddress(_RtlFindSetBits, ntdll, 'RtlFindSetBits');
  17060. Result := TFNRtlFindSetBits(_RtlFindSetBits)(
  17061. BitMapHeader, NumberToFind, HintIndex
  17062. );
  17063. end;
  17064. // Dynamic version of RtlFindSetBitsAndClear
  17065. function RtlFindSetBitsAndClear(
  17066. BitMapHeader : PRTL_BITMAP;
  17067. NumberToFind : ULONG;
  17068. HintIndex : ULONG
  17069. ): ULONG; stdcall;
  17070. begin
  17071. GetProcedureAddress(_RtlFindSetBitsAndClear, ntdll, 'RtlFindSetBitsAndClear');
  17072. Result := TFNRtlFindSetBitsAndClear(_RtlFindSetBitsAndClear)(
  17073. BitMapHeader, NumberToFind, HintIndex
  17074. );
  17075. end;
  17076. // Dynamic version of RtlFirstFreeAce
  17077. function RtlFirstFreeAce(
  17078. pAcl : PACL;
  17079. var pAce : PVOID
  17080. ): BOOLEAN; stdcall;
  17081. begin
  17082. GetProcedureAddress(_RtlFirstFreeAce, ntdll, 'RtlFirstFreeAce');
  17083. Result := TFNRtlFirstFreeAce(_RtlFirstFreeAce)(
  17084. pAcl, pAce
  17085. );
  17086. end;
  17087. // Dynamic version of RtlFormatCurrentUserKeyPath
  17088. function RtlFormatCurrentUserKeyPath(
  17089. CurrentUserKeyPath : PUNICODE_STRING
  17090. ): NTSTATUS; stdcall;
  17091. begin
  17092. GetProcedureAddress(_RtlFormatCurrentUserKeyPath, ntdll, 'RtlFormatCurrentUserKeyPath');
  17093. Result := TFNRtlFormatCurrentUserKeyPath(_RtlFormatCurrentUserKeyPath)(
  17094. CurrentUserKeyPath
  17095. );
  17096. end;
  17097. // Dynamic version of RtlFreeAnsiString
  17098. procedure RtlFreeAnsiString(
  17099. AnsiString : PANSI_STRING
  17100. ); stdcall;
  17101. begin
  17102. GetProcedureAddress(_RtlFreeAnsiString, ntdll, 'RtlFreeAnsiString');
  17103. TFNRtlFreeAnsiString(_RtlFreeAnsiString)(
  17104. AnsiString
  17105. );
  17106. end;
  17107. // Dynamic version of RtlFreeHeap
  17108. function RtlFreeHeap(
  17109. hHeap : HANDLE;
  17110. dwFlags : ULONG;
  17111. MemoryPointer : PVOID
  17112. ): BOOLEAN; stdcall;
  17113. begin
  17114. GetProcedureAddress(_RtlFreeHeap, ntdll, 'RtlFreeHeap');
  17115. Result := TFNRtlFreeHeap(_RtlFreeHeap)(
  17116. hHeap, dwFlags, MemoryPointer
  17117. );
  17118. end;
  17119. // Dynamic version of RtlFreeOemString
  17120. procedure RtlFreeOemString(
  17121. OemString : POEM_STRING
  17122. ); stdcall;
  17123. begin
  17124. GetProcedureAddress(_RtlFreeOemString, ntdll, 'RtlFreeOemString');
  17125. TFNRtlFreeOemString(_RtlFreeOemString)(
  17126. OemString
  17127. );
  17128. end;
  17129. // Dynamic version of RtlFreeRangeList
  17130. procedure RtlFreeRangeList(
  17131. RangeList : PRTL_RANGE_LIST
  17132. ); stdcall;
  17133. begin
  17134. GetProcedureAddress(_RtlFreeRangeList, ntdll, 'RtlFreeRangeList');
  17135. TFNRtlFreeRangeList(_RtlFreeRangeList)(
  17136. RangeList
  17137. );
  17138. end;
  17139. // Dynamic version of RtlFreeSid
  17140. function RtlFreeSid(
  17141. pSid : PSID
  17142. ): PVOID; stdcall;
  17143. begin
  17144. GetProcedureAddress(_RtlFreeSid, ntdll, 'RtlFreeSid');
  17145. Result := TFNRtlFreeSid(_RtlFreeSid)(
  17146. pSid
  17147. );
  17148. end;
  17149. // Dynamic version of RtlFreeUnicodeString
  17150. procedure RtlFreeUnicodeString(
  17151. UnicodeString : PUNICODE_STRING
  17152. ); stdcall;
  17153. begin
  17154. GetProcedureAddress(_RtlFreeUnicodeString, ntdll, 'RtlFreeUnicodeString');
  17155. TFNRtlFreeUnicodeString(_RtlFreeUnicodeString)(
  17156. UnicodeString
  17157. );
  17158. end;
  17159. // Dynamic version of RtlGUIDFromString
  17160. function RtlGUIDFromString(
  17161. GuidString : PUNICODE_STRING;
  17162. Guid : LPGUID
  17163. ): NTSTATUS; stdcall;
  17164. begin
  17165. GetProcedureAddress(_RtlGUIDFromString, ntdll, 'RtlGUIDFromString');
  17166. Result := TFNRtlGUIDFromString(_RtlGUIDFromString)(
  17167. GuidString, Guid
  17168. );
  17169. end;
  17170. // Dynamic version of RtlGetAce
  17171. function RtlGetAce(
  17172. pAcl : PACL;
  17173. dwAceIndex : DWORD;
  17174. var pAce : PVOID
  17175. ): NTSTATUS; stdcall;
  17176. begin
  17177. GetProcedureAddress(_RtlGetAce, ntdll, 'RtlGetAce');
  17178. Result := TFNRtlGetAce(_RtlGetAce)(
  17179. pAcl, dwAceIndex, pAce
  17180. );
  17181. end;
  17182. // Dynamic version of RtlGetCallersAddress
  17183. procedure RtlGetCallersAddress(
  17184. CallersAddress : PPVOID;
  17185. CallersCaller : PPVOID
  17186. ); stdcall;
  17187. begin
  17188. GetProcedureAddress(_RtlGetCallersAddress, ntdll, 'RtlGetCallersAddress');
  17189. TFNRtlGetCallersAddress(_RtlGetCallersAddress)(
  17190. CallersAddress, CallersCaller
  17191. );
  17192. end;
  17193. // Dynamic version of RtlGetControlSecurityDescriptor
  17194. function RtlGetControlSecurityDescriptor(
  17195. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  17196. var Control : SECURITY_DESCRIPTOR_CONTROL;
  17197. var dwRevision : DWORD
  17198. ): NTSTATUS; stdcall;
  17199. begin
  17200. GetProcedureAddress(_RtlGetControlSecurityDescriptor, ntdll, 'RtlGetControlSecurityDescriptor');
  17201. Result := TFNRtlGetControlSecurityDescriptor(_RtlGetControlSecurityDescriptor)(
  17202. pSecurityDescriptor, Control, dwRevision
  17203. );
  17204. end;
  17205. // Dynamic version of RtlGetCurrentDirectory_U
  17206. function RtlGetCurrentDirectory_U(
  17207. MaximumLength : ULONG;
  17208. Buffer : PWSTR
  17209. ): ULONG; stdcall;
  17210. begin
  17211. GetProcedureAddress(_RtlGetCurrentDirectory_U, ntdll, 'RtlGetCurrentDirectory_U');
  17212. Result := TFNRtlGetCurrentDirectory_U(_RtlGetCurrentDirectory_U)(
  17213. MaximumLength, Buffer
  17214. );
  17215. end;
  17216. // Dynamic version of RtlGetCurrentPeb
  17217. function RtlGetCurrentPeb(): PPEB; stdcall;
  17218. begin
  17219. GetProcedureAddress(_RtlGetCurrentPeb, ntdll, 'RtlGetCurrentPeb');
  17220. Result := TFNRtlGetCurrentPeb(_RtlGetCurrentPeb)();
  17221. end;
  17222. // Dynamic version of RtlGetDaclSecurityDescriptor
  17223. function RtlGetDaclSecurityDescriptor(
  17224. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  17225. var bDaclPresent : BOOLEAN;
  17226. var Dacl : PACL;
  17227. var bDaclDefaulted : BOOLEAN
  17228. ): NTSTATUS; stdcall;
  17229. begin
  17230. GetProcedureAddress(_RtlGetDaclSecurityDescriptor, ntdll, 'RtlGetDaclSecurityDescriptor');
  17231. Result := TFNRtlGetDaclSecurityDescriptor(_RtlGetDaclSecurityDescriptor)(
  17232. pSecurityDescriptor, bDaclPresent, Dacl, bDaclDefaulted
  17233. );
  17234. end;
  17235. // Dynamic version of RtlGetFirstRange
  17236. function RtlGetFirstRange(
  17237. RangeList : PRTL_RANGE_LIST;
  17238. Iterator : PRTL_RANGE_LIST_ITERATOR;
  17239. var Range : PRTL_RANGE
  17240. ): NTSTATUS; stdcall;
  17241. begin
  17242. GetProcedureAddress(_RtlGetFirstRange, ntdll, 'RtlGetFirstRange');
  17243. Result := TFNRtlGetFirstRange(_RtlGetFirstRange)(
  17244. RangeList, Iterator, Range
  17245. );
  17246. end;
  17247. // Dynamic version of RtlGetFullPathName_U
  17248. function RtlGetFullPathName_U(
  17249. DosName : PWSTR;
  17250. Size : ULONG;
  17251. Buf : PWSTR;
  17252. var Shortname : PWSTR
  17253. ): ULONG; stdcall;
  17254. begin
  17255. GetProcedureAddress(_RtlGetFullPathName_U, ntdll, 'RtlGetFullPathName_U');
  17256. Result := TFNRtlGetFullPathName_U(_RtlGetFullPathName_U)(
  17257. DosName, Size, Buf, Shortname
  17258. );
  17259. end;
  17260. // Dynamic version of RtlGetGroupSecurityDescriptor
  17261. function RtlGetGroupSecurityDescriptor(
  17262. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  17263. var pGroup : PSID;
  17264. var bGroupDefaulted : BOOLEAN
  17265. ): NTSTATUS; stdcall;
  17266. begin
  17267. GetProcedureAddress(_RtlGetGroupSecurityDescriptor, ntdll, 'RtlGetGroupSecurityDescriptor');
  17268. Result := TFNRtlGetGroupSecurityDescriptor(_RtlGetGroupSecurityDescriptor)(
  17269. pSecurityDescriptor, pGroup, bGroupDefaulted
  17270. );
  17271. end;
  17272. // Dynamic version of RtlGetLastNtStatus
  17273. function RtlGetLastNtStatus(): NTSTATUS; stdcall;
  17274. begin
  17275. GetProcedureAddress(_RtlGetLastNtStatus, ntdll, 'RtlGetLastNtStatus');
  17276. Result := TFNRtlGetLastNtStatus(_RtlGetLastNtStatus)();
  17277. end;
  17278. // Dynamic version of RtlGetLongestNtPathLength
  17279. function RtlGetLongestNtPathLength(): ULONG; stdcall;
  17280. begin
  17281. GetProcedureAddress(_RtlGetLongestNtPathLength, ntdll, 'RtlGetLongestNtPathLength');
  17282. Result := TFNRtlGetLongestNtPathLength(_RtlGetLongestNtPathLength)();
  17283. end;
  17284. // Dynamic version of RtlGetNextRange
  17285. function RtlGetNextRange(
  17286. Iterator : PRTL_RANGE_LIST_ITERATOR;
  17287. var Range : PRTL_RANGE;
  17288. MoveForwards : BOOLEAN
  17289. ): NTSTATUS; stdcall;
  17290. begin
  17291. GetProcedureAddress(_RtlGetNextRange, ntdll, 'RtlGetNextRange');
  17292. Result := TFNRtlGetNextRange(_RtlGetNextRange)(
  17293. Iterator, Range, MoveForwards
  17294. );
  17295. end;
  17296. // Dynamic version of RtlGetNtGlobalFlags
  17297. function RtlGetNtGlobalFlags(): ULONG; stdcall;
  17298. begin
  17299. GetProcedureAddress(_RtlGetNtGlobalFlags, ntdll, 'RtlGetNtGlobalFlags');
  17300. Result := TFNRtlGetNtGlobalFlags(_RtlGetNtGlobalFlags)();
  17301. end;
  17302. // Dynamic version of RtlGetNtProductType
  17303. function RtlGetNtProductType(
  17304. var ProductType : ULONG
  17305. ): BOOLEAN; stdcall;
  17306. begin
  17307. GetProcedureAddress(_RtlGetNtProductType, ntdll, 'RtlGetNtProductType');
  17308. Result := TFNRtlGetNtProductType(_RtlGetNtProductType)(
  17309. ProductType
  17310. );
  17311. end;
  17312. // Dynamic version of RtlGetNtVersionNumbers
  17313. procedure RtlGetNtVersionNumbers(
  17314. var dwMajorVersion : ULONG;
  17315. var dwMinorVersion : ULONG;
  17316. UnknownCanBeNull : PDWORD
  17317. ); stdcall;
  17318. begin
  17319. GetProcedureAddress(_RtlGetNtVersionNumbers, ntdll, 'RtlGetNtVersionNumbers');
  17320. TFNRtlGetNtVersionNumbers(_RtlGetNtVersionNumbers)(
  17321. dwMajorVersion, dwMinorVersion, UnknownCanBeNull
  17322. );
  17323. end;
  17324. // Dynamic version of RtlGetOwnerSecurityDescriptor
  17325. function RtlGetOwnerSecurityDescriptor(
  17326. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  17327. var pOwner : PSID;
  17328. var OwnerDefaulted : BOOLEAN
  17329. ): NTSTATUS; stdcall;
  17330. begin
  17331. GetProcedureAddress(_RtlGetOwnerSecurityDescriptor, ntdll, 'RtlGetOwnerSecurityDescriptor');
  17332. Result := TFNRtlGetOwnerSecurityDescriptor(_RtlGetOwnerSecurityDescriptor)(
  17333. pSecurityDescriptor, pOwner, OwnerDefaulted
  17334. );
  17335. end;
  17336. // Dynamic version of RtlGetProcessHeaps
  17337. function RtlGetProcessHeaps(
  17338. ArraySize : ULONG;
  17339. HeapArray : PHANDLE
  17340. ): ULONG; stdcall;
  17341. begin
  17342. GetProcedureAddress(_RtlGetProcessHeaps, ntdll, 'RtlGetProcessHeaps');
  17343. Result := TFNRtlGetProcessHeaps(_RtlGetProcessHeaps)(
  17344. ArraySize, HeapArray
  17345. );
  17346. end;
  17347. // Dynamic version of RtlGetSaclSecurityDescriptor
  17348. function RtlGetSaclSecurityDescriptor(
  17349. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  17350. var bSaclPresent : BOOLEAN;
  17351. var Sacl : PACL;
  17352. var bSaclDefaulted : BOOLEAN
  17353. ): NTSTATUS; stdcall;
  17354. begin
  17355. GetProcedureAddress(_RtlGetSaclSecurityDescriptor, ntdll, 'RtlGetSaclSecurityDescriptor');
  17356. Result := TFNRtlGetSaclSecurityDescriptor(_RtlGetSaclSecurityDescriptor)(
  17357. pSecurityDescriptor, bSaclPresent, Sacl, bSaclDefaulted
  17358. );
  17359. end;
  17360. // Dynamic version of RtlGetVersion
  17361. function RtlGetVersion(
  17362. lpVersionInformation : PRTL_OSVERSIONINFOW
  17363. ): NTSTATUS; stdcall;
  17364. begin
  17365. GetProcedureAddress(_RtlGetVersion, ntdll, 'RtlGetVersion');
  17366. Result := TFNRtlGetVersion(_RtlGetVersion)(
  17367. lpVersionInformation
  17368. );
  17369. end;
  17370. // Dynamic version of RtlIdentifierAuthoritySid
  17371. function RtlIdentifierAuthoritySid(
  17372. Sid : PSID
  17373. ): PSID_IDENTIFIER_AUTHORITY; stdcall;
  17374. begin
  17375. GetProcedureAddress(_RtlIdentifierAuthoritySid, ntdll, 'RtlIdentifierAuthoritySid');
  17376. Result := TFNRtlIdentifierAuthoritySid(_RtlIdentifierAuthoritySid)(
  17377. Sid
  17378. );
  17379. end;
  17380. // Dynamic version of RtlImageDirectoryEntryToData
  17381. function RtlImageDirectoryEntryToData(
  17382. ImageBase : HMODULE;
  17383. MappedAsImage : BOOLEAN;
  17384. DirectoryEntry : USHORT;
  17385. Size : PULONG
  17386. ): PVOID; stdcall;
  17387. begin
  17388. GetProcedureAddress(_RtlImageDirectoryEntryToData, ntdll, 'RtlImageDirectoryEntryToData');
  17389. Result := TFNRtlImageDirectoryEntryToData(_RtlImageDirectoryEntryToData)(
  17390. ImageBase, MappedAsImage, DirectoryEntry, Size
  17391. );
  17392. end;
  17393. // Dynamic version of RtlImageNtHeader
  17394. function RtlImageNtHeader(
  17395. ImageBase : HMODULE
  17396. ): PIMAGE_NT_HEADERS; stdcall;
  17397. begin
  17398. GetProcedureAddress(_RtlImageNtHeader, ntdll, 'RtlImageNtHeader');
  17399. Result := TFNRtlImageNtHeader(_RtlImageNtHeader)(
  17400. ImageBase
  17401. );
  17402. end;
  17403. // Dynamic version of RtlImageNtHeaderEx
  17404. function RtlImageNtHeaderEx(
  17405. dwFlags : DWORD;
  17406. ImageBase : HMODULE
  17407. ): PIMAGE_NT_HEADERS; stdcall;
  17408. begin
  17409. GetProcedureAddress(_RtlImageNtHeaderEx, ntdll, 'RtlImageNtHeaderEx');
  17410. Result := TFNRtlImageNtHeaderEx(_RtlImageNtHeaderEx)(
  17411. dwFlags, ImageBase
  17412. );
  17413. end;
  17414. // Dynamic version of RtlImageRvaToSection
  17415. function RtlImageRvaToSection(
  17416. NtHeaders : PIMAGE_NT_HEADERS;
  17417. ImageBase : HMODULE;
  17418. Rva : ULONG
  17419. ): PIMAGE_SECTION_HEADER; stdcall;
  17420. begin
  17421. GetProcedureAddress(_RtlImageRvaToSection, ntdll, 'RtlImageRvaToSection');
  17422. Result := TFNRtlImageRvaToSection(_RtlImageRvaToSection)(
  17423. NtHeaders, ImageBase, Rva
  17424. );
  17425. end;
  17426. // Dynamic version of RtlImageRvaToVa
  17427. function RtlImageRvaToVa(
  17428. NtHeaders : PIMAGE_NT_HEADERS;
  17429. ImageBase : HMODULE;
  17430. Rva : ULONG;
  17431. var LastRvaSection : PIMAGE_SECTION_HEADER
  17432. ): PVOID; stdcall;
  17433. begin
  17434. GetProcedureAddress(_RtlImageRvaToVa, ntdll, 'RtlImageRvaToVa');
  17435. Result := TFNRtlImageRvaToVa(_RtlImageRvaToVa)(
  17436. NtHeaders, ImageBase, Rva, LastRvaSection
  17437. );
  17438. end;
  17439. // Dynamic version of RtlImpersonateSelf
  17440. function RtlImpersonateSelf(
  17441. ImpersonationLevel : SECURITY_IMPERSONATION_LEVEL
  17442. ): NTSTATUS; stdcall;
  17443. begin
  17444. GetProcedureAddress(_RtlImpersonateSelf, ntdll, 'RtlImpersonateSelf');
  17445. Result := TFNRtlImpersonateSelf(_RtlImpersonateSelf)(
  17446. ImpersonationLevel
  17447. );
  17448. end;
  17449. // Dynamic version of RtlInitAnsiString
  17450. procedure RtlInitAnsiString(
  17451. DestinationString : PANSI_STRING;
  17452. SourceString : PCSZ
  17453. ); stdcall;
  17454. begin
  17455. GetProcedureAddress(_RtlInitAnsiString, ntdll, 'RtlInitAnsiString');
  17456. TFNRtlInitAnsiString(_RtlInitAnsiString)(
  17457. DestinationString, SourceString
  17458. );
  17459. end;
  17460. // Dynamic version of RtlInitAnsiStringEx
  17461. function RtlInitAnsiStringEx(
  17462. DestinationString : PANSI_STRING;
  17463. SourceString : PCSZ
  17464. ): NTSTATUS; stdcall;
  17465. begin
  17466. GetProcedureAddress(_RtlInitAnsiStringEx, ntdll, 'RtlInitAnsiStringEx');
  17467. Result := TFNRtlInitAnsiStringEx(_RtlInitAnsiStringEx)(
  17468. DestinationString, SourceString
  17469. );
  17470. end;
  17471. // Dynamic version of RtlInitString
  17472. procedure RtlInitString(
  17473. DestinationString : PSTRING;
  17474. SourceString : PCSZ
  17475. ); stdcall;
  17476. begin
  17477. GetProcedureAddress(_RtlInitString, ntdll, 'RtlInitString');
  17478. TFNRtlInitString(_RtlInitString)(
  17479. DestinationString, SourceString
  17480. );
  17481. end;
  17482. // Dynamic version of RtlInitUnicodeString
  17483. procedure RtlInitUnicodeString(
  17484. DestinationString : PUNICODE_STRING;
  17485. SourceString : LPCWSTR
  17486. ); stdcall;
  17487. begin
  17488. GetProcedureAddress(_RtlInitUnicodeString, ntdll, 'RtlInitUnicodeString');
  17489. TFNRtlInitUnicodeString(_RtlInitUnicodeString)(
  17490. DestinationString, SourceString
  17491. );
  17492. end;
  17493. // Dynamic version of RtlInitUnicodeStringEx
  17494. function RtlInitUnicodeStringEx(
  17495. DestinationString : PUNICODE_STRING;
  17496. SourceString : LPCWSTR
  17497. ): NTSTATUS; stdcall;
  17498. begin
  17499. GetProcedureAddress(_RtlInitUnicodeStringEx, ntdll, 'RtlInitUnicodeStringEx');
  17500. Result := TFNRtlInitUnicodeStringEx(_RtlInitUnicodeStringEx)(
  17501. DestinationString, SourceString
  17502. );
  17503. end;
  17504. // Dynamic version of RtlInitializeBitMap
  17505. procedure RtlInitializeBitMap(
  17506. BitMapHeader : PRTL_BITMAP;
  17507. BitMapBuffer : PULONG;
  17508. SizeOfBitMap : ULONG
  17509. ); stdcall;
  17510. begin
  17511. GetProcedureAddress(_RtlInitializeBitMap, ntdll, 'RtlInitializeBitMap');
  17512. TFNRtlInitializeBitMap(_RtlInitializeBitMap)(
  17513. BitMapHeader, BitMapBuffer, SizeOfBitMap
  17514. );
  17515. end;
  17516. // Dynamic version of RtlInitializeCriticalSection
  17517. function RtlInitializeCriticalSection(
  17518. lpCriticalSection : PRTL_CRITICAL_SECTION
  17519. ): NTSTATUS; stdcall;
  17520. begin
  17521. GetProcedureAddress(_RtlInitializeCriticalSection, ntdll, 'RtlInitializeCriticalSection');
  17522. Result := TFNRtlInitializeCriticalSection(_RtlInitializeCriticalSection)(
  17523. lpCriticalSection
  17524. );
  17525. end;
  17526. // Dynamic version of RtlInitializeCriticalSectionAndSpinCount
  17527. function RtlInitializeCriticalSectionAndSpinCount(
  17528. lpCriticalSection : PRTL_CRITICAL_SECTION;
  17529. dwSpinCount : ULONG
  17530. ): NTSTATUS; stdcall;
  17531. begin
  17532. GetProcedureAddress(_RtlInitializeCriticalSectionAndSpinCount, ntdll, 'RtlInitializeCriticalSectionAndSpinCount');
  17533. Result := TFNRtlInitializeCriticalSectionAndSpinCount(_RtlInitializeCriticalSectionAndSpinCount)(
  17534. lpCriticalSection, dwSpinCount
  17535. );
  17536. end;
  17537. // Dynamic version of RtlInitializeRangeList
  17538. procedure RtlInitializeRangeList(
  17539. RangeList : PRTL_RANGE_LIST
  17540. ); stdcall;
  17541. begin
  17542. GetProcedureAddress(_RtlInitializeRangeList, ntdll, 'RtlInitializeRangeList');
  17543. TFNRtlInitializeRangeList(_RtlInitializeRangeList)(
  17544. RangeList
  17545. );
  17546. end;
  17547. {$IFNDEF JWA_INCLUDEMODE}
  17548. // Dynamic version of RtlInitializeSListHead
  17549. procedure RtlInitializeSListHead(
  17550. ListHead : PSLIST_HEADER
  17551. ); stdcall;
  17552. begin
  17553. GetProcedureAddress(_RtlInitializeSListHead, ntdll, 'RtlInitializeSListHead');
  17554. TFNRtlInitializeSListHead(_RtlInitializeSListHead)(
  17555. ListHead
  17556. );
  17557. end;
  17558. {$ENDIF JWA_INCLUDEMODE}
  17559. // Dynamic version of RtlInitializeSid
  17560. function RtlInitializeSid(
  17561. pSid : PSID;
  17562. pIdentifierAuthority : PSID_IDENTIFIER_AUTHORITY;
  17563. nSubAuthorityCount : UCHAR
  17564. ): NTSTATUS; stdcall;
  17565. begin
  17566. GetProcedureAddress(_RtlInitializeSid, ntdll, 'RtlInitializeSid');
  17567. Result := TFNRtlInitializeSid(_RtlInitializeSid)(
  17568. pSid, pIdentifierAuthority, nSubAuthorityCount
  17569. );
  17570. end;
  17571. // Dynamic version of RtlInt64ToUnicodeString
  17572. function RtlInt64ToUnicodeString(
  17573. Value : ULONGLONG;
  17574. Base : ULONG;
  17575. Str : PUNICODE_STRING
  17576. ): NTSTATUS; stdcall;
  17577. begin
  17578. GetProcedureAddress(_RtlInt64ToUnicodeString, ntdll, 'RtlInt64ToUnicodeString');
  17579. Result := TFNRtlInt64ToUnicodeString(_RtlInt64ToUnicodeString)(
  17580. Value, Base, Str
  17581. );
  17582. end;
  17583. // Dynamic version of RtlIntegerToChar
  17584. function RtlIntegerToChar(
  17585. Value : ULONG;
  17586. Base : ULONG;
  17587. Length : ULONG;
  17588. Str : PCHAR
  17589. ): NTSTATUS; stdcall;
  17590. begin
  17591. GetProcedureAddress(_RtlIntegerToChar, ntdll, 'RtlIntegerToChar');
  17592. Result := TFNRtlIntegerToChar(_RtlIntegerToChar)(
  17593. Value, Base, Length, Str
  17594. );
  17595. end;
  17596. // Dynamic version of RtlIntegerToUnicodeString
  17597. function RtlIntegerToUnicodeString(
  17598. Value : ULONG;
  17599. Base : ULONG;
  17600. Str : PUNICODE_STRING
  17601. ): NTSTATUS; stdcall;
  17602. begin
  17603. GetProcedureAddress(_RtlIntegerToUnicodeString, ntdll, 'RtlIntegerToUnicodeString');
  17604. Result := TFNRtlIntegerToUnicodeString(_RtlIntegerToUnicodeString)(
  17605. Value, Base, Str
  17606. );
  17607. end;
  17608. {$IFNDEf JWA_INCLUDEMODE}
  17609. // Dynamic version of RtlInterlockedFlushSList
  17610. function RtlInterlockedFlushSList(
  17611. ListHead : PSLIST_HEADER
  17612. ): PSLIST_ENTRY; stdcall;
  17613. begin
  17614. GetProcedureAddress(_RtlInterlockedFlushSList, ntdll, 'RtlInterlockedFlushSList');
  17615. Result := TFNRtlInterlockedFlushSList(_RtlInterlockedFlushSList)(
  17616. ListHead
  17617. );
  17618. end;
  17619. // Dynamic version of RtlInterlockedPopEntrySList
  17620. function RtlInterlockedPopEntrySList(
  17621. ListHead : PSLIST_HEADER
  17622. ): PSLIST_ENTRY; stdcall;
  17623. begin
  17624. GetProcedureAddress(_RtlInterlockedPopEntrySList, ntdll, 'RtlInterlockedPopEntrySList');
  17625. Result := TFNRtlInterlockedPopEntrySList(_RtlInterlockedPopEntrySList)(
  17626. ListHead
  17627. );
  17628. end;
  17629. {$ENDIF JWA_INCLUDEMODE}
  17630. // Dynamic version of RtlInterlockedPushEntrySList
  17631. function RtlInterlockedPushEntrySList(
  17632. ListHead : PSLIST_HEADER;
  17633. ListEntry : PSLIST_ENTRY
  17634. ): PSLIST_ENTRY; stdcall;
  17635. begin
  17636. GetProcedureAddress(_RtlInterlockedPushEntrySList, ntdll, 'RtlInterlockedPushEntrySList');
  17637. Result := TFNRtlInterlockedPushEntrySList(_RtlInterlockedPushEntrySList)(
  17638. ListHead, ListEntry
  17639. );
  17640. end;
  17641. // Dynamic version of RtlInvertRangeList
  17642. function RtlInvertRangeList(
  17643. InvertedRangeList : PRTL_RANGE_LIST;
  17644. RangeList : PRTL_RANGE_LIST
  17645. ): NTSTATUS; stdcall;
  17646. begin
  17647. GetProcedureAddress(_RtlInvertRangeList, ntdll, 'RtlInvertRangeList');
  17648. Result := TFNRtlInvertRangeList(_RtlInvertRangeList)(
  17649. InvertedRangeList, RangeList
  17650. );
  17651. end;
  17652. // Dynamic version of RtlIpv4AddressToStringA
  17653. function RtlIpv4AddressToStringA(
  17654. IP : PULONG;
  17655. Buffer : LPSTR
  17656. ): LPSTR; stdcall;
  17657. begin
  17658. GetProcedureAddress(_RtlIpv4AddressToStringA, ntdll, 'RtlIpv4AddressToStringA');
  17659. Result := TFNRtlIpv4AddressToStringA(_RtlIpv4AddressToStringA)(
  17660. IP, Buffer
  17661. );
  17662. end;
  17663. // Dynamic version of RtlIpv4AddressToStringW
  17664. function RtlIpv4AddressToStringW(
  17665. IP : PULONG;
  17666. Buffer : LPWSTR
  17667. ): LPWSTR; stdcall;
  17668. begin
  17669. GetProcedureAddress(_RtlIpv4AddressToStringW, ntdll, 'RtlIpv4AddressToStringW');
  17670. Result := TFNRtlIpv4AddressToStringW(_RtlIpv4AddressToStringW)(
  17671. IP, Buffer
  17672. );
  17673. end;
  17674. // Dynamic version of RtlIsDosDeviceName_U
  17675. function RtlIsDosDeviceName_U(
  17676. TestString : LPCWSTR
  17677. ): ULONG; stdcall;
  17678. begin
  17679. GetProcedureAddress(_RtlIsDosDeviceName_U, ntdll, 'RtlIsDosDeviceName_U');
  17680. Result := TFNRtlIsDosDeviceName_U(_RtlIsDosDeviceName_U)(
  17681. TestString
  17682. );
  17683. end;
  17684. {$IFNDEF JWA_INCLUDEMODE}
  17685. // Dynamic version of RtlIsNameLegalDOS8Dot3
  17686. function RtlIsNameLegalDOS8Dot3(
  17687. Name : PUNICODE_STRING;
  17688. OemName : POEM_STRING;
  17689. NameContainsSpaces : PBOOLEAN
  17690. ): BOOLEAN; stdcall;
  17691. begin
  17692. GetProcedureAddress(_RtlIsNameLegalDOS8Dot3, ntdll, 'RtlIsNameLegalDOS8Dot3');
  17693. Result := TFNRtlIsNameLegalDOS8Dot3(_RtlIsNameLegalDOS8Dot3)(
  17694. Name, OemName, NameContainsSpaces
  17695. );
  17696. end;
  17697. {$ENDIF JWA_INCLUDEMODE}
  17698. // Dynamic version of RtlIsRangeAvailable
  17699. function RtlIsRangeAvailable(
  17700. RangeList : PRTL_RANGE_LIST;
  17701. Start : ULONGLONG;
  17702. End_ : ULONGLONG;
  17703. Flags : ULONG;
  17704. AttributeAvailableMask : UCHAR;
  17705. Context : PVOID;
  17706. Callback : PRTL_CONFLICT_RANGE_CALLBACK;
  17707. Available : PBOOLEAN
  17708. ): NTSTATUS; stdcall;
  17709. begin
  17710. GetProcedureAddress(_RtlIsRangeAvailable, ntdll, 'RtlIsRangeAvailable');
  17711. Result := TFNRtlIsRangeAvailable(_RtlIsRangeAvailable)(
  17712. RangeList, Start, End_, Flags, AttributeAvailableMask, Context, Callback, Available
  17713. );
  17714. end;
  17715. // Dynamic version of RtlIsTextUnicode
  17716. function RtlIsTextUnicode(
  17717. lpBuffer : PVOID;
  17718. cb : Integer;
  17719. lpi : LPINT
  17720. ): BOOLEAN; stdcall;
  17721. begin
  17722. GetProcedureAddress(_RtlIsTextUnicode, ntdll, 'RtlIsTextUnicode');
  17723. Result := TFNRtlIsTextUnicode(_RtlIsTextUnicode)(
  17724. lpBuffer, cb, lpi
  17725. );
  17726. end;
  17727. // Dynamic version of RtlLargeIntegerAdd
  17728. function RtlLargeIntegerAdd(
  17729. Addend1 : LARGE_INTEGER;
  17730. Addend2 : LARGE_INTEGER
  17731. ): LARGE_INTEGER; stdcall;
  17732. begin
  17733. GetProcedureAddress(_RtlLargeIntegerAdd, ntdll, 'RtlLargeIntegerAdd');
  17734. Result := TFNRtlLargeIntegerAdd(_RtlLargeIntegerAdd)(
  17735. Addend1, Addend2
  17736. );
  17737. end;
  17738. // Dynamic version of RtlLargeIntegerArithmeticShift
  17739. function RtlLargeIntegerArithmeticShift(
  17740. LargeInteger : LARGE_INTEGER;
  17741. ShiftCount : CCHAR
  17742. ): LARGE_INTEGER; stdcall;
  17743. begin
  17744. GetProcedureAddress(_RtlLargeIntegerArithmeticShift, ntdll, 'RtlLargeIntegerArithmeticShift');
  17745. Result := TFNRtlLargeIntegerArithmeticShift(_RtlLargeIntegerArithmeticShift)(
  17746. LargeInteger, ShiftCount
  17747. );
  17748. end;
  17749. // Dynamic version of RtlLargeIntegerDivide
  17750. function RtlLargeIntegerDivide(
  17751. Dividend : LARGE_INTEGER;
  17752. Divisor : LARGE_INTEGER;
  17753. Remainder : PLARGE_INTEGER
  17754. ): LARGE_INTEGER; stdcall;
  17755. begin
  17756. GetProcedureAddress(_RtlLargeIntegerDivide, ntdll, 'RtlLargeIntegerDivide');
  17757. Result := TFNRtlLargeIntegerDivide(_RtlLargeIntegerDivide)(
  17758. Dividend, Divisor, Remainder
  17759. );
  17760. end;
  17761. // Dynamic version of RtlLargeIntegerNegate
  17762. function RtlLargeIntegerNegate(
  17763. NegateThis : LARGE_INTEGER
  17764. ): LARGE_INTEGER; stdcall;
  17765. begin
  17766. GetProcedureAddress(_RtlLargeIntegerNegate, ntdll, 'RtlLargeIntegerNegate');
  17767. Result := TFNRtlLargeIntegerNegate(_RtlLargeIntegerNegate)(
  17768. NegateThis
  17769. );
  17770. end;
  17771. // Dynamic version of RtlLargeIntegerShiftLeft
  17772. function RtlLargeIntegerShiftLeft(
  17773. LargeInteger : LARGE_INTEGER;
  17774. ShiftCount : CCHAR
  17775. ): LARGE_INTEGER; stdcall;
  17776. begin
  17777. GetProcedureAddress(_RtlLargeIntegerShiftLeft, ntdll, 'RtlLargeIntegerShiftLeft');
  17778. Result := TFNRtlLargeIntegerShiftLeft(_RtlLargeIntegerShiftLeft)(
  17779. LargeInteger, ShiftCount
  17780. );
  17781. end;
  17782. // Dynamic version of RtlLargeIntegerShiftRight
  17783. function RtlLargeIntegerShiftRight(
  17784. LargeInteger : LARGE_INTEGER;
  17785. ShiftCount : CCHAR
  17786. ): LARGE_INTEGER; stdcall;
  17787. begin
  17788. GetProcedureAddress(_RtlLargeIntegerShiftRight, ntdll, 'RtlLargeIntegerShiftRight');
  17789. Result := TFNRtlLargeIntegerShiftRight(_RtlLargeIntegerShiftRight)(
  17790. LargeInteger, ShiftCount
  17791. );
  17792. end;
  17793. // Dynamic version of RtlLargeIntegerSubtract
  17794. function RtlLargeIntegerSubtract(
  17795. Number : LARGE_INTEGER;
  17796. Subtrahend : LARGE_INTEGER
  17797. ): LARGE_INTEGER; stdcall;
  17798. begin
  17799. GetProcedureAddress(_RtlLargeIntegerSubtract, ntdll, 'RtlLargeIntegerSubtract');
  17800. Result := TFNRtlLargeIntegerSubtract(_RtlLargeIntegerSubtract)(
  17801. Number, Subtrahend
  17802. );
  17803. end;
  17804. // Dynamic version of RtlLargeIntegerToChar
  17805. function RtlLargeIntegerToChar(
  17806. Value : PLARGE_INTEGER;
  17807. Base : ULONG;
  17808. BufferLength : ULONG;
  17809. Buffer : PCHAR
  17810. ): NTSTATUS; stdcall;
  17811. begin
  17812. GetProcedureAddress(_RtlLargeIntegerToChar, ntdll, 'RtlLargeIntegerToChar');
  17813. Result := TFNRtlLargeIntegerToChar(_RtlLargeIntegerToChar)(
  17814. Value, Base, BufferLength, Buffer
  17815. );
  17816. end;
  17817. // Dynamic version of RtlLeaveCriticalSection
  17818. procedure RtlLeaveCriticalSection(
  17819. lpCriticalSection : PRTL_CRITICAL_SECTION
  17820. ); stdcall;
  17821. begin
  17822. GetProcedureAddress(_RtlLeaveCriticalSection, ntdll, 'RtlLeaveCriticalSection');
  17823. TFNRtlLeaveCriticalSection(_RtlLeaveCriticalSection)(
  17824. lpCriticalSection
  17825. );
  17826. end;
  17827. // Dynamic version of RtlLengthRequiredSid
  17828. function RtlLengthRequiredSid(
  17829. nSubAuthorityCount : ULONG
  17830. ): ULONG; stdcall;
  17831. begin
  17832. GetProcedureAddress(_RtlLengthRequiredSid, ntdll, 'RtlLengthRequiredSid');
  17833. Result := TFNRtlLengthRequiredSid(_RtlLengthRequiredSid)(
  17834. nSubAuthorityCount
  17835. );
  17836. end;
  17837. // Dynamic version of RtlLengthSecurityDescriptor
  17838. function RtlLengthSecurityDescriptor(
  17839. SecurityDescriptor : PSECURITY_DESCRIPTOR
  17840. ): ULONG; stdcall;
  17841. begin
  17842. GetProcedureAddress(_RtlLengthSecurityDescriptor, ntdll, 'RtlLengthSecurityDescriptor');
  17843. Result := TFNRtlLengthSecurityDescriptor(_RtlLengthSecurityDescriptor)(
  17844. SecurityDescriptor
  17845. );
  17846. end;
  17847. // Dynamic version of RtlLengthSid
  17848. function RtlLengthSid(
  17849. pSid : PSID
  17850. ): ULONG; stdcall;
  17851. begin
  17852. GetProcedureAddress(_RtlLengthSid, ntdll, 'RtlLengthSid');
  17853. Result := TFNRtlLengthSid(_RtlLengthSid)(
  17854. pSid
  17855. );
  17856. end;
  17857. {$IFNDEF JWA_INCLUDEMODE}
  17858. // Dynamic version of RtlLocalTimeToSystemTime
  17859. function RtlLocalTimeToSystemTime(
  17860. LocalTime : PLARGE_INTEGER;
  17861. SystemTime : PLARGE_INTEGER
  17862. ): NTSTATUS; stdcall;
  17863. begin
  17864. GetProcedureAddress(_RtlLocalTimeToSystemTime, ntdll, 'RtlLocalTimeToSystemTime');
  17865. Result := TFNRtlLocalTimeToSystemTime(_RtlLocalTimeToSystemTime)(
  17866. LocalTime, SystemTime
  17867. );
  17868. end;
  17869. {$ENDIF JWA_INCLUDEMODE}
  17870. // Dynamic version of RtlLockHeap
  17871. function RtlLockHeap(
  17872. hHeap : PVOID
  17873. ): BOOLEAN; stdcall;
  17874. begin
  17875. GetProcedureAddress(_RtlLockHeap, ntdll, 'RtlLockHeap');
  17876. Result := TFNRtlLockHeap(_RtlLockHeap)(
  17877. hHeap
  17878. );
  17879. end;
  17880. // Dynamic version of RtlMakeSelfRelativeSD
  17881. function RtlMakeSelfRelativeSD(
  17882. pAbsoluteSD : PSECURITY_DESCRIPTOR;
  17883. pSelfRelativeSD : PSECURITY_DESCRIPTOR;
  17884. lpdwBufferLength : LPDWORD
  17885. ): NTSTATUS; stdcall;
  17886. begin
  17887. GetProcedureAddress(_RtlMakeSelfRelativeSD, ntdll, 'RtlMakeSelfRelativeSD');
  17888. Result := TFNRtlMakeSelfRelativeSD(_RtlMakeSelfRelativeSD)(
  17889. pAbsoluteSD, pSelfRelativeSD, lpdwBufferLength
  17890. );
  17891. end;
  17892. // Dynamic version of RtlMapGenericMask
  17893. procedure RtlMapGenericMask(
  17894. AccessMask : PACCESS_MASK;
  17895. GenericMapping : PGENERIC_MAPPING
  17896. ); stdcall;
  17897. begin
  17898. GetProcedureAddress(_RtlMapGenericMask, ntdll, 'RtlMapGenericMask');
  17899. TFNRtlMapGenericMask(_RtlMapGenericMask)(
  17900. AccessMask, GenericMapping
  17901. );
  17902. end;
  17903. // Dynamic version of RtlMapSecurityErrorToNtStatus
  17904. function RtlMapSecurityErrorToNtStatus(
  17905. SecurityError : DWORD
  17906. ): NTSTATUS; stdcall;
  17907. begin
  17908. GetProcedureAddress(_RtlMapSecurityErrorToNtStatus, ntdll, 'RtlMapSecurityErrorToNtStatus');
  17909. Result := TFNRtlMapSecurityErrorToNtStatus(_RtlMapSecurityErrorToNtStatus)(
  17910. SecurityError
  17911. );
  17912. end;
  17913. // Dynamic version of RtlMergeRangeLists
  17914. function RtlMergeRangeLists(
  17915. MergedRangeList : PRTL_RANGE_LIST;
  17916. RangeList1 : PRTL_RANGE_LIST;
  17917. RangeList2 : PRTL_RANGE_LIST;
  17918. Flags : ULONG
  17919. ): NTSTATUS; stdcall;
  17920. begin
  17921. GetProcedureAddress(_RtlMergeRangeLists, ntdll, 'RtlMergeRangeLists');
  17922. Result := TFNRtlMergeRangeLists(_RtlMergeRangeLists)(
  17923. MergedRangeList, RangeList1, RangeList2, Flags
  17924. );
  17925. end;
  17926. // Dynamic version of RtlMoveMemory
  17927. procedure RtlMoveMemory(
  17928. Destination : PVOID;
  17929. Source : PVOID;
  17930. Length : SIZE_T
  17931. ); stdcall;
  17932. begin
  17933. GetProcedureAddress(_RtlMoveMemory, ntdll, 'RtlMoveMemory');
  17934. TFNRtlMoveMemory(_RtlMoveMemory)(
  17935. Destination, Source, Length
  17936. );
  17937. end;
  17938. // Dynamic version of RtlNormalizeProcessParams
  17939. function RtlNormalizeProcessParams(
  17940. ProcessParameters : PRTL_USER_PROCESS_PARAMETERS
  17941. ): PRTL_USER_PROCESS_PARAMETERS; stdcall;
  17942. begin
  17943. GetProcedureAddress(_RtlNormalizeProcessParams, ntdll, 'RtlNormalizeProcessParams');
  17944. Result := TFNRtlNormalizeProcessParams(_RtlNormalizeProcessParams)(
  17945. ProcessParameters
  17946. );
  17947. end;
  17948. // Dynamic version of RtlNtStatusToDosError
  17949. function RtlNtStatusToDosError(
  17950. Status : NTSTATUS
  17951. ): ULONG; stdcall;
  17952. begin
  17953. GetProcedureAddress(_RtlNtStatusToDosError, ntdll, 'RtlNtStatusToDosError');
  17954. Result := TFNRtlNtStatusToDosError(_RtlNtStatusToDosError)(
  17955. Status
  17956. );
  17957. end;
  17958. // Dynamic version of RtlNtStatusToDosErrorNoTeb
  17959. function RtlNtStatusToDosErrorNoTeb(
  17960. Status : NTSTATUS
  17961. ): ULONG; stdcall;
  17962. begin
  17963. GetProcedureAddress(_RtlNtStatusToDosErrorNoTeb, ntdll, 'RtlNtStatusToDosErrorNoTeb');
  17964. Result := TFNRtlNtStatusToDosErrorNoTeb(_RtlNtStatusToDosErrorNoTeb)(
  17965. Status
  17966. );
  17967. end;
  17968. // Dynamic version of RtlNumberOfClearBits
  17969. function RtlNumberOfClearBits(
  17970. BitMapHeader : PRTL_BITMAP
  17971. ): ULONG; stdcall;
  17972. begin
  17973. GetProcedureAddress(_RtlNumberOfClearBits, ntdll, 'RtlNumberOfClearBits');
  17974. Result := TFNRtlNumberOfClearBits(_RtlNumberOfClearBits)(
  17975. BitMapHeader
  17976. );
  17977. end;
  17978. // Dynamic version of RtlNumberOfSetBits
  17979. function RtlNumberOfSetBits(
  17980. BitMapHeader : PRTL_BITMAP
  17981. ): ULONG; stdcall;
  17982. begin
  17983. GetProcedureAddress(_RtlNumberOfSetBits, ntdll, 'RtlNumberOfSetBits');
  17984. Result := TFNRtlNumberOfSetBits(_RtlNumberOfSetBits)(
  17985. BitMapHeader
  17986. );
  17987. end;
  17988. // Dynamic version of RtlOemStringToUnicodeSize
  17989. function RtlOemStringToUnicodeSize(
  17990. AnsiString : POEM_STRING
  17991. ): ULONG; stdcall;
  17992. begin
  17993. GetProcedureAddress(_RtlOemStringToUnicodeSize, ntdll, 'RtlOemStringToUnicodeSize');
  17994. Result := TFNRtlOemStringToUnicodeSize(_RtlOemStringToUnicodeSize)(
  17995. AnsiString
  17996. );
  17997. end;
  17998. // Dynamic version of RtlOemStringToUnicodeString
  17999. function RtlOemStringToUnicodeString(
  18000. DestinationString : PUNICODE_STRING;
  18001. SourceString : POEM_STRING;
  18002. AllocateDestinationString : BOOLEAN
  18003. ): NTSTATUS; stdcall;
  18004. begin
  18005. GetProcedureAddress(_RtlOemStringToUnicodeString, ntdll, 'RtlOemStringToUnicodeString');
  18006. Result := TFNRtlOemStringToUnicodeString(_RtlOemStringToUnicodeString)(
  18007. DestinationString, SourceString, AllocateDestinationString
  18008. );
  18009. end;
  18010. // Dynamic version of RtlOemToUnicodeN
  18011. function RtlOemToUnicodeN(
  18012. UnicodeString : PWSTR;
  18013. UnicodeSize : ULONG;
  18014. var ResultSize : ULONG;
  18015. OemString : PCHAR;
  18016. OemSize : ULONG
  18017. ): NTSTATUS; stdcall;
  18018. begin
  18019. GetProcedureAddress(_RtlOemToUnicodeN, ntdll, 'RtlOemToUnicodeN');
  18020. Result := TFNRtlOemToUnicodeN(_RtlOemToUnicodeN)(
  18021. UnicodeString, UnicodeSize, ResultSize, OemString, OemSize
  18022. );
  18023. end;
  18024. // Dynamic version of RtlOpenCurrentUser
  18025. function RtlOpenCurrentUser(
  18026. samDesired : ACCESS_MASK;
  18027. phkResult : PHKEY
  18028. ): NTSTATUS; stdcall;
  18029. begin
  18030. GetProcedureAddress(_RtlOpenCurrentUser, ntdll, 'RtlOpenCurrentUser');
  18031. Result := TFNRtlOpenCurrentUser(_RtlOpenCurrentUser)(
  18032. samDesired, phkResult
  18033. );
  18034. end;
  18035. // Dynamic version of RtlPrefixString
  18036. function RtlPrefixString(
  18037. String1 : PANSI_STRING;
  18038. String2 : PANSI_STRING;
  18039. CaseInsensitive : BOOLEAN
  18040. ): BOOLEAN; stdcall;
  18041. begin
  18042. GetProcedureAddress(_RtlPrefixString, ntdll, 'RtlPrefixString');
  18043. Result := TFNRtlPrefixString(_RtlPrefixString)(
  18044. String1, String2, CaseInsensitive
  18045. );
  18046. end;
  18047. // Dynamic version of RtlPrefixUnicodeString
  18048. function RtlPrefixUnicodeString(
  18049. String1 : PUNICODE_STRING;
  18050. String2 : PUNICODE_STRING;
  18051. CaseInsensitive : BOOLEAN
  18052. ): BOOLEAN; stdcall;
  18053. begin
  18054. GetProcedureAddress(_RtlPrefixUnicodeString, ntdll, 'RtlPrefixUnicodeString');
  18055. Result := TFNRtlPrefixUnicodeString(_RtlPrefixUnicodeString)(
  18056. String1, String2, CaseInsensitive
  18057. );
  18058. end;
  18059. // Dynamic version of RtlQueryDepthSList
  18060. function RtlQueryDepthSList(
  18061. ListHead : PSLIST_HEADER
  18062. ): USHORT; stdcall;
  18063. begin
  18064. GetProcedureAddress(_RtlQueryDepthSList, ntdll, 'RtlQueryDepthSList');
  18065. Result := TFNRtlQueryDepthSList(_RtlQueryDepthSList)(
  18066. ListHead
  18067. );
  18068. end;
  18069. // Dynamic version of RtlQueryEnvironmentVariable_U
  18070. function RtlQueryEnvironmentVariable_U(
  18071. Environment : PVOID;
  18072. VarName : PUNICODE_STRING;
  18073. VarValue : PUNICODE_STRING
  18074. ): NTSTATUS; stdcall;
  18075. begin
  18076. GetProcedureAddress(_RtlQueryEnvironmentVariable_U, ntdll, 'RtlQueryEnvironmentVariable_U');
  18077. Result := TFNRtlQueryEnvironmentVariable_U(_RtlQueryEnvironmentVariable_U)(
  18078. Environment, VarName, VarValue
  18079. );
  18080. end;
  18081. // Dynamic version of RtlQueryInformationAcl
  18082. function RtlQueryInformationAcl(
  18083. pAcl : PACL;
  18084. pAclInformation : PVOID;
  18085. nAclInformationLength : DWORD;
  18086. dwAclInformationClass : ACL_INFORMATION_CLASS
  18087. ): NTSTATUS; stdcall;
  18088. begin
  18089. GetProcedureAddress(_RtlQueryInformationAcl, ntdll, 'RtlQueryInformationAcl');
  18090. Result := TFNRtlQueryInformationAcl(_RtlQueryInformationAcl)(
  18091. pAcl, pAclInformation, nAclInformationLength, dwAclInformationClass
  18092. );
  18093. end;
  18094. // Dynamic version of RtlQueryProcessDebugInformation
  18095. function RtlQueryProcessDebugInformation(
  18096. ProcessId : ULONG;
  18097. DebugInfoClassMask : ULONG;
  18098. DebugBuffer : PDEBUG_BUFFER
  18099. ): NTSTATUS; stdcall;
  18100. begin
  18101. GetProcedureAddress(_RtlQueryProcessDebugInformation, ntdll, 'RtlQueryProcessDebugInformation');
  18102. Result := TFNRtlQueryProcessDebugInformation(_RtlQueryProcessDebugInformation)(
  18103. ProcessId, DebugInfoClassMask, DebugBuffer
  18104. );
  18105. end;
  18106. // Dynamic version of RtlQueryRegistryValues
  18107. function RtlQueryRegistryValues(
  18108. RelativeTo : ULONG;
  18109. Path : LPCWSTR;
  18110. QueryTable : PRTL_QUERY_REGISTRY_TABLE;
  18111. Context : PVOID;
  18112. Environment : PVOID
  18113. ): NTSTATUS; stdcall;
  18114. begin
  18115. GetProcedureAddress(_RtlQueryRegistryValues, ntdll, 'RtlQueryRegistryValues');
  18116. Result := TFNRtlQueryRegistryValues(_RtlQueryRegistryValues)(
  18117. RelativeTo, Path, QueryTable, Context, Environment
  18118. );
  18119. end;
  18120. // Dynamic version of RtlRaiseStatus
  18121. procedure RtlRaiseStatus(
  18122. Status : NTSTATUS
  18123. ); stdcall;
  18124. begin
  18125. GetProcedureAddress(_RtlRaiseStatus, ntdll, 'RtlRaiseStatus');
  18126. TFNRtlRaiseStatus(_RtlRaiseStatus)(
  18127. Status
  18128. );
  18129. end;
  18130. // Dynamic version of RtlRandom
  18131. function RtlRandom(
  18132. Seed : PULONG
  18133. ): ULONG; stdcall;
  18134. begin
  18135. GetProcedureAddress(_RtlRandom, ntdll, 'RtlRandom');
  18136. Result := TFNRtlRandom(_RtlRandom)(
  18137. Seed
  18138. );
  18139. end;
  18140. // Dynamic version of RtlRandomEx
  18141. function RtlRandomEx(
  18142. Seed : PULONG
  18143. ): ULONG; stdcall;
  18144. begin
  18145. GetProcedureAddress(_RtlRandomEx, ntdll, 'RtlRandomEx');
  18146. Result := TFNRtlRandomEx(_RtlRandomEx)(
  18147. Seed
  18148. );
  18149. end;
  18150. // Dynamic version of RtlReAllocateHeap
  18151. function RtlReAllocateHeap(
  18152. hHeap : HANDLE;
  18153. dwFlags : ULONG;
  18154. lpMem : PVOID;
  18155. dwBytes : SIZE_T
  18156. ): PVOID; stdcall;
  18157. begin
  18158. GetProcedureAddress(_RtlReAllocateHeap, ntdll, 'RtlReAllocateHeap');
  18159. Result := TFNRtlReAllocateHeap(_RtlReAllocateHeap)(
  18160. hHeap, dwFlags, lpMem, dwBytes
  18161. );
  18162. end;
  18163. // Dynamic version of RtlReleasePebLock
  18164. procedure RtlReleasePebLock(); stdcall;
  18165. begin
  18166. GetProcedureAddress(_RtlReleasePebLock, ntdll, 'RtlReleasePebLock');
  18167. TFNRtlReleasePebLock(_RtlReleasePebLock)();
  18168. end;
  18169. // Dynamic version of RtlRemoveVectoredExceptionHandler
  18170. function RtlRemoveVectoredExceptionHandler(
  18171. VectoredHandlerHandle : PVOID
  18172. ): ULONG; stdcall;
  18173. begin
  18174. GetProcedureAddress(_RtlRemoveVectoredExceptionHandler, ntdll, 'RtlRemoveVectoredExceptionHandler');
  18175. Result := TFNRtlRemoveVectoredExceptionHandler(_RtlRemoveVectoredExceptionHandler)(
  18176. VectoredHandlerHandle
  18177. );
  18178. end;
  18179. // Dynamic version of RtlRestoreLastWin32Error
  18180. procedure RtlRestoreLastWin32Error(
  18181. dwErrCode : DWORD
  18182. ); stdcall;
  18183. begin
  18184. GetProcedureAddress(_RtlRestoreLastWin32Error, ntdll, 'RtlRestoreLastWin32Error');
  18185. TFNRtlRestoreLastWin32Error(_RtlRestoreLastWin32Error)(
  18186. dwErrCode
  18187. );
  18188. end;
  18189. // Dynamic version of RtlRunDecodeUnicodeString
  18190. procedure RtlRunDecodeUnicodeString(
  18191. CodeSeed : UCHAR;
  18192. StringToDecode : PUNICODE_STRING
  18193. ); stdcall;
  18194. begin
  18195. GetProcedureAddress(_RtlRunDecodeUnicodeString, ntdll, 'RtlRunDecodeUnicodeString');
  18196. TFNRtlRunDecodeUnicodeString(_RtlRunDecodeUnicodeString)(
  18197. CodeSeed, StringToDecode
  18198. );
  18199. end;
  18200. // Dynamic version of RtlRunEncodeUnicodeString
  18201. procedure RtlRunEncodeUnicodeString(
  18202. var CodeSeed : UCHAR;
  18203. StringToEncode : PUNICODE_STRING
  18204. ); stdcall;
  18205. begin
  18206. GetProcedureAddress(_RtlRunEncodeUnicodeString, ntdll, 'RtlRunEncodeUnicodeString');
  18207. TFNRtlRunEncodeUnicodeString(_RtlRunEncodeUnicodeString)(
  18208. CodeSeed, StringToEncode
  18209. );
  18210. end;
  18211. // Dynamic version of RtlSecondsSince1970ToTime
  18212. procedure RtlSecondsSince1970ToTime(
  18213. SecondsSince1970 : ULONG;
  18214. Time : PLARGE_INTEGER
  18215. ); stdcall;
  18216. begin
  18217. GetProcedureAddress(_RtlSecondsSince1970ToTime, ntdll, 'RtlSecondsSince1970ToTime');
  18218. TFNRtlSecondsSince1970ToTime(_RtlSecondsSince1970ToTime)(
  18219. SecondsSince1970, Time
  18220. );
  18221. end;
  18222. // Dynamic version of RtlSecondsSince1980ToTime
  18223. procedure RtlSecondsSince1980ToTime(
  18224. SecondsSince1980 : ULONG;
  18225. Time : PLARGE_INTEGER
  18226. ); stdcall;
  18227. begin
  18228. GetProcedureAddress(_RtlSecondsSince1980ToTime, ntdll, 'RtlSecondsSince1980ToTime');
  18229. TFNRtlSecondsSince1980ToTime(_RtlSecondsSince1980ToTime)(
  18230. SecondsSince1980, Time
  18231. );
  18232. end;
  18233. // Dynamic version of RtlSelfRelativeToAbsoluteSD
  18234. function RtlSelfRelativeToAbsoluteSD(
  18235. pSelfRelativeSD : PSECURITY_DESCRIPTOR;
  18236. pAbsoluteSD : PSECURITY_DESCRIPTOR;
  18237. lpdwAbsoluteSDSize : LPDWORD;
  18238. pDacl : PACL;
  18239. lpdwDaclSize : LPDWORD;
  18240. pSacl : PACL;
  18241. lpdwSaclSize : LPDWORD;
  18242. pOwner : PSID;
  18243. lpdwOwnerSize : LPDWORD;
  18244. pPrimaryGroup : PSID;
  18245. lpdwPrimaryGroupSize : LPDWORD
  18246. ): NTSTATUS; stdcall;
  18247. begin
  18248. GetProcedureAddress(_RtlSelfRelativeToAbsoluteSD, ntdll, 'RtlSelfRelativeToAbsoluteSD');
  18249. Result := TFNRtlSelfRelativeToAbsoluteSD(_RtlSelfRelativeToAbsoluteSD)(
  18250. pSelfRelativeSD, pAbsoluteSD, lpdwAbsoluteSDSize, pDacl, lpdwDaclSize, pSacl, lpdwSaclSize, pOwner, lpdwOwnerSize, pPrimaryGroup, lpdwPrimaryGroupSize
  18251. );
  18252. end;
  18253. // Dynamic version of RtlSetAllBits
  18254. procedure RtlSetAllBits(
  18255. BitMapHeader : PRTL_BITMAP
  18256. ); stdcall;
  18257. begin
  18258. GetProcedureAddress(_RtlSetAllBits, ntdll, 'RtlSetAllBits');
  18259. TFNRtlSetAllBits(_RtlSetAllBits)(
  18260. BitMapHeader
  18261. );
  18262. end;
  18263. // Dynamic version of RtlSetBits
  18264. procedure RtlSetBits(
  18265. BitMapHeader : PRTL_BITMAP;
  18266. StartingIndex : ULONG;
  18267. NumberToSet : ULONG
  18268. ); stdcall;
  18269. begin
  18270. GetProcedureAddress(_RtlSetBits, ntdll, 'RtlSetBits');
  18271. TFNRtlSetBits(_RtlSetBits)(
  18272. BitMapHeader, StartingIndex, NumberToSet
  18273. );
  18274. end;
  18275. // Dynamic version of RtlSetControlSecurityDescriptor
  18276. function RtlSetControlSecurityDescriptor(
  18277. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  18278. ControlBitsOfInterest : SECURITY_DESCRIPTOR_CONTROL;
  18279. ControlBitsToSet : SECURITY_DESCRIPTOR_CONTROL
  18280. ): NTSTATUS; stdcall;
  18281. begin
  18282. GetProcedureAddress(_RtlSetControlSecurityDescriptor, ntdll, 'RtlSetControlSecurityDescriptor');
  18283. Result := TFNRtlSetControlSecurityDescriptor(_RtlSetControlSecurityDescriptor)(
  18284. pSecurityDescriptor, ControlBitsOfInterest, ControlBitsToSet
  18285. );
  18286. end;
  18287. // Dynamic version of RtlSetCriticalSectionSpinCount
  18288. function RtlSetCriticalSectionSpinCount(
  18289. lpCriticalSection : PRTL_CRITICAL_SECTION;
  18290. dwSpinCount : ULONG
  18291. ): DWORD; stdcall;
  18292. begin
  18293. GetProcedureAddress(_RtlSetCriticalSectionSpinCount, ntdll, 'RtlSetCriticalSectionSpinCount');
  18294. Result := TFNRtlSetCriticalSectionSpinCount(_RtlSetCriticalSectionSpinCount)(
  18295. lpCriticalSection, dwSpinCount
  18296. );
  18297. end;
  18298. // Dynamic version of RtlSetCurrentDirectory_U
  18299. function RtlSetCurrentDirectory_U(
  18300. NewCurrentDirectory : PUNICODE_STRING
  18301. ): NTSTATUS; stdcall;
  18302. begin
  18303. GetProcedureAddress(_RtlSetCurrentDirectory_U, ntdll, 'RtlSetCurrentDirectory_U');
  18304. Result := TFNRtlSetCurrentDirectory_U(_RtlSetCurrentDirectory_U)(
  18305. NewCurrentDirectory
  18306. );
  18307. end;
  18308. // Dynamic version of RtlSetDaclSecurityDescriptor
  18309. function RtlSetDaclSecurityDescriptor(
  18310. SecurityDescriptor : PSECURITY_DESCRIPTOR;
  18311. DaclPresent : BOOLEAN;
  18312. Dacl : PACL;
  18313. DaclDefaulted : BOOLEAN
  18314. ): NTSTATUS; stdcall;
  18315. begin
  18316. GetProcedureAddress(_RtlSetDaclSecurityDescriptor, ntdll, 'RtlSetDaclSecurityDescriptor');
  18317. Result := TFNRtlSetDaclSecurityDescriptor(_RtlSetDaclSecurityDescriptor)(
  18318. SecurityDescriptor, DaclPresent, Dacl, DaclDefaulted
  18319. );
  18320. end;
  18321. // Dynamic version of RtlSetGroupSecurityDescriptor
  18322. function RtlSetGroupSecurityDescriptor(
  18323. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  18324. pGroup : PSID;
  18325. bGroupDefaulted : BOOLEAN
  18326. ): NTSTATUS; stdcall;
  18327. begin
  18328. GetProcedureAddress(_RtlSetGroupSecurityDescriptor, ntdll, 'RtlSetGroupSecurityDescriptor');
  18329. Result := TFNRtlSetGroupSecurityDescriptor(_RtlSetGroupSecurityDescriptor)(
  18330. pSecurityDescriptor, pGroup, bGroupDefaulted
  18331. );
  18332. end;
  18333. // Dynamic version of RtlSetInformationAcl
  18334. function RtlSetInformationAcl(
  18335. pAcl : PACL;
  18336. pAclInformation : PVOID;
  18337. nInformationLength : DWORD;
  18338. dwAclInformationClass : ACL_INFORMATION_CLASS
  18339. ): NTSTATUS; stdcall;
  18340. begin
  18341. GetProcedureAddress(_RtlSetInformationAcl, ntdll, 'RtlSetInformationAcl');
  18342. Result := TFNRtlSetInformationAcl(_RtlSetInformationAcl)(
  18343. pAcl, pAclInformation, nInformationLength, dwAclInformationClass
  18344. );
  18345. end;
  18346. // Dynamic version of RtlSetLastWin32ErrorAndNtStatusFromNtStatus
  18347. function RtlSetLastWin32ErrorAndNtStatusFromNtStatus(
  18348. Status : NTSTATUS
  18349. ): ULONG; stdcall;
  18350. begin
  18351. GetProcedureAddress(_RtlSetLastWin32ErrorAndNtStatusFromNtStatus, ntdll, 'RtlSetLastWin32ErrorAndNtStatusFromNtStatus');
  18352. Result := TFNRtlSetLastWin32ErrorAndNtStatusFromNtStatus(_RtlSetLastWin32ErrorAndNtStatusFromNtStatus)(
  18353. Status
  18354. );
  18355. end;
  18356. // Dynamic version of RtlSetOwnerSecurityDescriptor
  18357. function RtlSetOwnerSecurityDescriptor(
  18358. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  18359. pOwner : PSID;
  18360. bOwnerDefaulted : BOOLEAN
  18361. ): NTSTATUS; stdcall;
  18362. begin
  18363. GetProcedureAddress(_RtlSetOwnerSecurityDescriptor, ntdll, 'RtlSetOwnerSecurityDescriptor');
  18364. Result := TFNRtlSetOwnerSecurityDescriptor(_RtlSetOwnerSecurityDescriptor)(
  18365. pSecurityDescriptor, pOwner, bOwnerDefaulted
  18366. );
  18367. end;
  18368. // Dynamic version of RtlSetProcessIsCritical
  18369. function RtlSetProcessIsCritical(
  18370. bIsCritical : BOOLEAN;
  18371. pbOldIsCriticalValue : PBOOLEAN;
  18372. bUnknownCanBeFalse : BOOLEAN
  18373. ): NTSTATUS; stdcall;
  18374. begin
  18375. GetProcedureAddress(_RtlSetProcessIsCritical, ntdll, 'RtlSetProcessIsCritical');
  18376. Result := TFNRtlSetProcessIsCritical(_RtlSetProcessIsCritical)(
  18377. bIsCritical, pbOldIsCriticalValue, bUnknownCanBeFalse
  18378. );
  18379. end;
  18380. // Dynamic version of RtlSetSaclSecurityDescriptor
  18381. function RtlSetSaclSecurityDescriptor(
  18382. pSecurityDescriptor : PSECURITY_DESCRIPTOR;
  18383. bSaclPresent : BOOLEAN;
  18384. pSacl : PACL;
  18385. SaclDefaulted : BOOLEAN
  18386. ): NTSTATUS; stdcall;
  18387. begin
  18388. GetProcedureAddress(_RtlSetSaclSecurityDescriptor, ntdll, 'RtlSetSaclSecurityDescriptor');
  18389. Result := TFNRtlSetSaclSecurityDescriptor(_RtlSetSaclSecurityDescriptor)(
  18390. pSecurityDescriptor, bSaclPresent, pSacl, SaclDefaulted
  18391. );
  18392. end;
  18393. // Dynamic version of RtlSetThreadIsCritical
  18394. function RtlSetThreadIsCritical(
  18395. bIsCritical : BOOLEAN;
  18396. pbOldIsCriticalValue : PBOOLEAN;
  18397. bUnknownCanBeFalse : BOOLEAN
  18398. ): NTSTATUS; stdcall;
  18399. begin
  18400. GetProcedureAddress(_RtlSetThreadIsCritical, ntdll, 'RtlSetThreadIsCritical');
  18401. Result := TFNRtlSetThreadIsCritical(_RtlSetThreadIsCritical)(
  18402. bIsCritical, pbOldIsCriticalValue, bUnknownCanBeFalse
  18403. );
  18404. end;
  18405. // Dynamic version of RtlSizeHeap
  18406. function RtlSizeHeap(
  18407. hHeap : HANDLE;
  18408. dwFlags : ULONG;
  18409. lpMem : PVOID
  18410. ): SIZE_T; stdcall;
  18411. begin
  18412. GetProcedureAddress(_RtlSizeHeap, ntdll, 'RtlSizeHeap');
  18413. Result := TFNRtlSizeHeap(_RtlSizeHeap)(
  18414. hHeap, dwFlags, lpMem
  18415. );
  18416. end;
  18417. // Dynamic version of RtlStringFromGUID
  18418. function RtlStringFromGUID(
  18419. Guid : REFGUID;
  18420. GuidString : PUNICODE_STRING
  18421. ): NTSTATUS; stdcall;
  18422. begin
  18423. GetProcedureAddress(_RtlStringFromGUID, ntdll, 'RtlStringFromGUID');
  18424. Result := TFNRtlStringFromGUID(_RtlStringFromGUID)(
  18425. Guid, GuidString
  18426. );
  18427. end;
  18428. // Dynamic version of RtlSubAuthorityCountSid
  18429. function RtlSubAuthorityCountSid(
  18430. pSid : PSID
  18431. ): PUCHAR; stdcall;
  18432. begin
  18433. GetProcedureAddress(_RtlSubAuthorityCountSid, ntdll, 'RtlSubAuthorityCountSid');
  18434. Result := TFNRtlSubAuthorityCountSid(_RtlSubAuthorityCountSid)(
  18435. pSid
  18436. );
  18437. end;
  18438. // Dynamic version of RtlSubAuthoritySid
  18439. function RtlSubAuthoritySid(
  18440. pSid : PSID;
  18441. nSubAuthority : DWORD
  18442. ): PDWORD; stdcall;
  18443. begin
  18444. GetProcedureAddress(_RtlSubAuthoritySid, ntdll, 'RtlSubAuthoritySid');
  18445. Result := TFNRtlSubAuthoritySid(_RtlSubAuthoritySid)(
  18446. pSid, nSubAuthority
  18447. );
  18448. end;
  18449. // Dynamic version of RtlSystemTimeToLocalTime
  18450. function RtlSystemTimeToLocalTime(
  18451. SystemTime : PLARGE_INTEGER;
  18452. LocalTime : PLARGE_INTEGER
  18453. ): NTSTATUS; stdcall;
  18454. begin
  18455. GetProcedureAddress(_RtlSystemTimeToLocalTime, ntdll, 'RtlSystemTimeToLocalTime');
  18456. Result := TFNRtlSystemTimeToLocalTime(_RtlSystemTimeToLocalTime)(
  18457. SystemTime, LocalTime
  18458. );
  18459. end;
  18460. // Dynamic version of RtlTimeFieldsToTime
  18461. function RtlTimeFieldsToTime(
  18462. TimeFields : PTIME_FIELDS;
  18463. Time : PLARGE_INTEGER
  18464. ): BOOLEAN; stdcall;
  18465. begin
  18466. GetProcedureAddress(_RtlTimeFieldsToTime, ntdll, 'RtlTimeFieldsToTime');
  18467. Result := TFNRtlTimeFieldsToTime(_RtlTimeFieldsToTime)(
  18468. TimeFields, Time
  18469. );
  18470. end;
  18471. // Dynamic version of RtlTimeToElapsedTimeFields
  18472. procedure RtlTimeToElapsedTimeFields(
  18473. Time : PLARGE_INTEGER;
  18474. TimeFields : PTIME_FIELDS
  18475. ); stdcall;
  18476. begin
  18477. GetProcedureAddress(_RtlTimeToElapsedTimeFields, ntdll, 'RtlTimeToElapsedTimeFields');
  18478. TFNRtlTimeToElapsedTimeFields(_RtlTimeToElapsedTimeFields)(
  18479. Time, TimeFields
  18480. );
  18481. end;
  18482. {$IFNDEF JWA_INCLUDEMODE}
  18483. // Dynamic version of RtlTimeToSecondsSince1970
  18484. function RtlTimeToSecondsSince1970(
  18485. Time : PLARGE_INTEGER;
  18486. ElapsedSeconds : PULONG
  18487. ): BOOLEAN; stdcall;
  18488. begin
  18489. GetProcedureAddress(_RtlTimeToSecondsSince1970, ntdll, 'RtlTimeToSecondsSince1970');
  18490. Result := TFNRtlTimeToSecondsSince1970(_RtlTimeToSecondsSince1970)(
  18491. Time, ElapsedSeconds
  18492. );
  18493. end;
  18494. {$ENDIF JWA_INCLUDEMODE}
  18495. // Dynamic version of RtlTimeToSecondsSince1980
  18496. function RtlTimeToSecondsSince1980(
  18497. Time : PLARGE_INTEGER;
  18498. ElapsedSeconds : PULONG
  18499. ): BOOLEAN; stdcall;
  18500. begin
  18501. GetProcedureAddress(_RtlTimeToSecondsSince1980, ntdll, 'RtlTimeToSecondsSince1980');
  18502. Result := TFNRtlTimeToSecondsSince1980(_RtlTimeToSecondsSince1980)(
  18503. Time, ElapsedSeconds
  18504. );
  18505. end;
  18506. // Dynamic version of RtlTimeToTimeFields
  18507. procedure RtlTimeToTimeFields(
  18508. Time : PLARGE_INTEGER;
  18509. TimeFields : PTIME_FIELDS
  18510. ); stdcall;
  18511. begin
  18512. GetProcedureAddress(_RtlTimeToTimeFields, ntdll, 'RtlTimeToTimeFields');
  18513. TFNRtlTimeToTimeFields(_RtlTimeToTimeFields)(
  18514. Time, TimeFields
  18515. );
  18516. end;
  18517. // Dynamic version of RtlTryEnterCriticalSection
  18518. function RtlTryEnterCriticalSection(
  18519. lpCriticalSection : PRTL_CRITICAL_SECTION
  18520. ): BOOL; stdcall;
  18521. begin
  18522. GetProcedureAddress(_RtlTryEnterCriticalSection, ntdll, 'RtlTryEnterCriticalSection');
  18523. Result := TFNRtlTryEnterCriticalSection(_RtlTryEnterCriticalSection)(
  18524. lpCriticalSection
  18525. );
  18526. end;
  18527. // Dynamic version of RtlUnicodeStringToAnsiSize
  18528. function RtlUnicodeStringToAnsiSize(
  18529. UnicodeString : PUNICODE_STRING
  18530. ): ULONG; stdcall;
  18531. begin
  18532. GetProcedureAddress(_RtlUnicodeStringToAnsiSize, ntdll, 'RtlUnicodeStringToAnsiSize');
  18533. Result := TFNRtlUnicodeStringToAnsiSize(_RtlUnicodeStringToAnsiSize)(
  18534. UnicodeString
  18535. );
  18536. end;
  18537. {$IFNDEF JWA_INCLUDEMODE}
  18538. // Dynamic version of RtlUnicodeStringToAnsiString
  18539. function RtlUnicodeStringToAnsiString(
  18540. DestinationString : PANSI_STRING;
  18541. SourceString : PUNICODE_STRING;
  18542. AllocateDestinationString : BOOLEAN
  18543. ): NTSTATUS; stdcall;
  18544. begin
  18545. GetProcedureAddress(_RtlUnicodeStringToAnsiString, ntdll, 'RtlUnicodeStringToAnsiString');
  18546. Result := TFNRtlUnicodeStringToAnsiString(_RtlUnicodeStringToAnsiString)(
  18547. DestinationString, SourceString, AllocateDestinationString
  18548. );
  18549. end;
  18550. {$ENDIF JWA_INCLUDEMODE}
  18551. // Dynamic version of RtlUnicodeStringToCountedOemString
  18552. function RtlUnicodeStringToCountedOemString(
  18553. DestinationString : POEM_STRING;
  18554. SourceString : PUNICODE_STRING;
  18555. AllocateDestinationString : BOOLEAN
  18556. ): NTSTATUS; stdcall;
  18557. begin
  18558. GetProcedureAddress(_RtlUnicodeStringToCountedOemString, ntdll, 'RtlUnicodeStringToCountedOemString');
  18559. Result := TFNRtlUnicodeStringToCountedOemString(_RtlUnicodeStringToCountedOemString)(
  18560. DestinationString, SourceString, AllocateDestinationString
  18561. );
  18562. end;
  18563. // Dynamic version of RtlUnicodeStringToInteger
  18564. function RtlUnicodeStringToInteger(
  18565. Str : PUNICODE_STRING;
  18566. Base : ULONG;
  18567. Value : PULONG
  18568. ): NTSTATUS; stdcall;
  18569. begin
  18570. GetProcedureAddress(_RtlUnicodeStringToInteger, ntdll, 'RtlUnicodeStringToInteger');
  18571. Result := TFNRtlUnicodeStringToInteger(_RtlUnicodeStringToInteger)(
  18572. Str, Base, Value
  18573. );
  18574. end;
  18575. // Dynamic version of RtlUnicodeStringToOemSize
  18576. function RtlUnicodeStringToOemSize(
  18577. UnicodeString : PUNICODE_STRING
  18578. ): ULONG; stdcall;
  18579. begin
  18580. GetProcedureAddress(_RtlUnicodeStringToOemSize, ntdll, 'RtlUnicodeStringToOemSize');
  18581. Result := TFNRtlUnicodeStringToOemSize(_RtlUnicodeStringToOemSize)(
  18582. UnicodeString
  18583. );
  18584. end;
  18585. {$IFNDEF JWA_INCLUDEMODE}
  18586. // Dynamic version of RtlUnicodeStringToOemString
  18587. function RtlUnicodeStringToOemString(
  18588. DestinationString : POEM_STRING;
  18589. SourceString : PCUNICODE_STRING;
  18590. AllocateDestinationString : BOOLEAN
  18591. ): NTSTATUS; stdcall;
  18592. begin
  18593. GetProcedureAddress(_RtlUnicodeStringToOemString, ntdll, 'RtlUnicodeStringToOemString');
  18594. Result := TFNRtlUnicodeStringToOemString(_RtlUnicodeStringToOemString)(
  18595. DestinationString, SourceString, AllocateDestinationString
  18596. );
  18597. end;
  18598. // Dynamic version of RtlUnicodeToMultiByteSize
  18599. function RtlUnicodeToMultiByteSize(
  18600. BytesInMultiByteString : PULONG;
  18601. UnicodeString : PWSTR;
  18602. BytesInUnicodeString : ULONG
  18603. ): NTSTATUS; stdcall;
  18604. begin
  18605. GetProcedureAddress(_RtlUnicodeToMultiByteSize, ntdll, 'RtlUnicodeToMultiByteSize');
  18606. Result := TFNRtlUnicodeToMultiByteSize(_RtlUnicodeToMultiByteSize)(
  18607. BytesInMultiByteString, UnicodeString, BytesInUnicodeString
  18608. );
  18609. end;
  18610. {$ENDIF JWA_INCLUDEMODE}
  18611. // Dynamic version of RtlUniform
  18612. function RtlUniform(
  18613. Seed : PULONG
  18614. ): ULONG; stdcall;
  18615. begin
  18616. GetProcedureAddress(_RtlUniform, ntdll, 'RtlUniform');
  18617. Result := TFNRtlUniform(_RtlUniform)(
  18618. Seed
  18619. );
  18620. end;
  18621. // Dynamic version of RtlUnwind
  18622. procedure RtlUnwind(
  18623. TargetFrame : PVOID;
  18624. TargetIp : PVOID;
  18625. ExceptionRecord : PEXCEPTION_RECORD;
  18626. ReturnValue : PVOID
  18627. ); stdcall;
  18628. begin
  18629. GetProcedureAddress(_RtlUnwind, ntdll, 'RtlUnwind');
  18630. TFNRtlUnwind(_RtlUnwind)(
  18631. TargetFrame, TargetIp, ExceptionRecord, ReturnValue
  18632. );
  18633. end;
  18634. // Dynamic version of RtlUpcaseUnicodeChar
  18635. function RtlUpcaseUnicodeChar(
  18636. SourceCharacter : WCHAR
  18637. ): WCHAR; stdcall;
  18638. begin
  18639. GetProcedureAddress(_RtlUpcaseUnicodeChar, ntdll, 'RtlUpcaseUnicodeChar');
  18640. Result := TFNRtlUpcaseUnicodeChar(_RtlUpcaseUnicodeChar)(
  18641. SourceCharacter
  18642. );
  18643. end;
  18644. // Dynamic version of RtlUpcaseUnicodeString
  18645. function RtlUpcaseUnicodeString(
  18646. DestinationString : PUNICODE_STRING;
  18647. SourceString : PUNICODE_STRING;
  18648. AllocateDestinationString : BOOLEAN
  18649. ): NTSTATUS; stdcall;
  18650. begin
  18651. GetProcedureAddress(_RtlUpcaseUnicodeString, ntdll, 'RtlUpcaseUnicodeString');
  18652. Result := TFNRtlUpcaseUnicodeString(_RtlUpcaseUnicodeString)(
  18653. DestinationString, SourceString, AllocateDestinationString
  18654. );
  18655. end;
  18656. // Dynamic version of RtlUpcaseUnicodeStringToAnsiString
  18657. function RtlUpcaseUnicodeStringToAnsiString(
  18658. DestinationString : PSTRING;
  18659. SourceString : PUNICODE_STRING;
  18660. AllocateDestinationString : BOOLEAN
  18661. ): NTSTATUS; stdcall;
  18662. begin
  18663. GetProcedureAddress(_RtlUpcaseUnicodeStringToAnsiString, ntdll, 'RtlUpcaseUnicodeStringToAnsiString');
  18664. Result := TFNRtlUpcaseUnicodeStringToAnsiString(_RtlUpcaseUnicodeStringToAnsiString)(
  18665. DestinationString, SourceString, AllocateDestinationString
  18666. );
  18667. end;
  18668. // Dynamic version of RtlUpcaseUnicodeStringToCountedOemString
  18669. function RtlUpcaseUnicodeStringToCountedOemString(
  18670. DestinationString : PSTRING;
  18671. SourceString : PUNICODE_STRING;
  18672. AllocateDestinationString : BOOLEAN
  18673. ): NTSTATUS; stdcall;
  18674. begin
  18675. GetProcedureAddress(_RtlUpcaseUnicodeStringToCountedOemString, ntdll, 'RtlUpcaseUnicodeStringToCountedOemString');
  18676. Result := TFNRtlUpcaseUnicodeStringToCountedOemString(_RtlUpcaseUnicodeStringToCountedOemString)(
  18677. DestinationString, SourceString, AllocateDestinationString
  18678. );
  18679. end;
  18680. // Dynamic version of RtlUpcaseUnicodeStringToOemString
  18681. function RtlUpcaseUnicodeStringToOemString(
  18682. DestinationString : PSTRING;
  18683. SourceString : PUNICODE_STRING;
  18684. AllocateDestinationString : BOOLEAN
  18685. ): NTSTATUS; stdcall;
  18686. begin
  18687. GetProcedureAddress(_RtlUpcaseUnicodeStringToOemString, ntdll, 'RtlUpcaseUnicodeStringToOemString');
  18688. Result := TFNRtlUpcaseUnicodeStringToOemString(_RtlUpcaseUnicodeStringToOemString)(
  18689. DestinationString, SourceString, AllocateDestinationString
  18690. );
  18691. end;
  18692. // Dynamic version of RtlUpcaseUnicodeToMultiByteN
  18693. function RtlUpcaseUnicodeToMultiByteN(
  18694. MbString : PCHAR;
  18695. MbSize : ULONG;
  18696. var ResultSize : ULONG;
  18697. UnicodeString : PWSTR;
  18698. UnicodeSize : ULONG
  18699. ): NTSTATUS; stdcall;
  18700. begin
  18701. GetProcedureAddress(_RtlUpcaseUnicodeToMultiByteN, ntdll, 'RtlUpcaseUnicodeToMultiByteN');
  18702. Result := TFNRtlUpcaseUnicodeToMultiByteN(_RtlUpcaseUnicodeToMultiByteN)(
  18703. MbString, MbSize, ResultSize, UnicodeString, UnicodeSize
  18704. );
  18705. end;
  18706. // Dynamic version of RtlUpcaseUnicodeToOemN
  18707. function RtlUpcaseUnicodeToOemN(
  18708. OemString : PCHAR;
  18709. OemSize : ULONG;
  18710. var ResultSize : ULONG;
  18711. UnicodeString : PWSTR;
  18712. UnicodeSize : ULONG
  18713. ): NTSTATUS; stdcall;
  18714. begin
  18715. GetProcedureAddress(_RtlUpcaseUnicodeToOemN, ntdll, 'RtlUpcaseUnicodeToOemN');
  18716. Result := TFNRtlUpcaseUnicodeToOemN(_RtlUpcaseUnicodeToOemN)(
  18717. OemString, OemSize, ResultSize, UnicodeString, UnicodeSize
  18718. );
  18719. end;
  18720. // Dynamic version of RtlUpperChar
  18721. function RtlUpperChar(
  18722. Character : CHAR
  18723. ): CHAR; stdcall;
  18724. begin
  18725. GetProcedureAddress(_RtlUpperChar, ntdll, 'RtlUpperChar');
  18726. Result := TFNRtlUpperChar(_RtlUpperChar)(
  18727. Character
  18728. );
  18729. end;
  18730. // Dynamic version of RtlUpperString
  18731. procedure RtlUpperString(
  18732. DestinationString : PSTRING;
  18733. SourceString : PSTRING
  18734. ); stdcall;
  18735. begin
  18736. GetProcedureAddress(_RtlUpperString, ntdll, 'RtlUpperString');
  18737. TFNRtlUpperString(_RtlUpperString)(
  18738. DestinationString, SourceString
  18739. );
  18740. end;
  18741. // Dynamic version of RtlValidAcl
  18742. function RtlValidAcl(
  18743. Acl : PACL
  18744. ): BOOLEAN; stdcall;
  18745. begin
  18746. GetProcedureAddress(_RtlValidAcl, ntdll, 'RtlValidAcl');
  18747. Result := TFNRtlValidAcl(_RtlValidAcl)(
  18748. Acl
  18749. );
  18750. end;
  18751. // Dynamic version of RtlValidRelativeSecurityDescriptor
  18752. function RtlValidRelativeSecurityDescriptor(
  18753. SecurityDescriptorInput : PSECURITY_DESCRIPTOR;
  18754. SecurityDescriptorLength : ULONG;
  18755. RequiredInformation : SECURITY_INFORMATION
  18756. ): BOOLEAN; stdcall;
  18757. begin
  18758. GetProcedureAddress(_RtlValidRelativeSecurityDescriptor, ntdll, 'RtlValidRelativeSecurityDescriptor');
  18759. Result := TFNRtlValidRelativeSecurityDescriptor(_RtlValidRelativeSecurityDescriptor)(
  18760. SecurityDescriptorInput, SecurityDescriptorLength, RequiredInformation
  18761. );
  18762. end;
  18763. // Dynamic version of RtlValidSecurityDescriptor
  18764. function RtlValidSecurityDescriptor(
  18765. SecurityDescriptor : PSECURITY_DESCRIPTOR
  18766. ): BOOLEAN; stdcall;
  18767. begin
  18768. GetProcedureAddress(_RtlValidSecurityDescriptor, ntdll, 'RtlValidSecurityDescriptor');
  18769. Result := TFNRtlValidSecurityDescriptor(_RtlValidSecurityDescriptor)(
  18770. SecurityDescriptor
  18771. );
  18772. end;
  18773. // Dynamic version of RtlValidSid
  18774. function RtlValidSid(
  18775. pSid : PSID
  18776. ): BOOLEAN; stdcall;
  18777. begin
  18778. GetProcedureAddress(_RtlValidSid, ntdll, 'RtlValidSid');
  18779. Result := TFNRtlValidSid(_RtlValidSid)(
  18780. pSid
  18781. );
  18782. end;
  18783. // Dynamic version of RtlValidateHeap
  18784. function RtlValidateHeap(
  18785. hHeap : HANDLE;
  18786. dwFlags : ULONG;
  18787. lpMem : LPCVOID
  18788. ): BOOL; stdcall;
  18789. begin
  18790. GetProcedureAddress(_RtlValidateHeap, ntdll, 'RtlValidateHeap');
  18791. Result := TFNRtlValidateHeap(_RtlValidateHeap)(
  18792. hHeap, dwFlags, lpMem
  18793. );
  18794. end;
  18795. // Dynamic version of RtlValidateUnicodeString
  18796. function RtlValidateUnicodeString(
  18797. dwMustBeNull : ULONG;
  18798. ValidateThis : PUNICODE_STRING
  18799. ): NTSTATUS; stdcall;
  18800. begin
  18801. GetProcedureAddress(_RtlValidateUnicodeString, ntdll, 'RtlValidateUnicodeString');
  18802. Result := TFNRtlValidateUnicodeString(_RtlValidateUnicodeString)(
  18803. dwMustBeNull, ValidateThis
  18804. );
  18805. end;
  18806. // Dynamic version of RtlVerifyVersionInfo
  18807. function RtlVerifyVersionInfo(
  18808. VersionInfo : PRTL_OSVERSIONINFOEXW;
  18809. TypeMask : ULONG;
  18810. ConditionMask : ULONGLONG
  18811. ): NTSTATUS; stdcall;
  18812. begin
  18813. GetProcedureAddress(_RtlVerifyVersionInfo, ntdll, 'RtlVerifyVersionInfo');
  18814. Result := TFNRtlVerifyVersionInfo(_RtlVerifyVersionInfo)(
  18815. VersionInfo, TypeMask, ConditionMask
  18816. );
  18817. end;
  18818. // Dynamic version of RtlVolumeDeviceToDosName
  18819. function RtlVolumeDeviceToDosName(
  18820. VolumeDeviceObject : PVOID;
  18821. DosName : PUNICODE_STRING
  18822. ): NTSTATUS; stdcall;
  18823. begin
  18824. GetProcedureAddress(_RtlVolumeDeviceToDosName, ntdll, 'RtlVolumeDeviceToDosName');
  18825. Result := TFNRtlVolumeDeviceToDosName(_RtlVolumeDeviceToDosName)(
  18826. VolumeDeviceObject, DosName
  18827. );
  18828. end;
  18829. // Dynamic version of RtlWriteRegistryValue
  18830. function RtlWriteRegistryValue(
  18831. RelativeTo : ULONG;
  18832. Path : LPCWSTR;
  18833. ValueName : LPCWSTR;
  18834. ValueType : ULONG;
  18835. ValueData : PVOID;
  18836. ValueLength : ULONG
  18837. ): NTSTATUS; stdcall;
  18838. begin
  18839. GetProcedureAddress(_RtlWriteRegistryValue, ntdll, 'RtlWriteRegistryValue');
  18840. Result := TFNRtlWriteRegistryValue(_RtlWriteRegistryValue)(
  18841. RelativeTo, Path, ValueName, ValueType, ValueData, ValueLength
  18842. );
  18843. end;
  18844. // Dynamic version of RtlZeroHeap
  18845. function RtlZeroHeap(
  18846. hHeap : HANDLE;
  18847. dwFlags : ULONG
  18848. ): BOOLEAN; stdcall;
  18849. begin
  18850. GetProcedureAddress(_RtlZeroHeap, ntdll, 'RtlZeroHeap');
  18851. Result := TFNRtlZeroHeap(_RtlZeroHeap)(
  18852. hHeap, dwFlags
  18853. );
  18854. end;
  18855. // Dynamic version of RtlZeroMemory
  18856. procedure RtlZeroMemory(
  18857. Destination : PVOID;
  18858. Length : SIZE_T
  18859. ); stdcall;
  18860. begin
  18861. GetProcedureAddress(_RtlZeroMemory, ntdll, 'RtlZeroMemory');
  18862. TFNRtlZeroMemory(_RtlZeroMemory)(
  18863. Destination, Length
  18864. );
  18865. end;
  18866. // Dynamic version of RtlpNotOwnerCriticalSection
  18867. function RtlpNotOwnerCriticalSection(
  18868. lpCriticalSection : PRTL_CRITICAL_SECTION
  18869. ): BOOLEAN; stdcall;
  18870. begin
  18871. GetProcedureAddress(_RtlpNotOwnerCriticalSection, ntdll, 'RtlpNotOwnerCriticalSection');
  18872. Result := TFNRtlpNotOwnerCriticalSection(_RtlpNotOwnerCriticalSection)(
  18873. lpCriticalSection
  18874. );
  18875. end;
  18876. // Dynamic version of RtlpNtCreateKey
  18877. function RtlpNtCreateKey(
  18878. KeyHandle : PHANDLE;
  18879. DesiredAccess : ACCESS_MASK;
  18880. ObjectAttributes : POBJECT_ATTRIBUTES;
  18881. Unused1 : ULONG;
  18882. Unused2 : ULONG;
  18883. Disposition : PULONG
  18884. ): NTSTATUS; stdcall;
  18885. begin
  18886. GetProcedureAddress(_RtlpNtCreateKey, ntdll, 'RtlpNtCreateKey');
  18887. Result := TFNRtlpNtCreateKey(_RtlpNtCreateKey)(
  18888. KeyHandle, DesiredAccess, ObjectAttributes, Unused1, Unused2, Disposition
  18889. );
  18890. end;
  18891. // Dynamic version of RtlpNtEnumerateSubKey
  18892. function RtlpNtEnumerateSubKey(
  18893. KeyHandle : HANDLE;
  18894. SubKeyName : PUNICODE_STRING;
  18895. Index : ULONG;
  18896. Unused1 : ULONG
  18897. ): NTSTATUS; stdcall;
  18898. begin
  18899. GetProcedureAddress(_RtlpNtEnumerateSubKey, ntdll, 'RtlpNtEnumerateSubKey');
  18900. Result := TFNRtlpNtEnumerateSubKey(_RtlpNtEnumerateSubKey)(
  18901. KeyHandle, SubKeyName, Index, Unused1
  18902. );
  18903. end;
  18904. // Dynamic version of RtlpNtMakeTemporaryKey
  18905. function RtlpNtMakeTemporaryKey(
  18906. KeyHandle : HANDLE
  18907. ): NTSTATUS; stdcall;
  18908. begin
  18909. GetProcedureAddress(_RtlpNtMakeTemporaryKey, ntdll, 'RtlpNtMakeTemporaryKey');
  18910. Result := TFNRtlpNtMakeTemporaryKey(_RtlpNtMakeTemporaryKey)(
  18911. KeyHandle
  18912. );
  18913. end;
  18914. // Dynamic version of RtlpNtOpenKey
  18915. function RtlpNtOpenKey(
  18916. KeyHandle : HANDLE;
  18917. DesiredAccess : ACCESS_MASK;
  18918. ObjectAttributes : POBJECT_ATTRIBUTES;
  18919. Unused : ULONG
  18920. ): NTSTATUS; stdcall;
  18921. begin
  18922. GetProcedureAddress(_RtlpNtOpenKey, ntdll, 'RtlpNtOpenKey');
  18923. Result := TFNRtlpNtOpenKey(_RtlpNtOpenKey)(
  18924. KeyHandle, DesiredAccess, ObjectAttributes, Unused
  18925. );
  18926. end;
  18927. // Dynamic version of RtlpNtQueryValueKey
  18928. function RtlpNtQueryValueKey(
  18929. KeyHandle : HANDLE;
  18930. Type_ : PULONG;
  18931. Data : PVOID;
  18932. DataSize : PULONG;
  18933. Unused : ULONG
  18934. ): NTSTATUS; stdcall;
  18935. begin
  18936. GetProcedureAddress(_RtlpNtQueryValueKey, ntdll, 'RtlpNtQueryValueKey');
  18937. Result := TFNRtlpNtQueryValueKey(_RtlpNtQueryValueKey)(
  18938. KeyHandle, Type_, Data, DataSize, Unused
  18939. );
  18940. end;
  18941. // Dynamic version of RtlpNtSetValueKey
  18942. function RtlpNtSetValueKey(
  18943. KeyHandle : HANDLE;
  18944. Type_ : ULONG;
  18945. Data : PVOID;
  18946. DataSize : ULONG
  18947. ): NTSTATUS; stdcall;
  18948. begin
  18949. GetProcedureAddress(_RtlpNtSetValueKey, ntdll, 'RtlpNtSetValueKey');
  18950. Result := TFNRtlpNtSetValueKey(_RtlpNtSetValueKey)(
  18951. KeyHandle, Type_, Data, DataSize
  18952. );
  18953. end;
  18954. // Dynamic version of RtlxAnsiStringToUnicodeSize
  18955. function RtlxAnsiStringToUnicodeSize(
  18956. AnsiString : PANSI_STRING
  18957. ): ULONG; stdcall;
  18958. begin
  18959. GetProcedureAddress(_RtlxAnsiStringToUnicodeSize, ntdll, 'RtlxAnsiStringToUnicodeSize');
  18960. Result := TFNRtlxAnsiStringToUnicodeSize(_RtlxAnsiStringToUnicodeSize)(
  18961. AnsiString
  18962. );
  18963. end;
  18964. // Dynamic version of RtlxOemStringToUnicodeSize
  18965. function RtlxOemStringToUnicodeSize(
  18966. AnsiString : POEM_STRING
  18967. ): ULONG; stdcall;
  18968. begin
  18969. GetProcedureAddress(_RtlxOemStringToUnicodeSize, ntdll, 'RtlxOemStringToUnicodeSize');
  18970. Result := TFNRtlxOemStringToUnicodeSize(_RtlxOemStringToUnicodeSize)(
  18971. AnsiString
  18972. );
  18973. end;
  18974. // Dynamic version of RtlxUnicodeStringToAnsiSize
  18975. function RtlxUnicodeStringToAnsiSize(
  18976. UnicodeString : PUNICODE_STRING
  18977. ): ULONG; stdcall;
  18978. begin
  18979. GetProcedureAddress(_RtlxUnicodeStringToAnsiSize, ntdll, 'RtlxUnicodeStringToAnsiSize');
  18980. Result := TFNRtlxUnicodeStringToAnsiSize(_RtlxUnicodeStringToAnsiSize)(
  18981. UnicodeString
  18982. );
  18983. end;
  18984. // Dynamic version of RtlxUnicodeStringToOemSize
  18985. function RtlxUnicodeStringToOemSize(
  18986. UnicodeString : PUNICODE_STRING
  18987. ): ULONG; stdcall;
  18988. begin
  18989. GetProcedureAddress(_RtlxUnicodeStringToOemSize, ntdll, 'RtlxUnicodeStringToOemSize');
  18990. Result := TFNRtlxUnicodeStringToOemSize(_RtlxUnicodeStringToOemSize)(
  18991. UnicodeString
  18992. );
  18993. end;
  18994. {$IFNDEF JWA_INCLUDEMODE}
  18995. // Dynamic version of VerSetConditionMask
  18996. function VerSetConditionMask(
  18997. ConditionMask : ULONGLONG;
  18998. dwTypeMask : DWORD;
  18999. Condition : BYTE
  19000. ): ULONGLONG; stdcall;
  19001. begin
  19002. GetProcedureAddress(_VerSetConditionMask, ntdll, 'VerSetConditionMask');
  19003. Result := TFNVerSetConditionMask(_VerSetConditionMask)(
  19004. ConditionMask, dwTypeMask, Condition
  19005. );
  19006. end;
  19007. {$ENDIF JWA_INCLUDEMODE}
  19008. {$ENDIF RTDL}
  19009. (*
  19010. Function forwarders which are not implemented by this unit
  19011. because they are available only on the 64bit editions of
  19012. Windows XP and Windows 2003 Server.
  19013. [KERNEL32.dll]RtlCaptureContext -> NTDLL.RtlCaptureContext
  19014. [KERNEL32.dll]RtlCaptureStackBackTrace -> NTDLL.RtlCaptureStackBackTrace
  19015. Usually the Kernel32 functions are documented in the Platform SDK, so knowing
  19016. of these function forwarders gives you the chance to find out the prototype of
  19017. the respective Native API to which the call is forwarded.
  19018. The following usermode Native APIs are not included in this unit:
  19019. -----------------------------------------------------------------
  19020. CsrAllocateCaptureBuffer [NT3, NT4, W2K, WXP, 2K3]
  19021. CsrAllocateMessagePointer [NT3, NT4, W2K, WXP, 2K3]
  19022. CsrCaptureMessageBuffer [NT3, NT4, W2K, WXP, 2K3]
  19023. CsrCaptureMessageMultiUnicodeStringsInPlace [WXP, 2K3]
  19024. CsrCaptureMessageString [NT3, NT4, W2K, WXP, 2K3]
  19025. CsrCaptureTimeout [NT3, NT4, W2K, WXP, 2K3]
  19026. CsrClientCallServer [NT3, NT4, W2K, WXP, 2K3]
  19027. CsrClientConnectToServer [NT3, NT4, W2K, WXP, 2K3]
  19028. CsrFreeCaptureBuffer [NT3, NT4, W2K, WXP, 2K3]
  19029. CsrIdentifyAlertableThread [NT3, NT4, W2K, WXP, 2K3]
  19030. CsrNewThread [NT3, NT4, W2K, WXP, 2K3]
  19031. CsrProbeForRead [NT3, NT4, W2K, WXP, 2K3]
  19032. CsrProbeForWrite [NT3, NT4, W2K, WXP, 2K3]
  19033. CsrSetPriorityClass [NT3, NT4, W2K, WXP, 2K3]
  19034. DbgPrintEx [WXP, 2K3]
  19035. DbgPrintReturnControlC [W2K, WXP, 2K3]
  19036. DbgPrompt [NT3, NT4, W2K, WXP, 2K3]
  19037. DbgSsHandleKmApiMsg [NT3, NT4, W2K]
  19038. DbgSsInitialize [NT3, NT4, W2K]
  19039. DbgUiConnectToDbg [NT3, NT4, W2K, WXP, 2K3]
  19040. DbgUiContinue [NT3, NT4, W2K, WXP, 2K3]
  19041. DbgUiConvertStateChangeStructure [WXP, 2K3]
  19042. DbgUiDebugActiveProcess [WXP, 2K3]
  19043. DbgUiGetThreadDebugObject [WXP, 2K3]
  19044. DbgUiIssueRemoteBreakin [WXP, 2K3]
  19045. DbgUiRemoteBreakin [WXP, 2K3]
  19046. DbgUiSetThreadDebugObject [WXP, 2K3]
  19047. DbgUiStopDebugging [WXP, 2K3]
  19048. DbgUiWaitStateChange [NT3, NT4, W2K, WXP, 2K3]
  19049. DbgUserBreakPoint [NT3, NT4, W2K, WXP, 2K3]
  19050. EtwControlTraceA [2K3]
  19051. EtwControlTraceW [2K3]
  19052. EtwCreateTraceInstanceId [2K3]
  19053. EtwEnableTrace [2K3]
  19054. EtwEnumerateTraceGuids [2K3]
  19055. EtwFlushTraceA [2K3]
  19056. EtwFlushTraceW [2K3]
  19057. EtwGetTraceEnableFlags [2K3]
  19058. EtwGetTraceEnableLevel [2K3]
  19059. EtwGetTraceLoggerHandle [2K3]
  19060. EtwNotificationRegistrationA [2K3]
  19061. EtwNotificationRegistrationW [2K3]
  19062. EtwQueryAllTracesA [2K3]
  19063. EtwQueryAllTracesW [2K3]
  19064. EtwQueryTraceA [2K3]
  19065. EtwQueryTraceW [2K3]
  19066. EtwReceiveNotificationsA [2K3]
  19067. EtwReceiveNotificationsW [2K3]
  19068. EtwRegisterTraceGuidsA [2K3]
  19069. EtwRegisterTraceGuidsW [2K3]
  19070. EtwStartTraceA [2K3]
  19071. EtwStartTraceW [2K3]
  19072. EtwStopTraceA [2K3]
  19073. EtwStopTraceW [2K3]
  19074. EtwTraceEvent [2K3]
  19075. EtwTraceEventInstance [2K3]
  19076. EtwTraceMessage [2K3]
  19077. EtwTraceMessageVa [2K3]
  19078. EtwUnregisterTraceGuids [2K3]
  19079. EtwUpdateTraceA [2K3]
  19080. EtwUpdateTraceW [2K3]
  19081. EtwpGetTraceBuffer [2K3]
  19082. EtwpSetHWConfigFunction [2K3]
  19083. KiUserApcDispatcher [NT3, NT4, W2K, WXP, 2K3]
  19084. KiUserCallbackDispatcher [NT3, NT4, W2K, WXP, 2K3]
  19085. KiUserExceptionDispatcher [NT3, NT4, W2K, WXP, 2K3]
  19086. LdrAccessOutOfProcessResource [WXP, 2K3]
  19087. LdrAddRefDll [WXP, 2K3]
  19088. LdrCreateOutOfProcessImage [WXP, 2K3]
  19089. LdrDestroyOutOfProcessImage [WXP, 2K3]
  19090. LdrEnumResources [NT3, NT4, W2K, WXP, 2K3]
  19091. LdrEnumerateLoadedModules [WXP, 2K3]
  19092. LdrFindCreateProcessManifest [WXP, 2K3]
  19093. LdrFindEntryForAddress [NT3, NT4, W2K, WXP, 2K3]
  19094. LdrFindResourceDirectory_U [NT3, NT4, W2K, WXP, 2K3]
  19095. LdrFindResourceEx_U [WXP, 2K3]
  19096. LdrFindResource_U [NT3, NT4, W2K, WXP, 2K3]
  19097. LdrFlushAlternateResourceModules [W2K, WXP, 2K3]
  19098. LdrGetDllHandleEx [WXP, 2K3]
  19099. LdrHotPatchRoutine [2K3]
  19100. LdrInitShimEngineDynamic [WXP, 2K3]
  19101. LdrInitializeThunk [NT3, NT4, W2K, WXP, 2K3]
  19102. LdrLoadAlternateResourceModule [W2K, WXP, 2K3]
  19103. LdrLockLoaderLock [WXP, 2K3]
  19104. LdrProcessRelocationBlock [NT3, NT4, W2K, WXP, 2K3]
  19105. LdrQueryImageFileExecutionOptionsEx [2K3]
  19106. LdrSetAppCompatDllRedirectionCallback [WXP, 2K3]
  19107. LdrSetDllManifestProber [WXP, 2K3]
  19108. LdrUnloadAlternateResourceModule [W2K, WXP, 2K3]
  19109. LdrUnlockLoaderLock [WXP, 2K3]
  19110. LdrVerifyImageMatchesChecksum [NT3, NT4, W2K, WXP, 2K3]
  19111. NPXEMULATORTABLE [NT3, NT4, W2K]
  19112. NlsAnsiCodePage [NT4, W2K, WXP, 2K3]
  19113. NlsMbCodePageTag [NT3, NT4, W2K, WXP, 2K3]
  19114. NlsMbOemCodePageTag [NT3, NT4, W2K, WXP, 2K3]
  19115. NtAddBootEntry [WXP, 2K3]
  19116. NtAddDriverEntry [2K3]
  19117. NtApphelpCacheControl [2K3]
  19118. NtCompactKeys [WXP, 2K3]
  19119. NtCompareTokens [WXP, 2K3]
  19120. NtCompressKey [WXP, 2K3]
  19121. NtCreateDebugObject [WXP, 2K3]
  19122. NtCreateJobSet [WXP, 2K3]
  19123. NtCreateKeyedEvent [WXP, 2K3]
  19124. NtCreateProcessEx [WXP, 2K3]
  19125. NtDebugContinue [WXP, 2K3]
  19126. NtDeleteBootEntry [WXP, 2K3]
  19127. NtDeleteDriverEntry [2K3]
  19128. NtEnumerateBootEntries [WXP, 2K3]
  19129. NtEnumerateDriverEntries [2K3]
  19130. NtEnumerateSystemEnvironmentValuesEx [WXP, 2K3]
  19131. NtIsProcessInJob [WXP, 2K3]
  19132. NtLoadKeyEx [2K3]
  19133. NtLockProductActivationKeys [WXP, 2K3]
  19134. NtLockRegistryKey [WXP, 2K3]
  19135. NtModifyBootEntry [WXP, 2K3]
  19136. NtModifyDriverEntry [2K3]
  19137. NtOpenKeyedEvent [WXP, 2K3]
  19138. NtOpenProcessTokenEx [WXP, 2K3]
  19139. NtOpenThreadTokenEx [WXP, 2K3]
  19140. NtQueryBootEntryOrder [WXP, 2K3]
  19141. NtQueryBootOptions [WXP, 2K3]
  19142. NtQueryDebugFilterState [WXP, 2K3]
  19143. NtQueryDriverEntryOrder [2K3]
  19144. NtQueryOpenSubKeysEx [2K3]
  19145. NtQuerySystemEnvironmentValueEx [WXP, 2K3]
  19146. NtReleaseKeyedEvent [WXP, 2K3]
  19147. NtRenameKey [WXP, 2K3]
  19148. NtSetBootEntryOrder [WXP, 2K3]
  19149. NtSetBootOptions [WXP, 2K3]
  19150. NtSetDebugFilterState [WXP, 2K3]
  19151. NtSetDriverEntryOrder [2K3]
  19152. NtSetEventBoostPriority [WXP, 2K3]
  19153. NtSetInformationDebugObject [WXP, 2K3]
  19154. NtSetSystemEnvironmentValueEx [WXP, 2K3]
  19155. NtTraceEvent [WXP, 2K3]
  19156. NtTranslateFilePath [WXP, 2K3]
  19157. NtUnloadKey2 [2K3]
  19158. NtUnloadKeyEx [WXP, 2K3]
  19159. NtWaitForDebugEvent [WXP, 2K3]
  19160. NtWaitForKeyedEvent [WXP, 2K3]
  19161. PfxFindPrefix [NT3, NT4, W2K, WXP, 2K3]
  19162. PfxInitialize [NT3, NT4, W2K, WXP, 2K3]
  19163. PfxInsertPrefix [NT3, NT4, W2K, WXP, 2K3]
  19164. PfxRemovePrefix [NT3, NT4, W2K, WXP, 2K3]
  19165. PropertyLengthAsVariant [NT4, W2K, WXP, 2K3]
  19166. RestoreEm87Context [NT3, NT4, W2K, WXP, 2K3]
  19167. RtlAbortRXact [NT3, NT4, W2K, WXP, 2K3]
  19168. RtlAcquireResourceExclusive [NT3, NT4, W2K, WXP, 2K3]
  19169. RtlAcquireResourceShared [NT3, NT4, W2K, WXP, 2K3]
  19170. RtlActivateActivationContext [WXP, 2K3]
  19171. RtlActivateActivationContextEx [WXP, 2K3]
  19172. RtlActivateActivationContextUnsafeFast [WXP, 2K3]
  19173. RtlAddAccessAllowedObjectAce [W2K, WXP, 2K3]
  19174. RtlAddAccessDeniedObjectAce [W2K, WXP, 2K3]
  19175. RtlAddActionToRXact [NT3, NT4, W2K, WXP, 2K3]
  19176. RtlAddAtomToAtomTable [NT4, W2K, WXP, 2K3]
  19177. RtlAddAttributeActionToRXact [NT3, NT4, W2K, WXP, 2K3]
  19178. RtlAddAuditAccessObjectAce [W2K, WXP, 2K3]
  19179. RtlAddCompoundAce [NT4, W2K, WXP, 2K3]
  19180. RtlAddRefActivationContext [WXP, 2K3]
  19181. RtlAddRefMemoryStream [WXP, 2K3]
  19182. RtlAddressInSectionTable [WXP, 2K3]
  19183. RtlAllocateHandle [NT4, W2K, WXP, 2K3]
  19184. RtlAppendPathElement [WXP, 2K3]
  19185. RtlApplicationVerifierStop [WXP, 2K3]
  19186. RtlApplyRXact [NT3, NT4, W2K, WXP, 2K3]
  19187. RtlApplyRXactNoFlush [NT3, NT4, W2K, WXP, 2K3]
  19188. RtlAssert2 [WXP]
  19189. RtlCallbackLpcClient [W2K]
  19190. RtlCancelTimer [W2K, WXP, 2K3]
  19191. RtlCaptureStackBackTrace [NT3, NT4, W2K, WXP, 2K3]
  19192. RtlCaptureStackContext [WXP, 2K3]
  19193. RtlCheckProcessParameters [WXP, 2K3]
  19194. RtlCloneMemoryStream [WXP, 2K3]
  19195. RtlCommitMemoryStream [WXP, 2K3]
  19196. RtlCompressBuffer [NT3, NT4, W2K, WXP, 2K3]
  19197. RtlComputeCrc32 [WXP, 2K3]
  19198. RtlComputeImportTableHash [WXP, 2K3]
  19199. RtlComputePrivatizedDllName_U [WXP, 2K3]
  19200. RtlConsoleMultiByteToUnicodeN [NT3, NT4, W2K, WXP, 2K3]
  19201. RtlConvertExclusiveToShared [NT3, NT4, W2K, WXP, 2K3]
  19202. RtlConvertPropertyToVariant [NT4, W2K, WXP, 2K3]
  19203. RtlConvertSharedToExclusive [NT3, NT4, W2K, WXP, 2K3]
  19204. RtlConvertToAutoInheritSecurityObject [W2K, WXP, 2K3]
  19205. RtlConvertUiListToApiList [NT3, NT4, W2K, WXP, 2K3]
  19206. RtlConvertVariantToProperty [NT4, W2K, WXP, 2K3]
  19207. RtlCopyLuidAndAttributesArray [NT3, NT4, W2K, WXP, 2K3]
  19208. RtlCopyMappedMemory [2K3]
  19209. RtlCopyMemoryStreamTo [WXP, 2K3]
  19210. RtlCopyOutOfProcessMemoryStreamTo [WXP, 2K3]
  19211. RtlCopySidAndAttributesArray [NT3, NT4, W2K, WXP, 2K3]
  19212. RtlCreateActivationContext [WXP, 2K3]
  19213. RtlCreateAndSetSD [NT3, NT4, W2K, WXP, 2K3]
  19214. RtlCreateAtomTable [NT4, W2K, WXP, 2K3]
  19215. RtlCreateBootStatusDataFile [WXP, 2K3]
  19216. RtlCreateEnvironment [NT3, NT4, W2K, WXP, 2K3]
  19217. RtlCreateLpcServer [W2K]
  19218. RtlCreateSystemVolumeInformationFolder [WXP, 2K3]
  19219. RtlCreateTagHeap [NT3, NT4, W2K, WXP, 2K3]
  19220. RtlCreateTimer [W2K, WXP, 2K3]
  19221. RtlCreateTimerQueue [W2K, WXP, 2K3]
  19222. RtlCreateUserSecurityObject [NT3, NT4, W2K, WXP, 2K3]
  19223. RtlCustomCPToUnicodeN [NT3, NT4, W2K, WXP, 2K3]
  19224. RtlDeactivateActivationContext [WXP, 2K3]
  19225. RtlDeactivateActivationContextUnsafeFast [WXP, 2K3]
  19226. RtlDebugPrintTimes [W2K, WXP, 2K3]
  19227. RtlDecompressBuffer [NT3, NT4, W2K, WXP, 2K3]
  19228. RtlDecompressFragment [NT3, NT4, W2K, WXP, 2K3]
  19229. RtlDefaultNpAcl [W2K, WXP, 2K3]
  19230. RtlDeleteAtomFromAtomTable [NT4, W2K, WXP, 2K3]
  19231. RtlDeleteElementGenericTable [NT3, NT4, W2K, WXP, 2K3]
  19232. RtlDeleteElementGenericTableAvl [WXP, 2K3]
  19233. RtlDeleteNoSplay [NT4, W2K, WXP, 2K3]
  19234. RtlDeleteResource [NT3, NT4, W2K, WXP, 2K3]
  19235. RtlDeleteSecurityObject [NT3, NT4, W2K, WXP, 2K3]
  19236. RtlDeleteTimer [W2K, WXP, 2K3]
  19237. RtlDeleteTimerQueue [W2K, WXP, 2K3]
  19238. RtlDeleteTimerQueueEx [W2K, WXP, 2K3]
  19239. RtlDeregisterWait [W2K, WXP, 2K3]
  19240. RtlDeregisterWaitEx [W2K, WXP, 2K3]
  19241. RtlDestroyAtomTable [NT4, W2K, WXP, 2K3]
  19242. RtlDestroyEnvironment [NT3, NT4, W2K, WXP, 2K3]
  19243. RtlDestroyHandleTable [NT4, W2K, WXP, 2K3]
  19244. RtlDllShutdownInProgress [WXP, 2K3]
  19245. RtlDosApplyFileIsolationRedirection_Ustr [WXP, 2K3]
  19246. RtlDosPathNameToRelativeNtPathName_U [2K3]
  19247. RtlDosSearchPath_Ustr [WXP, 2K3]
  19248. RtlDumpResource [NT3, NT4, W2K, WXP, 2K3]
  19249. RtlEmptyAtomTable [NT4, W2K, WXP, 2K3]
  19250. RtlEnumProcessHeaps [NT3, NT4, W2K, WXP, 2K3]
  19251. RtlEnumerateGenericTable [NT3, NT4, W2K, WXP, 2K3]
  19252. RtlEnumerateGenericTableAvl [WXP, 2K3]
  19253. RtlEnumerateGenericTableLikeADirectory [WXP, 2K3]
  19254. RtlEnumerateGenericTableWithoutSplaying [NT3, NT4, W2K, WXP, 2K3]
  19255. RtlEnumerateGenericTableWithoutSplayingAvl [WXP, 2K3]
  19256. RtlExitUserThread [WXP, 2K3]
  19257. RtlExtendHeap [NT3, NT4, W2K, WXP, 2K3]
  19258. RtlFinalReleaseOutOfProcessMemoryStream [WXP, 2K3]
  19259. RtlFindActivationContextSectionGuid [WXP, 2K3]
  19260. RtlFindActivationContextSectionString [WXP, 2K3]
  19261. RtlFindClearRuns [WXP, 2K3]
  19262. RtlFindMessage [NT3, NT4, W2K, WXP, 2K3]
  19263. RtlFirstEntrySList [WXP, 2K3]
  19264. RtlFlushSecureMemoryCache [WXP, 2K3]
  19265. RtlFormatMessage [NT3, NT4, W2K, WXP, 2K3]
  19266. RtlFreeHandle [NT4, W2K, WXP, 2K3]
  19267. RtlFreeThreadActivationContextStack [WXP, 2K3]
  19268. RtlFreeUserThreadStack [NT4, W2K, WXP, 2K3]
  19269. RtlGenerate8dot3Name [NT3, NT4, W2K, WXP, 2K3]
  19270. RtlGetActiveActivationContext [WXP, 2K3]
  19271. RtlGetCompressionWorkSpaceSize [NT3, NT4, W2K, WXP, 2K3]
  19272. RtlGetElementGenericTable [NT3, NT4, W2K, WXP, 2K3]
  19273. RtlGetElementGenericTableAvl [WXP, 2K3]
  19274. RtlGetFrame [WXP, 2K3]
  19275. RtlGetFullPathName_UstrEx [2K3]
  19276. RtlGetLengthWithoutLastFullDosOrNtPathElement [WXP, 2K3]
  19277. RtlGetLengthWithoutTrailingPathSeperators [WXP, 2K3]
  19278. RtlGetNativeSystemInformation [WXP, 2K3]
  19279. RtlGetSecurityDescriptorRMControl [W2K, WXP, 2K3]
  19280. RtlGetSetBootStatusData [WXP, 2K3]
  19281. RtlGetThreadErrorMode [2K3]
  19282. RtlGetUnloadEventTrace [2K3]
  19283. RtlGetUserInfoHeap [NT3, NT4, W2K, WXP, 2K3]
  19284. RtlHashUnicodeString [WXP, 2K3]
  19285. RtlImpersonateLpcClient [W2K]
  19286. RtlInitCodePageTable [NT3, NT4, W2K, WXP, 2K3]
  19287. RtlInitMemoryStream [WXP, 2K3]
  19288. RtlInitNlsTables [NT3, NT4, W2K, WXP, 2K3]
  19289. RtlInitOutOfProcessMemoryStream [WXP, 2K3]
  19290. RtlInitializeAtomPackage [NT4, W2K, WXP, 2K3]
  19291. RtlInitializeContext [NT3, NT4, W2K, WXP, 2K3]
  19292. RtlInitializeGenericTable [NT3, NT4, W2K, WXP, 2K3]
  19293. RtlInitializeGenericTableAvl [WXP, 2K3]
  19294. RtlInitializeHandleTable [NT4, W2K, WXP, 2K3]
  19295. RtlInitializeRXact [NT3, NT4, W2K, WXP, 2K3]
  19296. RtlInitializeResource [NT3, NT4, W2K, WXP, 2K3]
  19297. RtlInsertElementGenericTable [NT3, NT4, W2K, WXP, 2K3]
  19298. RtlInsertElementGenericTableAvl [WXP, 2K3]
  19299. RtlInsertElementGenericTableFull [2K3]
  19300. RtlInsertElementGenericTableFullAvl [2K3]
  19301. RtlInterlockedCompareExchange64 [2K3]
  19302. RtlInterlockedPushListSList [WXP, 2K3]
  19303. RtlIpv4AddressToStringExA [2K3]
  19304. RtlIpv4AddressToStringExW [2K3]
  19305. RtlIpv4StringToAddressA [WXP, 2K3]
  19306. RtlIpv4StringToAddressExA [2K3]
  19307. RtlIpv4StringToAddressExW [2K3]
  19308. RtlIpv4StringToAddressW [WXP, 2K3]
  19309. RtlIpv6AddressToStringA [WXP, 2K3]
  19310. RtlIpv6AddressToStringExA [2K3]
  19311. RtlIpv6AddressToStringExW [2K3]
  19312. RtlIpv6AddressToStringW [WXP, 2K3]
  19313. RtlIpv6StringToAddressA [WXP, 2K3]
  19314. RtlIpv6StringToAddressExA [2K3]
  19315. RtlIpv6StringToAddressExW [2K3]
  19316. RtlIpv6StringToAddressW [WXP, 2K3]
  19317. RtlIsActivationContextActive [WXP, 2K3]
  19318. RtlIsGenericTableEmpty [NT3, NT4, W2K, WXP, 2K3]
  19319. RtlIsGenericTableEmptyAvl [WXP, 2K3]
  19320. RtlIsThreadWithinLoaderCallout [WXP, 2K3]
  19321. RtlIsValidHandle [NT4, W2K, WXP, 2K3]
  19322. RtlIsValidIndexHandle [NT4, W2K, WXP, 2K3]
  19323. RtlLockBootStatusData [WXP, 2K3]
  19324. RtlLockMemoryStreamRegion [WXP, 2K3]
  19325. RtlLogStackBackTrace [WXP, 2K3]
  19326. RtlLookupAtomInAtomTable [NT4, W2K, WXP, 2K3]
  19327. RtlLookupElementGenericTable [NT3, NT4, W2K, WXP, 2K3]
  19328. RtlLookupElementGenericTableAvl [WXP, 2K3]
  19329. RtlLookupElementGenericTableFull [2K3]
  19330. RtlLookupElementGenericTableFullAvl [2K3]
  19331. RtlMultiAppendUnicodeStringBuffer [WXP, 2K3]
  19332. RtlMultiByteToUnicodeN [NT3, NT4, W2K, WXP, 2K3]
  19333. RtlMultiByteToUnicodeSize [NT3, NT4, W2K, WXP, 2K3]
  19334. RtlMultipleAllocateHeap [2K3]
  19335. RtlMultipleFreeHeap [2K3]
  19336. RtlNewInstanceSecurityObject [NT3, NT4, W2K, WXP, 2K3]
  19337. RtlNewSecurityGrantedAccess [NT3, NT4, W2K, WXP, 2K3]
  19338. RtlNewSecurityObject [NT3, NT4, W2K, WXP, 2K3]
  19339. RtlNewSecurityObjectEx [W2K, WXP, 2K3]
  19340. RtlNewSecurityObjectWithMultipleInheritance [WXP, 2K3]
  19341. RtlNtPathNameToDosPathName [WXP, 2K3]
  19342. RtlNumberGenericTableElements [NT3, NT4, W2K, WXP, 2K3]
  19343. RtlNumberGenericTableElementsAvl [WXP, 2K3]
  19344. RtlPcToFileHeader [NT3, NT4, W2K, WXP, 2K3]
  19345. RtlPinAtomInAtomTable [NT4, W2K, WXP, 2K3]
  19346. RtlPopFrame [WXP, 2K3]
  19347. RtlProtectHeap [NT3, NT4, W2K, WXP, 2K3]
  19348. RtlPushFrame [WXP, 2K3]
  19349. RtlQueryAtomInAtomTable [NT4, W2K, WXP, 2K3]
  19350. RtlQueryHeapInformation [W2K, WXP, 2K3]
  19351. RtlQueryInformationActivationContext [WXP, 2K3]
  19352. RtlQueryInformationActiveActivationContext [WXP, 2K3]
  19353. RtlQueryInterfaceMemoryStream [WXP, 2K3]
  19354. RtlQueryProcessBackTraceInformation [NT3, NT4, W2K, WXP, 2K3]
  19355. RtlQueryProcessHeapInformation [NT3, NT4, W2K, WXP, 2K3]
  19356. RtlQueryProcessLockInformation [NT3, NT4, W2K, WXP, 2K3]
  19357. RtlQuerySecurityObject [NT3, NT4, W2K, WXP, 2K3]
  19358. RtlQueryTagHeap [NT3, NT4, W2K, WXP, 2K3]
  19359. RtlQueryTimeZoneInformation [NT3, NT4, W2K, WXP, 2K3]
  19360. RtlQueueApcWow64Thread [WXP, 2K3]
  19361. RtlQueueWorkItem [W2K, WXP, 2K3]
  19362. RtlRaiseException [NT3, NT4, W2K, WXP, 2K3]
  19363. RtlReadMemoryStream [WXP, 2K3]
  19364. RtlReadOutOfProcessMemoryStream [WXP, 2K3]
  19365. RtlRealPredecessor [NT3, NT4, W2K, WXP, 2K3]
  19366. RtlRealSuccessor [NT3, NT4, W2K, WXP, 2K3]
  19367. RtlRegisterSecureMemoryCacheCallback [WXP, 2K3]
  19368. RtlRegisterWait [W2K, WXP, 2K3]
  19369. RtlReleaseActivationContext [WXP, 2K3]
  19370. RtlReleaseMemoryStream [WXP, 2K3]
  19371. RtlReleaseRelativeName [2K3]
  19372. RtlReleaseResource [NT3, NT4, W2K, WXP, 2K3]
  19373. RtlRemoteCall [NT3, NT4, W2K, WXP, 2K3]
  19374. RtlResetRtlTranslations [NT3, NT4, W2K, WXP, 2K3]
  19375. RtlRevertMemoryStream [WXP, 2K3]
  19376. RtlSeekMemoryStream [WXP, 2K3]
  19377. RtlSelfRelativeToAbsoluteSD2 [W2K, WXP, 2K3]
  19378. RtlSetAttributesSecurityDescriptor [NT4, W2K, WXP, 2K3]
  19379. RtlSetCurrentEnvironment [NT3, NT4, W2K, WXP, 2K3]
  19380. RtlSetEnvironmentStrings [2K3]
  19381. RtlSetEnvironmentVariable [NT3, NT4, W2K, WXP, 2K3]
  19382. RtlSetHeapInformation [W2K, WXP, 2K3]
  19383. RtlSetIoCompletionCallback [W2K, WXP, 2K3]
  19384. RtlSetMemoryStreamSize [WXP, 2K3]
  19385. RtlSetSecurityDescriptorRMControl [W2K, WXP, 2K3]
  19386. RtlSetSecurityObject [NT3, NT4, W2K, WXP, 2K3]
  19387. RtlSetSecurityObjectEx [W2K, WXP, 2K3]
  19388. RtlSetThreadErrorMode [2K3]
  19389. RtlSetThreadPoolStartFunc [W2K, WXP, 2K3]
  19390. RtlSetTimeZoneInformation [NT3, NT4, W2K, WXP, 2K3]
  19391. RtlSetTimer [W2K, WXP, 2K3]
  19392. RtlSetUnicodeCallouts [NT4, W2K, WXP, 2K3]
  19393. RtlSetUserFlagsHeap [NT3, NT4, W2K, WXP, 2K3]
  19394. RtlSetUserValueHeap [NT3, NT4, W2K, WXP, 2K3]
  19395. RtlShutdownLpcServer [W2K]
  19396. RtlSplay [NT3, NT4, W2K, WXP, 2K3]
  19397. RtlStartRXact [NT3, NT4, W2K, WXP, 2K3]
  19398. RtlStatMemoryStream [WXP, 2K3]
  19399. RtlSubtreePredecessor [NT3, NT4, W2K, WXP, 2K3]
  19400. RtlSubtreeSuccessor [NT3, NT4, W2K, WXP, 2K3]
  19401. RtlTraceDatabaseAdd [W2K, WXP, 2K3]
  19402. RtlTraceDatabaseCreate [W2K, WXP, 2K3]
  19403. RtlTraceDatabaseDestroy [W2K, WXP, 2K3]
  19404. RtlTraceDatabaseEnumerate [W2K, WXP, 2K3]
  19405. RtlTraceDatabaseFind [W2K, WXP, 2K3]
  19406. RtlTraceDatabaseLock [W2K, WXP, 2K3]
  19407. RtlTraceDatabaseUnlock [W2K, WXP, 2K3]
  19408. RtlTraceDatabaseValidate [W2K, WXP, 2K3]
  19409. RtlUnhandledExceptionFilter [WXP, 2K3]
  19410. RtlUnhandledExceptionFilter2 [WXP, 2K3]
  19411. RtlUnicodeToCustomCPN [NT3, NT4, W2K, WXP, 2K3]
  19412. RtlUnicodeToMultiByteN [NT3, NT4, W2K, WXP, 2K3]
  19413. RtlUnicodeToOemN [NT3, NT4, W2K, WXP, 2K3]
  19414. RtlUnlockBootStatusData [WXP, 2K3]
  19415. RtlUnlockHeap [NT3, NT4, W2K, WXP, 2K3]
  19416. RtlUnlockMemoryStreamRegion [WXP, 2K3]
  19417. RtlUpcaseUnicodeToCustomCPN [NT3, NT4, W2K, WXP, 2K3]
  19418. RtlUpdateTimer [W2K, WXP, 2K3]
  19419. RtlUsageHeap [NT3, NT4, W2K, WXP, 2K3]
  19420. RtlValidateProcessHeaps [NT3, NT4, W2K, WXP, 2K3]
  19421. RtlWalkFrameChain [W2K, WXP, 2K3]
  19422. RtlWalkHeap [NT3, NT4, W2K, WXP, 2K3]
  19423. RtlWow64EnableFsRedirection [2K3]
  19424. RtlWriteMemoryStream [WXP, 2K3]
  19425. RtlZombifyActivationContext [WXP, 2K3]
  19426. RtlpApplyLengthFunction [WXP, 2K3]
  19427. RtlpEnsureBufferSize [WXP, 2K3]
  19428. RtlpUnWaitCriticalSection [NT3, NT4, W2K, WXP, 2K3]
  19429. RtlpWaitForCriticalSection [NT3, NT4, W2K, WXP, 2K3]
  19430. SaveEm87Context [NT3, NT4, W2K, WXP, 2K3]
  19431. ZwAddBootEntry [WXP, 2K3]
  19432. ZwAddDriverEntry [2K3]
  19433. ZwApphelpCacheControl [2K3]
  19434. ZwCompactKeys [WXP, 2K3]
  19435. ZwCompareTokens [WXP, 2K3]
  19436. ZwCompressKey [WXP, 2K3]
  19437. ZwCreateDebugObject [WXP, 2K3]
  19438. ZwCreateJobSet [WXP, 2K3]
  19439. ZwCreateKeyedEvent [WXP, 2K3]
  19440. ZwCreateProcessEx [WXP, 2K3]
  19441. ZwDebugContinue [WXP, 2K3]
  19442. ZwDeleteBootEntry [WXP, 2K3]
  19443. ZwDeleteDriverEntry [2K3]
  19444. ZwEnumerateBootEntries [WXP, 2K3]
  19445. ZwEnumerateDriverEntries [2K3]
  19446. ZwEnumerateSystemEnvironmentValuesEx [WXP, 2K3]
  19447. ZwIsProcessInJob [WXP, 2K3]
  19448. ZwLoadKeyEx [2K3]
  19449. ZwLockProductActivationKeys [WXP, 2K3]
  19450. ZwLockRegistryKey [WXP, 2K3]
  19451. ZwModifyBootEntry [WXP, 2K3]
  19452. ZwModifyDriverEntry [2K3]
  19453. ZwOpenKeyedEvent [WXP, 2K3]
  19454. ZwOpenProcessTokenEx [WXP, 2K3]
  19455. ZwOpenThreadTokenEx [WXP, 2K3]
  19456. ZwQueryBootEntryOrder [WXP, 2K3]
  19457. ZwQueryBootOptions [WXP, 2K3]
  19458. ZwQueryDebugFilterState [WXP, 2K3]
  19459. ZwQueryDriverEntryOrder [2K3]
  19460. ZwQueryOpenSubKeysEx [2K3]
  19461. ZwQuerySystemEnvironmentValueEx [WXP, 2K3]
  19462. ZwReleaseKeyedEvent [WXP, 2K3]
  19463. ZwRenameKey [WXP, 2K3]
  19464. ZwSetBootEntryOrder [WXP, 2K3]
  19465. ZwSetBootOptions [WXP, 2K3]
  19466. ZwSetDebugFilterState [WXP, 2K3]
  19467. ZwSetDriverEntryOrder [2K3]
  19468. ZwSetEventBoostPriority [WXP, 2K3]
  19469. ZwSetInformationDebugObject [WXP, 2K3]
  19470. ZwSetSystemEnvironmentValueEx [WXP, 2K3]
  19471. ZwTraceEvent [WXP, 2K3]
  19472. ZwTranslateFilePath [WXP, 2K3]
  19473. ZwUnloadKey2 [2K3]
  19474. ZwUnloadKeyEx [WXP, 2K3]
  19475. ZwWaitForDebugEvent [WXP, 2K3]
  19476. ZwWaitForKeyedEvent [WXP, 2K3]
  19477. + 457 (35.90%) not yet declared
  19478. + 816 (64.10%) declared already
  19479. = 1273 (100.00%) relevant functions overall
  19480. The following usermode Native APIs are considered deprecated
  19481. since they are only available in NT3 or NT4 only or in NT3/NT4
  19482. only. Hence they are considered irrelevant. These are:
  19483. -----------------------------------------------------------------
  19484. CsrAllocateCapturePointer [NT3, NT4]
  19485. CsrClientMaxMessage [NT3]
  19486. CsrClientSendMessage [NT3]
  19487. CsrClientThreadConnect [NT3]
  19488. CsrpProcessCallbackRequest [NT3]
  19489. NtEnumerateBus [NT3]
  19490. NtQueryOleDirectoryFile [NT4]
  19491. NtRegisterNewDevice [NT3]
  19492. NtReleaseProcessMutant [NT3]
  19493. NtWaitForProcessMutant [NT3]
  19494. RtlClosePropertySet [NT4]
  19495. RtlCompareVariants [NT4]
  19496. RtlCreatePropertySet [NT4]
  19497. RtlEnumerateProperties [NT4]
  19498. RtlFindLongestRunSet [NT3, NT4]
  19499. RtlFlushPropertySet [NT4]
  19500. RtlGuidToPropertySetName [NT4]
  19501. RtlOnMappedStreamEvent [NT4]
  19502. RtlPropertySetNameToGuid [NT4]
  19503. RtlQueryProperties [NT4]
  19504. RtlQueryPropertyNames [NT4]
  19505. RtlQueryPropertySet [NT4]
  19506. RtlSetProperties [NT4]
  19507. RtlSetPropertyNames [NT4]
  19508. RtlSetPropertySetClassId [NT4]
  19509. RtlpInitializeRtl [NT3]
  19510. ZwEnumerateBus [NT3]
  19511. ZwQueryOleDirectoryFile [NT4]
  19512. ZwRegisterNewDevice [NT3]
  19513. ZwReleaseProcessMutant [NT3]
  19514. ZwWaitForProcessMutant [NT3]
  19515. = 31 deprecated functions
  19516. *)
  19517. {$ENDIF JWA_INTERFACESECTION}
  19518. {$IFNDEF JWA_OMIT_SECTIONS}
  19519. end.
  19520. {$ENDIF JWA_OMIT_SECTIONS}