├── WS03SP1HALS └── x86 │ ├── halacpim │ ├── halacpim.dll │ └── halacpim.pdb │ ├── halmacpi │ ├── halmacpi.dll │ └── halmacpi.pdb │ └── halmps │ ├── halmps.dll │ └── halmps.pdb ├── base ├── inc │ └── ntdlltrc.h └── ntos │ ├── BUILD │ ├── PREBUILT │ │ ├── amd64 │ │ │ ├── BOOTVID.lib │ │ │ ├── HAL.lib │ │ │ ├── HOTPATCH.obj │ │ │ ├── KDCOM.lib │ │ │ ├── NTOSKRNL.res │ │ │ ├── SDBAPINT.lib │ │ │ ├── ntosarch.lib │ │ │ └── ntoswrk.lib │ │ └── i386 │ │ │ ├── BOOTVID.lib │ │ │ ├── HAL.lib │ │ │ ├── KDCOM.lib │ │ │ ├── NTOSKRNL.res │ │ │ ├── SDBAPINT.lib │ │ │ ├── STUB512.com │ │ │ ├── ntosarch.lib │ │ │ └── ntoswrk.lib │ ├── WARNING.h │ ├── makefile │ └── makefile.build │ ├── VDM │ └── i386 │ │ └── vdm.inc │ ├── VERIFIER │ ├── halverifier.h │ ├── vfbugcheck.h │ ├── vfddi.h │ ├── vfdeadlock.h │ ├── vfdebug.h │ ├── vfdef.h │ ├── vfdevobj.h │ ├── vffilter.h │ ├── vfgeneric.h │ ├── vfinit.h │ ├── vfirp.h │ ├── vfirpdb.h │ ├── vfirplog.h │ ├── vfmacro.h │ ├── vfmajor.h │ ├── vfmessage.h │ ├── vfpacket.h │ ├── vfpnp.h │ ├── vfpower.h │ ├── vfpragma.h │ ├── vfprint.h │ ├── vfrandom.h │ ├── vfsettings.h │ ├── vfstack.h │ ├── vftriage.h │ ├── vfutil.h │ ├── vfwmi.h │ └── vfzwapi.h │ ├── cache │ ├── BUILD │ │ └── makefile │ ├── cachedat.c │ ├── cachesub.c │ ├── cc.h │ ├── ccperf.c │ ├── copysup.c │ ├── fssup.c │ ├── lazyrite.c │ ├── logsup.c │ ├── mdlsup.c │ ├── pinsup.c │ └── vacbsup.c │ ├── config │ ├── BUILD │ │ └── makefile │ ├── cmalloc.c │ ├── cmapi.c │ ├── cmapi2.c │ ├── cmboot.c │ ├── cmchek.c │ ├── cmchek2.c │ ├── cmclose.c │ ├── cmconfig.c │ ├── cmcontrl.c │ ├── cmdat.c │ ├── cmdat2.c │ ├── cmdatini.c │ ├── cmdelay.c │ ├── cmdelete.c │ ├── cmdown.c │ ├── cmgquota.c │ ├── cmhook.c │ ├── cmhvlist.c │ ├── cmindex.c │ ├── cminit.c │ ├── cmmapvw.c │ ├── cmname.c │ ├── cmnotify.c │ ├── cmp.h │ ├── cmparse.c │ ├── cmparse2.c │ ├── cmpbug.h │ ├── cmquery.c │ ├── cmsavres.c │ ├── cmse.c │ ├── cmsecache.c │ ├── cmsubs.c │ ├── cmsubs2.c │ ├── cmsubs3.c │ ├── cmsysini.c │ ├── cmtrecpy.c │ ├── cmtredel.c │ ├── cmtree.c │ ├── cmvalue.c │ ├── cmwmi.c │ ├── cmworker.c │ ├── cmwrapr.c │ ├── cmwrapr2.c │ ├── hive.h │ ├── hivebin.c │ ├── hivecell.c │ ├── hivechek.c │ ├── hivefree.c │ ├── hivehint.c │ ├── hiveinit.c │ ├── hiveload.c │ ├── hivemap.c │ ├── hivesum.c │ ├── hivesync.c │ └── ntapi.c │ ├── dbgk │ ├── BUILD │ │ └── makefile │ ├── dbgkobj.c │ ├── dbgkp.h │ ├── dbgkport.c │ └── dbgkproc.c │ ├── ex │ ├── BUILD │ │ └── makefile │ ├── amd64 │ │ ├── hifreqlk.asm │ │ ├── hrderror.asm │ │ ├── intrlock.asm │ │ └── wowinfo.c │ ├── callback.c │ ├── callperf.c │ ├── delay.c │ ├── event.c │ ├── eventpr.c │ ├── exatom.c │ ├── exdata.c │ ├── exinit.c │ ├── exp.h │ ├── fmutexc.c │ ├── handle.c │ ├── harderr.c │ ├── i386 │ │ ├── intrlfst.asm │ │ ├── intrlock.asm │ │ └── splocks.asm │ ├── keyedevent.c │ ├── lookasid.c │ ├── luid.c │ ├── mutant.c │ ├── nbqueue.c │ ├── pool.c │ ├── probe.c │ ├── profile.c │ ├── pushlock.c │ ├── raise.c │ ├── resource.c │ ├── rundown.c │ ├── semphore.c │ ├── sysinfo.c │ ├── timer.c │ ├── uuid.c │ ├── win32.c │ ├── worker.c │ └── zone.c │ ├── fsrtl │ ├── BUILD │ │ └── makefile │ ├── dbcsname.c │ ├── fastio.c │ ├── faulttol.c │ ├── filelock.c │ ├── filter.c │ ├── filtrctx.c │ ├── fsfilter.c │ ├── fsrtlp.h │ ├── fsrtlpc.c │ ├── largemcb.c │ ├── name.c │ ├── notify.c │ ├── oplock.c │ ├── pnp.c │ ├── stackovf.c │ ├── tunnel.c │ └── unc.c │ ├── fstub │ ├── BUILD │ │ └── makefile │ ├── drivesup.c │ ├── drivesup.h │ ├── fstub.h │ └── haldisp.h │ ├── inc │ ├── amd64.h │ ├── cache.h │ ├── cm.h │ ├── cmdata.h │ ├── cpyuchr.h │ ├── dbgk.h │ ├── dockintf.h │ ├── em387.inc │ ├── ex.h │ ├── exboosts.h │ ├── exlevels.h │ ├── fastsys.inc │ ├── fsrtl.h │ ├── hal.h │ ├── hivedata.h │ ├── i386.h │ ├── init.h │ ├── intrlk.h │ ├── io.h │ ├── irqli386.inc │ ├── kd.h │ ├── kddll.h │ ├── ke.h │ ├── kx.h │ ├── lfs.h │ ├── lpc.h │ ├── mac386.inc │ ├── mm.h │ ├── ntos.h │ ├── ntosdef.h │ ├── ob.h │ ├── perf.h │ ├── pnp.h │ ├── po.h │ ├── pool.h │ ├── procpowr.h │ ├── ps.h │ ├── se.h │ ├── smbios.h │ ├── stktrace.h │ ├── v86emul.h │ ├── vdmntos.h │ ├── verifier.h │ └── wmi.h │ ├── init │ ├── BUILD │ │ └── makefile │ ├── amd64def.src │ ├── i386def.src │ ├── initos.c │ ├── ntkrnlmp.c │ ├── ntoskrnl.c │ └── ntoskrnl.src │ ├── io │ ├── BUILD │ │ └── makefile │ ├── PNPMGR │ │ ├── pplastgood.h │ │ └── ppvutil.h │ ├── ioguid.c │ ├── iomgr │ │ ├── BUILD │ │ │ └── makefile │ │ ├── cancelapi.c │ │ ├── complete.c │ │ ├── create.c │ │ ├── dev2dos.c │ │ ├── devctrl.c │ │ ├── dir.c │ │ ├── errorlog.c │ │ ├── fsctrl.c │ │ ├── internal.c │ │ ├── iodata.c │ │ ├── ioinit.c │ │ ├── iomgr.h │ │ ├── iosubs.c │ │ ├── loadunld.c │ │ ├── lock.c │ │ ├── misc.c │ │ ├── objsup.c │ │ ├── open.c │ │ ├── parse.c │ │ ├── qsea.c │ │ ├── qsfs.c │ │ ├── qsinfo.c │ │ ├── qsquota.c │ │ ├── read.c │ │ └── write.c │ ├── iop.h │ ├── iopcmn.h │ ├── ioverifier.h │ ├── iovutil.h │ ├── sessnirp.h │ └── trackirp.h │ ├── ke │ ├── BUILD │ │ └── makefile │ ├── amd64 │ │ ├── allproc.c │ │ ├── apcint.asm │ │ ├── apcuser.c │ │ ├── callback.c │ │ ├── callout.asm │ │ ├── clockint.asm │ │ ├── cpuid.asm │ │ ├── ctxswap.asm │ │ ├── decode.c │ │ ├── dpcint.asm │ │ ├── exceptn.c │ │ ├── flush.c │ │ ├── flushtb.c │ │ ├── idle.asm │ │ ├── initkr.c │ │ ├── intipi.asm │ │ ├── intobj.c │ │ ├── intsup.asm │ │ ├── ipi.c │ │ ├── kiamd64.h │ │ ├── misc.c │ │ ├── miscs.asm │ │ ├── pat.c │ │ ├── procstat.asm │ │ ├── profint.asm │ │ ├── queuelock.c │ │ ├── runtime.c │ │ ├── services.stb │ │ ├── services.tab │ │ ├── spinlock.c │ │ ├── start.asm │ │ ├── sysstubs.asm │ │ ├── systable.asm │ │ ├── table.stb │ │ ├── threadbg.asm │ │ ├── thredini.c │ │ ├── trap.asm │ │ └── zero.asm │ ├── apcobj.c │ ├── apcsup.c │ ├── balmgr.c │ ├── bugcheck.c │ ├── config.c │ ├── debug.c │ ├── devquobj.c │ ├── dpclock.c │ ├── dpcobj.c │ ├── dpcsup.c │ ├── eventobj.c │ ├── gateobj.c │ ├── genxx.inc │ ├── hifreqlk.c │ ├── i386 │ │ ├── abios.h │ │ ├── abiosa.asm │ │ ├── abiosc.c │ │ ├── allproc.c │ │ ├── apcuser.c │ │ ├── biosc.c │ │ ├── callback.c │ │ ├── callout.asm │ │ ├── clockint.asm │ │ ├── cpu.asm │ │ ├── cpu.inc │ │ ├── ctxswap.asm │ │ ├── emv86.asm │ │ ├── emxcptn.asm │ │ ├── exceptn.c │ │ ├── flush.c │ │ ├── flushtb.c │ │ ├── gdtsup.c │ │ ├── i386init.c │ │ ├── i386pcr.asm │ │ ├── instemul.asm │ │ ├── int.asm │ │ ├── intobj.c │ │ ├── intsup.asm │ │ ├── iopm.c │ │ ├── kernlini.c │ │ ├── kimacro.inc │ │ ├── kix86.h │ │ ├── largepag.c │ │ ├── ldtsup.c │ │ ├── ldtsup2.asm │ │ ├── mi.inc │ │ ├── misc.c │ │ ├── mpipia.asm │ │ ├── mtrr.c │ │ ├── mtrr.h │ │ ├── mtrramd.c │ │ ├── newsysbg.asm │ │ ├── pat.c │ │ ├── pat.h │ │ ├── procstat.asm │ │ ├── services.stb │ │ ├── services.tab │ │ ├── spindbg.asm │ │ ├── spinlock.asm │ │ ├── sysstubs.asm │ │ ├── systable.asm │ │ ├── table.stb │ │ ├── threadbg.asm │ │ ├── thredini.c │ │ ├── timindex.asm │ │ ├── trap.asm │ │ ├── trapc.c │ │ └── zero.asm │ ├── idsched.c │ ├── interobj.c │ ├── kernldat.c │ ├── kevutil.c │ ├── ki.h │ ├── kiinit.c │ ├── miscc.c │ ├── mutntobj.c │ ├── procobj.c │ ├── profobj.c │ ├── queueobj.c │ ├── raisexcp.c │ ├── semphobj.c │ ├── thkemul.c │ ├── thredobj.c │ ├── thredsup.c │ ├── timerobj.c │ ├── timersup.c │ ├── wait.c │ ├── waitsup.c │ ├── xipi.c │ └── yield.c │ ├── lpc │ ├── BUILD │ │ └── makefile │ ├── i386 │ │ └── lpcmove.asm │ ├── lpcclose.c │ ├── lpccompl.c │ ├── lpcconn.c │ ├── lpccreat.c │ ├── lpcinit.c │ ├── lpclistn.c │ ├── lpcp.h │ ├── lpcpriv.c │ ├── lpcquery.c │ ├── lpcqueue.c │ ├── lpcrecv.c │ ├── lpcreply.c │ └── lpcsend.c │ ├── makefile │ ├── mm │ ├── BUILD │ │ └── makefile │ ├── acceschk.c │ ├── addrsup.c │ ├── allocpag.c │ ├── allocvm.c │ ├── amd64 │ │ ├── dataamd.c │ │ ├── initamd.c │ │ └── miamd.h │ ├── buildmdl.c │ ├── creasect.c │ ├── deleteva.c │ ├── dmpaddr.c │ ├── extsect.c │ ├── flushbuf.c │ ├── flushsec.c │ ├── forksup.c │ ├── freevm.c │ ├── hypermap.c │ ├── i386 │ │ ├── data386.c │ │ ├── init386.c │ │ ├── mi386.h │ │ ├── pae.asm │ │ ├── paesup.c │ │ ├── procpae.c │ │ ├── procx86.c │ │ └── setmodfy.c │ ├── iosup.c │ ├── lockvm.c │ ├── mapcache.c │ ├── mapview.c │ ├── mi.h │ ├── miglobal.c │ ├── mmfault.c │ ├── mminit.c │ ├── mmquota.c │ ├── mmsup.c │ ├── modwrite.c │ ├── pagfault.c │ ├── pfndec.c │ ├── pfnlist.c │ ├── physical.c │ ├── procsup.c │ ├── protect.c │ ├── querysec.c │ ├── queryvm.c │ ├── readwrt.c │ ├── sectsup.c │ ├── session.c │ ├── sessload.c │ ├── shutdown.c │ ├── sysload.c │ ├── sysptes.c │ ├── umapview.c │ ├── vadtree.c │ ├── wrtfault.c │ ├── wrtwatch.c │ ├── wslist.c │ ├── wsmanage.c │ ├── wstree.c │ └── zeropage.c │ ├── ob │ ├── BUILD │ │ └── makefile │ ├── fastref.c │ ├── obclose.c │ ├── obcreate.c │ ├── obdevmap.c │ ├── obdir.c │ ├── obhandle.c │ ├── obinit.c │ ├── obinsert.c │ ├── oblink.c │ ├── obp.h │ ├── obquery.c │ ├── obref.c │ ├── obsdata.c │ ├── obse.c │ ├── obtype.c │ ├── obvutil.h │ └── obwait.c │ ├── perf │ ├── BUILD │ │ └── makefile │ ├── hooks.c │ ├── logging.c │ ├── perfdata.c │ ├── perfp.h │ └── perfsup.c │ ├── ps │ ├── BUILD │ │ └── makefile │ ├── amd64 │ │ ├── psctxamd64.c │ │ ├── psctxwrap.asm │ │ ├── psldt.c │ │ └── psvdm.c │ ├── create.c │ ├── i386 │ │ ├── psctx386.c │ │ ├── psldt.c │ │ └── psvdm.c │ ├── kulookup.c │ ├── pscid.c │ ├── psctx.c │ ├── psdelete.c │ ├── psenum.c │ ├── pshelper.c │ ├── psimpers.c │ ├── psinit.c │ ├── psjob.c │ ├── psopen.c │ ├── psp.h │ ├── psquery.c │ ├── psquota.c │ ├── psspnd.c │ └── security.c │ ├── raw │ ├── BUILD │ │ └── makefile │ ├── cleanup.c │ ├── close.c │ ├── create.c │ ├── fileinfo.c │ ├── fsctrl.c │ ├── nodetype.h │ ├── rawdisp.c │ ├── rawinit.c │ ├── rawprocs.h │ ├── rawstruc.h │ ├── readwrit.c │ ├── strucsup.c │ └── volinfo.c │ ├── rtl │ ├── BUILD │ │ └── makefile │ ├── acledit.c │ ├── add2stra.c │ ├── add2strt.h │ ├── add2strw.c │ ├── amd64 │ │ ├── capture.asm │ │ ├── chkstk.asm │ │ ├── context.c │ │ ├── debugstb.asm │ │ ├── exdsptch.c │ │ ├── misalign.c │ │ ├── movemem.asm │ │ ├── ntrtlamd64.h │ │ ├── raise.c │ │ ├── slist.asm │ │ ├── stkwalk.c │ │ └── xcptmisc.asm │ ├── assert.c │ ├── atom.c │ ├── avltable.c │ ├── bitmap.c │ ├── byteswap.c │ ├── cnvint.c │ ├── debug.c │ ├── eballoc.c │ ├── environ.c │ ├── error.c │ ├── error.h │ ├── excptdbg.c │ ├── generr.c │ ├── gentable.c │ ├── guid.c │ ├── i386 │ │ ├── context.c │ │ ├── debug2.asm │ │ ├── debug3.c │ │ ├── divlarge.c │ │ ├── exdsptch.c │ │ ├── getcalr.c │ │ ├── ioaccess.asm │ │ ├── largeint.asm │ │ ├── movemem.asm │ │ ├── ntrtl386.h │ │ ├── raise.asm │ │ ├── slist.asm │ │ ├── stkwalk.asm │ │ ├── stringsp.asm │ │ └── xcptmisc.asm │ ├── imagedir.c │ ├── intbits.c │ ├── ldrreloc.c │ ├── ldrrsrc.c │ ├── lookup.c │ ├── message.c │ ├── mp │ ├── nls.c │ ├── nlsxlat.c │ ├── ntrtlp.h │ ├── pctohdr.c │ ├── peb.c │ ├── prefix.c │ ├── regutil.c │ ├── rtlassig.c │ ├── rtldata.c │ ├── rtlexec.c │ ├── rtlnthdr.c │ ├── sertl.c │ ├── splay.c │ ├── stktrace.c │ ├── str2adda.c │ ├── str2addt.h │ ├── str2addw.c │ ├── string.c │ ├── sysvol.c │ ├── time.c │ ├── tracedb.c │ └── tracedbp.h │ ├── se │ ├── BUILD │ │ └── makefile │ ├── accessck.c │ ├── adt.h │ ├── adtinit.c │ ├── adtlog.c │ ├── adtp.h │ ├── adtutil.c │ ├── adtutil.h │ ├── adtvars.c │ ├── capture.c │ ├── pch.h │ ├── privileg.c │ ├── rmaudit.c │ ├── rmlogon.c │ ├── rmmain.c │ ├── rmp.h │ ├── rmvars.c │ ├── seassign.c │ ├── seastate.c │ ├── seaudit.c │ ├── seclient.c │ ├── seglobal.c │ ├── seinit.c │ ├── semethod.c │ ├── sep.c │ ├── sep.h │ ├── sepaudit.c │ ├── subject.c │ ├── token.c │ ├── tokenadj.c │ ├── tokendup.c │ ├── tokenopn.c │ ├── tokenp.h │ ├── tokenqry.c │ └── tokenset.c │ └── wmi │ ├── BUILD │ └── makefile │ ├── alloc.c │ ├── amd64 │ └── mcaevent.c │ ├── api.c │ ├── callouts.c │ ├── chunk.c │ ├── consumer.c │ ├── dataprov.c │ ├── ds.c │ ├── enabdisa.c │ ├── globalog.c │ ├── i386 │ └── mcaevent.c │ ├── mca.c │ ├── mcaevent.h │ ├── notify.c │ ├── provider.c │ ├── register.c │ ├── secure.c │ ├── smbios.c │ ├── traceapi.c │ ├── tracelog.c │ ├── tracep.h │ ├── tracesup.c │ ├── wmi.c │ ├── wmidata.c │ ├── wmikmp.h │ └── wmiumds.h ├── public ├── ddk │ └── inc │ │ ├── mountdev.h │ │ └── ntddscsi.h ├── halkit │ └── inc │ │ ├── arccodes.h │ │ └── inbv.h ├── internal │ ├── base │ │ └── inc │ │ │ ├── arc.h │ │ │ ├── atom.h │ │ │ ├── bugcodes.txt │ │ │ ├── elfkrnl.h │ │ │ ├── hdlsblk.h │ │ │ ├── hdlsterm.h │ │ │ ├── ntperf.h │ │ │ ├── ntwmi.h │ │ │ ├── pnpmgr.h │ │ │ ├── pnpsetup.h │ │ │ ├── profiles.h │ │ │ ├── seopaque.h │ │ │ ├── sertlp.h │ │ │ ├── setupblk.h │ │ │ ├── vdm.h │ │ │ ├── vdmtib.inc │ │ │ ├── wmiumkm.h │ │ │ ├── wow64t.h │ │ │ ├── wow64tls.h │ │ │ └── zwapi.h │ ├── ds │ │ └── inc │ │ │ └── ntrmlsa.h │ └── sdktools │ │ └── inc │ │ └── ntdbg.h └── sdk │ └── inc │ ├── align.h │ ├── basetsd.h │ ├── bugcodes.h │ ├── callconv.inc │ ├── cfg.h │ ├── crt │ ├── ctype.h │ ├── excpt.h │ ├── stdarg.h │ ├── stdio.h │ ├── stdlib.h │ ├── string.h │ ├── tchar.h │ └── wchar.h │ ├── devguid.h │ ├── devioctl.h │ ├── diskguid.h │ ├── evntrace.h │ ├── guiddef.h │ ├── initguid.h │ ├── ioevent.h │ ├── ks386.inc │ ├── ksamd64.inc │ ├── kxamd64.inc │ ├── macamd64.inc │ ├── mce.h │ ├── mountmgr.h │ ├── msaudite.h │ ├── nt.h │ ├── ntamd64.h │ ├── ntconfig.h │ ├── ntcsrmsg.h │ ├── ntdddisk.h │ ├── ntddft.h │ ├── ntddmup.h │ ├── ntddnull.h │ ├── ntddstor.h │ ├── ntdef.h │ ├── ntdskreg.h │ ├── ntelfapi.h │ ├── ntexapi.h │ ├── nti386.h │ ├── ntia64.h │ ├── ntimage.h │ ├── ntioapi.h │ ├── ntiolog.h │ ├── ntiologc.h │ ├── ntkeapi.h │ ├── ntldr.h │ ├── ntlpcapi.h │ ├── ntlsa.h │ ├── ntmmapi.h │ ├── ntnls.h │ ├── ntobapi.h │ ├── ntpnpapi.h │ ├── ntpoapi.h │ ├── ntpsapi.h │ ├── ntregapi.h │ ├── ntrtl.h │ ├── ntrtlpath.h │ ├── ntrtlstringandbuffer.h │ ├── ntseapi.h │ ├── ntstatus.h │ ├── nturtl.h │ ├── ntxcapi.h │ ├── nxamd64.h │ ├── nxi386.h │ ├── pebteb.h │ ├── poppack.h │ ├── pshpack1.h │ ├── pshpack2.h │ ├── pshpack4.h │ ├── pshpack8.h │ ├── pshpck16.h │ ├── safeboot.h │ ├── specstrings.h │ ├── strsafe.h │ ├── triage.h │ ├── wdbgexts.h │ ├── wdmguid.h │ ├── winerror.h │ ├── wmidata.h │ ├── wmiguid.h │ └── wmistr.h └── tools ├── amd64 ├── 1033 │ └── clui.dll ├── c1.dll ├── c2.dll ├── checktoolarch.bat ├── cl.exe ├── cvtres.exe ├── lib.exe ├── link.exe ├── mc.exe ├── ml64.exe ├── msobj80.dll ├── mspdb80.dll ├── msvcp80.dll ├── msvcr80.dll ├── nmake.exe ├── rc.exe └── rcdll.dll └── x86 ├── c1.dll ├── c1p.dll ├── c2.dll ├── checktoolarch.bat ├── cl.exe ├── cvtres.exe ├── lib.exe ├── link.exe ├── mc.exe ├── ml.exe ├── msobj71.dll ├── mspdb70.dll ├── mspdb71.dll ├── msvcr70.dll ├── nmake.exe ├── rc.exe └── rcdll.dll /WS03SP1HALS/x86/halacpim/halacpim.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/WS03SP1HALS/x86/halacpim/halacpim.dll -------------------------------------------------------------------------------- /WS03SP1HALS/x86/halacpim/halacpim.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/WS03SP1HALS/x86/halacpim/halacpim.pdb -------------------------------------------------------------------------------- /WS03SP1HALS/x86/halmacpi/halmacpi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/WS03SP1HALS/x86/halmacpi/halmacpi.dll -------------------------------------------------------------------------------- /WS03SP1HALS/x86/halmacpi/halmacpi.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/WS03SP1HALS/x86/halmacpi/halmacpi.pdb -------------------------------------------------------------------------------- /WS03SP1HALS/x86/halmps/halmps.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/WS03SP1HALS/x86/halmps/halmps.dll -------------------------------------------------------------------------------- /WS03SP1HALS/x86/halmps/halmps.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/WS03SP1HALS/x86/halmps/halmps.pdb -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/amd64/BOOTVID.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/amd64/BOOTVID.lib -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/amd64/HAL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/amd64/HAL.lib -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/amd64/HOTPATCH.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/amd64/HOTPATCH.obj -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/amd64/KDCOM.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/amd64/KDCOM.lib -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/amd64/NTOSKRNL.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/amd64/NTOSKRNL.res -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/amd64/SDBAPINT.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/amd64/SDBAPINT.lib -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/amd64/ntosarch.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/amd64/ntosarch.lib -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/amd64/ntoswrk.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/amd64/ntoswrk.lib -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/i386/BOOTVID.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/i386/BOOTVID.lib -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/i386/HAL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/i386/HAL.lib -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/i386/KDCOM.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/i386/KDCOM.lib -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/i386/NTOSKRNL.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/i386/NTOSKRNL.res -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/i386/SDBAPINT.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/i386/SDBAPINT.lib -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/i386/STUB512.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/i386/STUB512.com -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/i386/ntosarch.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/i386/ntosarch.lib -------------------------------------------------------------------------------- /base/ntos/BUILD/PREBUILT/i386/ntoswrk.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/base/ntos/BUILD/PREBUILT/i386/ntoswrk.lib -------------------------------------------------------------------------------- /base/ntos/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | kernel = wrk$(machine) 9 | 10 | asobjs= 11 | ccobjs= 12 | ccarchobjs= 13 | 14 | default: kernelexp kernellib kernelexe 15 | 16 | nodefault=1 17 | !include $(ntos)\BUILD\makefile.build 18 | 19 | linklibpath = -LIBPATH:$(topobj) -LIBPATH:PREBUILT\$(targ) 20 | ntoswrklib = ntoswrk.lib 21 | ntosarchlib = ntosarch.lib 22 | bootlibs = bootvid.lib sdbapint.lib kdcom.lib 23 | 24 | fullkernel = EXE\$(kernel) 25 | 26 | # kernel link definitions 27 | LINKFLAGS = -IGNORE:4087,4001,4010,4037,4039,4065,4070,4078,4087,4089,4221,4198 -WX -NODEFAULTLIB -machine:$(machine) $(linklibpath) 28 | LINK = link.exe -nologo 29 | LINKEDIT = link.exe -edit -nologo 30 | 31 | LIB = $(LIB) $(linklibpath) 32 | 33 | !if "$(targ)" == "i386" 34 | archlinkopts = -safeseh -functionpadmin:5 -debugtype:cv,fixup -STACK:0x40000,0x2000 -align:0x1000 35 | hotpatch = -stub:PREBUILT\i386\stub512.com 36 | entrypoint = KiSystemStartup@4 37 | !else 38 | archlinkopts = -functionpadmin:6 -debugtype:cv,fixup,pdata -STACK:0x80000,0x2000 39 | hotpatch = PREBUILT\amd64\hotpatch.obj 40 | LINKFLAGS = -IGNORE:4108,4088,4218,4218,4235 $(LINKFLAGS) 41 | LIBFLAGS = -IGNORE:4108,4088,4218,4218,4235 $(LIBFLAGS) 42 | entrypoint = KiSystemStartup 43 | !endif 44 | 45 | ntosmerge = -merge:PAGECONST=PAGE -merge:INITCONST=INIT -merge:INITDATA=INIT -merge:PAGELKCONST=PAGELK \ 46 | -merge:PAGEVRFY_CONST=PAGEVRFY -MERGE:_PAGE=PAGE -MERGE:_TEXT=.text -merge:.rdata=.text 47 | 48 | ntosversion = -release -version:5.2 -osversion:5.2 -subsystem:native,5.02 49 | 50 | ntoslinkopts = $(ntosversion) $(ntosmerge) -SECTION:INIT,d -OPT:REF -OPT:ICF -INCREMENTAL:NO \ 51 | -FULLBUILD -debug $(archlinkopts) -opt:nowin98 -pdbcompress -driver 52 | 53 | kernelexp: 54 | copy ..\init\ntoskrnl.src+..\init\$(targ)def.src $(OBJ)\$(kernel).pp 55 | $(CC) $(CFLAGS0) -EP $(OBJ)\$(kernel).pp > $(fullkernel).def 56 | -del $(OBJ)\$(kernel).pp 57 | $(LIB) $(LIBFLAGS) -IGNORE:4001 $(OBJ)\*.lib $(ntoswrklib) -def:$(fullkernel).def -out:$(fullkernel).lib 58 | 59 | kernellib: 60 | $(LIB) $(fullkernel).lib $(ntosarchlib) -out:$(fullkernel).lib 61 | 62 | kernelexe: 63 | $(LINK) $(LINKFLAGS) $(ntoslinkopts) -out:$(fullkernel).exe -map:$(fullkernel).map -pdb:$(fullkernel).pdb -entry:$(entrypoint) \ 64 | $(hotpatch) PREBUILT\$(targ)\ntoskrnl.res $(OBJ)\ntkrnlmp.obj $(OBJ)\*.lib $(ntoswrklib) hal.lib $(fullkernel).exp $(bootlibs) 65 | $(LINKEDIT) -section:.rsrc,!d $(fullkernel).exe 66 | 67 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/halverifier.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | halverifier.c 12 | 13 | Abstract: 14 | 15 | This module contains the routines to verify hal usage & apis. 16 | 17 | --*/ 18 | 19 | #ifndef _HAL_VERIFIER_ 20 | #define _HAL_VERIFIER_ 21 | 22 | VOID 23 | VfHalVerifierInitialize( 24 | VOID 25 | ); 26 | 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfbugcheck.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfbugcheck.h 12 | 13 | Abstract: 14 | 15 | This header defines the prototypes and constants required for verifier 16 | bugchecks. 17 | 18 | --*/ 19 | 20 | #ifndef _VFBUGCHECK_H_ 21 | #define _VFBUGCHECK_H_ 22 | 23 | extern LONG IovpInitCalled; 24 | 25 | #define KDASSERT(x) { if (KdDebuggerEnabled) { ASSERT(x) ; } } 26 | 27 | #define ASSERT_SPINLOCK_HELD(x) 28 | 29 | #define DCPARAM_ROUTINE 0x00000001 30 | #define DCPARAM_IRP 0x00000008 31 | #define DCPARAM_IRPSNAP 0x00000040 32 | #define DCPARAM_DEVOBJ 0x00000200 33 | #define DCPARAM_STATUS 0x00001000 34 | #define DCPARAM_ULONG 0x00008000 35 | #define DCPARAM_PVOID 0x00040000 36 | 37 | #define WDM_FAIL_ROUTINE(ParenWrappedParamList) \ 38 | { \ 39 | if (IovpInitCalled) { \ 40 | VfBugcheckThrowIoException##ParenWrappedParamList;\ 41 | } \ 42 | } 43 | 44 | VOID 45 | FASTCALL 46 | VfBugcheckInit( 47 | VOID 48 | ); 49 | 50 | NTSTATUS 51 | VfBugcheckThrowIoException( 52 | IN DCERROR_ID MessageIndex, 53 | IN ULONG MessageParameterMask, 54 | ... 55 | ); 56 | 57 | NTSTATUS 58 | VfBugcheckThrowException( 59 | IN PVFMESSAGE_TEMPLATE_TABLE MessageTable OPTIONAL, 60 | IN VFMESSAGE_ERRORID MessageID, 61 | IN PCSTR MessageParamFormat, 62 | IN va_list * MessageParameters 63 | ); 64 | 65 | #endif // _VFBUGCHECK_H_ 66 | 67 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfddi.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfddi.h 12 | 13 | Abstract: 14 | 15 | This header contains prototypes for verifier device driver interfaces. 16 | 17 | --*/ 18 | 19 | VOID 20 | VfDdiInit( 21 | VOID 22 | ); 23 | 24 | VOID 25 | VfDdiExposeWmiObjects( 26 | VOID 27 | ); 28 | 29 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfdebug.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfdebug.h 12 | 13 | Abstract: 14 | 15 | This header contains debugging macros used by the driver verifier code. 16 | 17 | --*/ 18 | 19 | extern ULONG VfSpewLevel; 20 | 21 | #if DBG 22 | #define VERIFIER_DBGPRINT(txt,level) \ 23 | { \ 24 | if (VfSpewLevel>(level)) { \ 25 | DbgPrint##txt; \ 26 | }\ 27 | } 28 | #else 29 | #define VERIFIER_DBGPRINT(txt,level) 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfdef.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfdef.h 12 | 13 | Abstract: 14 | 15 | This header collects together the various files necessary to create a basic 16 | set of definitions for the verifier. 17 | 18 | --*/ 19 | 20 | // 21 | // Disable W4 level warnings generated by public headers. 22 | // 23 | 24 | #include "vfpragma.h" 25 | 26 | #include "ntos.h" 27 | #include "vfdebug.h" 28 | #include "vfmacro.h" 29 | #include "vfinit.h" 30 | #include "vfsettings.h" 31 | #include "vfmessage.h" 32 | #include "vfbugcheck.h" 33 | #include "vfprint.h" 34 | #include "vfutil.h" 35 | #include "vfstack.h" 36 | #include "vftriage.h" 37 | #include "vfirp.h" 38 | #include "vfirpdb.h" 39 | #include "vfirplog.h" 40 | #include "vfdevobj.h" 41 | #include "vfpacket.h" 42 | #include "halverifier.h" 43 | #include "vfdeadlock.h" 44 | 45 | #include "..\io\trackirp.h" 46 | #include "..\io\sessnirp.h" 47 | 48 | #include "..\ob\obvutil.h" 49 | #include "..\io\iovutil.h" 50 | #include "..\io\pnpmgr\ppvutil.h" 51 | 52 | #include "vffilter.h" 53 | #include "vfmajor.h" 54 | #include "vfpnp.h" 55 | #include "vfpower.h" 56 | #include "vfwmi.h" 57 | #include "vfgeneric.h" 58 | #include "vfrandom.h" 59 | #include "vfddi.h" 60 | 61 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfdevobj.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfdevobj.h 12 | 13 | Abstract: 14 | 15 | This header exposes function hooks that verify drivers properly manage 16 | device objects. 17 | 18 | --*/ 19 | 20 | typedef enum { 21 | 22 | VF_DEVOBJ_PDO = 0, 23 | VF_DEVOBJ_BUS_FILTER, 24 | VF_DEVOBJ_LOWER_DEVICE_FILTER, 25 | VF_DEVOBJ_LOWER_CLASS_FILTER, 26 | VF_DEVOBJ_FDO, 27 | VF_DEVOBJ_UPPER_DEVICE_FILTER, 28 | VF_DEVOBJ_UPPER_CLASS_FILTER 29 | 30 | } VF_DEVOBJ_TYPE, *PVF_DEVOBJ_TYPE; 31 | 32 | VOID 33 | VfDevObjPreAddDevice( 34 | IN PDEVICE_OBJECT PhysicalDeviceObject, 35 | IN PDRIVER_OBJECT DriverObject, 36 | IN PDRIVER_ADD_DEVICE AddDeviceFunction, 37 | IN VF_DEVOBJ_TYPE DevObjType 38 | ); 39 | 40 | VOID 41 | VfDevObjPostAddDevice( 42 | IN PDEVICE_OBJECT PhysicalDeviceObject, 43 | IN PDRIVER_OBJECT DriverObject, 44 | IN PDRIVER_ADD_DEVICE AddDeviceFunction, 45 | IN VF_DEVOBJ_TYPE DevObjType, 46 | IN NTSTATUS Result 47 | ); 48 | 49 | VOID 50 | VfDevObjAdjustFdoForVerifierFilters( 51 | IN OUT PDEVICE_OBJECT *FunctionalDeviceObject 52 | ); 53 | 54 | VOID 55 | VerifierIoAttachDeviceToDeviceStack( 56 | IN PDEVICE_OBJECT NewDevice, 57 | IN PDEVICE_OBJECT ExistingDevice 58 | ); 59 | 60 | VOID 61 | VerifierIoDetachDevice( 62 | IN PDEVICE_OBJECT LowerDevice 63 | ); 64 | 65 | VOID 66 | VerifierIoDeleteDevice( 67 | IN PDEVICE_OBJECT DeviceObject 68 | ); 69 | 70 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vffilter.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vffilter.h 12 | 13 | Abstract: 14 | 15 | This header contains prototypes for using the verifier driver filter. 16 | 17 | --*/ 18 | 19 | VOID 20 | VfFilterInit( 21 | VOID 22 | ); 23 | 24 | VOID 25 | VfFilterAttach( 26 | IN PDEVICE_OBJECT PhysicalDeviceObject, 27 | IN VF_DEVOBJ_TYPE DeviceObjectType 28 | ); 29 | 30 | BOOLEAN 31 | VfFilterIsVerifierFilterObject( 32 | IN PDEVICE_OBJECT DeviceObject 33 | ); 34 | 35 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfgeneric.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfgeneric.h 12 | 13 | Abstract: 14 | 15 | This header contains prototypes for verifying generic IRPs are handled 16 | correctly. 17 | 18 | --*/ 19 | 20 | VOID 21 | VfGenericInit( 22 | VOID 23 | ); 24 | 25 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfinit.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfinit.h 12 | 13 | Abstract: 14 | 15 | This header exposes the routines necessary to initialize the driver verifier. 16 | 17 | --*/ 18 | 19 | VOID 20 | FASTCALL 21 | VfInitVerifier( 22 | IN ULONG MmFlags 23 | ); 24 | 25 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfirplog.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfirplog.h 12 | 13 | Abstract: 14 | 15 | This header exposes functions for logging IRP events. 16 | 17 | --*/ 18 | 19 | // 20 | // Log-snapshots are retrievable by user mode for profiling and targetted 21 | // probing of stacks. Content-wise they are heavier. 22 | // 23 | typedef struct _IRPLOG_SNAPSHOT { 24 | 25 | ULONG Count; 26 | UCHAR MajorFunction; 27 | UCHAR MinorFunction; 28 | UCHAR Flags; 29 | UCHAR Control; 30 | ULONGLONG ArgArray[4]; 31 | 32 | } IRPLOG_SNAPSHOT, *PIRPLOG_SNAPSHOT; 33 | 34 | VOID 35 | VfIrpLogInit( 36 | VOID 37 | ); 38 | 39 | VOID 40 | VfIrpLogRecordEvent( 41 | IN PVERIFIER_SETTINGS_SNAPSHOT VerifierSettingsSnapshot, 42 | IN PDEVICE_OBJECT DeviceObject, 43 | IN PIRP Irp 44 | ); 45 | 46 | ULONG 47 | VfIrpLogGetIrpDatabaseSiloCount( 48 | VOID 49 | ); 50 | 51 | NTSTATUS 52 | VfIrpLogLockDatabase( 53 | IN ULONG SiloNumber 54 | ); 55 | 56 | NTSTATUS 57 | VfIrpLogRetrieveWmiData( 58 | IN ULONG SiloNumber, 59 | OUT PUCHAR OutputBuffer OPTIONAL, 60 | OUT ULONG *OffsetInstanceNameOffsets, 61 | OUT ULONG *InstanceCount, 62 | OUT ULONG *DataBlockOffset, 63 | OUT ULONG *TotalRequiredSize 64 | ); 65 | 66 | VOID 67 | VfIrpLogUnlockDatabase( 68 | IN ULONG SiloNumber 69 | ); 70 | 71 | VOID 72 | VfIrpLogDeleteDeviceLogs( 73 | IN PDEVICE_OBJECT DeviceObject 74 | ); 75 | 76 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfmacro.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfmacro.h 12 | 13 | Abstract: 14 | 15 | This header contains a collection of macros used by the verifier. 16 | 17 | --*/ 18 | 19 | 20 | // 21 | // This macro takes an array and returns the number of elements in it. 22 | // 23 | #define ARRAY_COUNT(array) (sizeof(array)/sizeof(array[0])) 24 | 25 | // 26 | // This macro takes a value and an alignment and rounds the entry up 27 | // appropriately. The alignment MUST be a power of two! 28 | // 29 | #define ALIGN_UP_ULONG(value, alignment) (((value)+(alignment)-1)&(~(alignment-1))) 30 | 31 | // 32 | // This macro compares two guids in their binary form for equivalence. 33 | // 34 | #define IS_EQUAL_GUID(a,b) (RtlCompareMemory(a, b, sizeof(GUID)) == sizeof(GUID)) 35 | 36 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfpnp.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfpnp.h 12 | 13 | Abstract: 14 | 15 | This header contains prototypes for verifying Pnp IRPs are handled 16 | correctly. 17 | 18 | --*/ 19 | 20 | VOID 21 | VfPnpInit( 22 | VOID 23 | ); 24 | 25 | VOID 26 | FASTCALL 27 | VfPnpVerifyNewRequest( 28 | IN PIOV_REQUEST_PACKET IovPacket, 29 | IN PDEVICE_OBJECT DeviceObject, 30 | IN PIO_STACK_LOCATION IrpLastSp OPTIONAL, 31 | IN PIO_STACK_LOCATION IrpSp, 32 | IN PIOV_STACK_LOCATION StackLocationData, 33 | IN PVOID CallerAddress OPTIONAL 34 | ); 35 | 36 | VOID 37 | FASTCALL 38 | VfPnpVerifyIrpStackDownward( 39 | IN PIOV_REQUEST_PACKET IovPacket, 40 | IN PDEVICE_OBJECT DeviceObject, 41 | IN PIO_STACK_LOCATION IrpLastSp OPTIONAL, 42 | IN PIO_STACK_LOCATION IrpSp, 43 | IN PIOV_STACK_LOCATION RequestHeadLocationData, 44 | IN PIOV_STACK_LOCATION StackLocationData, 45 | IN PVOID CallerAddress OPTIONAL 46 | ); 47 | 48 | VOID 49 | FASTCALL 50 | VfPnpVerifyIrpStackUpward( 51 | IN PIOV_REQUEST_PACKET IovPacket, 52 | IN PIO_STACK_LOCATION IrpSp, 53 | IN PIOV_STACK_LOCATION RequestHeadLocationData, 54 | IN PIOV_STACK_LOCATION StackLocationData, 55 | IN BOOLEAN IsNewlyCompleted, 56 | IN BOOLEAN RequestFinalized 57 | ); 58 | 59 | VOID 60 | FASTCALL 61 | VfPnpDumpIrpStack( 62 | IN PIO_STACK_LOCATION IrpSp 63 | ); 64 | 65 | BOOLEAN 66 | FASTCALL 67 | VfPnpIsSystemRestrictedIrp( 68 | IN PIO_STACK_LOCATION IrpSp 69 | ); 70 | 71 | BOOLEAN 72 | FASTCALL 73 | VfPnpAdvanceIrpStatus( 74 | IN PIO_STACK_LOCATION IrpSp, 75 | IN NTSTATUS OriginalStatus, 76 | IN OUT NTSTATUS *StatusToAdvance 77 | ); 78 | 79 | VOID 80 | FASTCALL 81 | VfPnpTestStartedPdoStack( 82 | IN PDEVICE_OBJECT PhysicalDeviceObject 83 | ); 84 | 85 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfpower.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfpower.h 12 | 13 | Abstract: 14 | 15 | This header contains prototypes for verifying Power IRPs are handled 16 | correctly. 17 | 18 | --*/ 19 | 20 | VOID 21 | VfPowerInit( 22 | VOID 23 | ); 24 | 25 | VOID 26 | FASTCALL 27 | VfPowerVerifyNewRequest( 28 | IN PIOV_REQUEST_PACKET IovPacket, 29 | IN PDEVICE_OBJECT DeviceObject, 30 | IN PIO_STACK_LOCATION IrpLastSp OPTIONAL, 31 | IN PIO_STACK_LOCATION IrpSp, 32 | IN PIOV_STACK_LOCATION StackLocationData, 33 | IN PVOID CallerAddress OPTIONAL 34 | ); 35 | 36 | VOID 37 | FASTCALL 38 | VfPowerVerifyIrpStackDownward( 39 | IN PIOV_REQUEST_PACKET IovPacket, 40 | IN PDEVICE_OBJECT DeviceObject, 41 | IN PIO_STACK_LOCATION IrpLastSp OPTIONAL, 42 | IN PIO_STACK_LOCATION IrpSp, 43 | IN PIOV_STACK_LOCATION RequestHeadLocationData, 44 | IN PIOV_STACK_LOCATION StackLocationData, 45 | IN PVOID CallerAddress OPTIONAL 46 | ); 47 | 48 | VOID 49 | FASTCALL 50 | VfPowerVerifyIrpStackUpward( 51 | IN PIOV_REQUEST_PACKET IovPacket, 52 | IN PIO_STACK_LOCATION IrpSp, 53 | IN PIOV_STACK_LOCATION RequestHeadLocationData, 54 | IN PIOV_STACK_LOCATION StackLocationData, 55 | IN BOOLEAN IsNewlyCompleted, 56 | IN BOOLEAN RequestFinalized 57 | ); 58 | 59 | VOID 60 | FASTCALL 61 | VfPowerDumpIrpStack( 62 | IN PIO_STACK_LOCATION IrpSp 63 | ); 64 | 65 | BOOLEAN 66 | FASTCALL 67 | VfPowerIsSystemRestrictedIrp( 68 | IN PIO_STACK_LOCATION IrpSp 69 | ); 70 | 71 | BOOLEAN 72 | FASTCALL 73 | VfPowerAdvanceIrpStatus( 74 | IN PIO_STACK_LOCATION IrpSp, 75 | IN NTSTATUS OriginalStatus, 76 | IN OUT NTSTATUS *StatusToAdvance 77 | ); 78 | 79 | VOID 80 | FASTCALL 81 | VfPowerTestStartedPdoStack( 82 | IN PDEVICE_OBJECT PhysicalDeviceObject 83 | ); 84 | 85 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfpragma.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfpragma.h 12 | 13 | Abstract: 14 | 15 | This header contains disable instructions for W4 warnings generated 16 | by public headers. This way we can still compile modules at W4. 17 | 18 | --*/ 19 | 20 | // 21 | // Disable W4 level warnings generated by public headers. 22 | // 23 | 24 | #pragma warning(disable:4214) // bit field types other than int 25 | #pragma warning(disable:4201) // nameless struct/union 26 | #pragma warning(disable:4324) // alignment sensitive to declspec 27 | #pragma warning(disable:4127) // condition expression is constant 28 | #pragma warning(disable:4115) // named type definition in parentheses 29 | #pragma warning(disable:4232) // dllimport not static 30 | #pragma warning(disable:4206) // translation unit empty 31 | #pragma warning(disable:4054) // function pointer to data pointer cast 32 | 33 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfprint.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfprint.h 12 | 13 | Abstract: 14 | 15 | This header exposes prototypes required when outputting various data types 16 | to the debugger. 17 | 18 | --*/ 19 | 20 | VOID 21 | VfPrintDumpIrpStack( 22 | IN PIO_STACK_LOCATION IrpSp 23 | ); 24 | 25 | VOID 26 | VfPrintDumpIrp( 27 | IN PIRP IrpToFlag 28 | ); 29 | 30 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfrandom.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfrandom.h 12 | 13 | Abstract: 14 | 15 | This header exposes support for random number generation as needed by the 16 | verifier. 17 | 18 | --*/ 19 | 20 | VOID 21 | VfRandomInit( 22 | VOID 23 | ); 24 | 25 | ULONG 26 | FASTCALL 27 | VfRandomGetNumber( 28 | IN ULONG Minimum, 29 | IN ULONG Maximum 30 | ); 31 | 32 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfstack.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfstack.h 12 | 13 | Abstract: 14 | 15 | This header contains prototypes for verifying drivers don't improperly use 16 | thread stacks. 17 | 18 | --*/ 19 | 20 | VOID 21 | FASTCALL 22 | VfStackSeedStack( 23 | IN ULONG Seed 24 | ); 25 | 26 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vftriage.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vftriage 12 | 13 | Abstract: 14 | 15 | Code to support driver verifier triage decisions and running mode. 16 | 17 | --*/ 18 | 19 | #ifndef INCLUDED_VFTRIAGE_H 20 | #define INCLUDED_VFTRIAGE_H 21 | 22 | #endif // #ifndef INCLUDED_VFTRIAGE_H 23 | 24 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfutil.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfutil.h 12 | 13 | Abstract: 14 | 15 | This header contains prototypes for various functions required to do driver 16 | verification. 17 | 18 | --*/ 19 | 20 | typedef enum { 21 | 22 | VFMP_INSTANT = 0, 23 | VFMP_INSTANT_NONPAGED 24 | 25 | } MEMORY_PERSISTANCE; 26 | 27 | BOOLEAN 28 | VfUtilIsMemoryRangeReadable( 29 | IN PVOID Location, 30 | IN size_t Length, 31 | IN MEMORY_PERSISTANCE Persistance 32 | ); 33 | 34 | VOID 35 | VfSetVerifierEnabled ( 36 | LOGICAL Value 37 | ); 38 | 39 | -------------------------------------------------------------------------------- /base/ntos/VERIFIER/vfwmi.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | vfwmi.h 12 | 13 | Abstract: 14 | 15 | This header contains prototypes for verifying System Control IRPs are 16 | handled correctly. 17 | 18 | --*/ 19 | 20 | VOID 21 | VfWmiInit( 22 | VOID 23 | ); 24 | 25 | VOID 26 | FASTCALL 27 | VfWmiVerifyNewRequest( 28 | IN PIOV_REQUEST_PACKET IovPacket, 29 | IN PDEVICE_OBJECT DeviceObject, 30 | IN PIO_STACK_LOCATION IrpLastSp OPTIONAL, 31 | IN PIO_STACK_LOCATION IrpSp, 32 | IN PIOV_STACK_LOCATION StackLocationData, 33 | IN PVOID CallerAddress OPTIONAL 34 | ); 35 | 36 | VOID 37 | FASTCALL 38 | VfWmiVerifyIrpStackDownward( 39 | IN PIOV_REQUEST_PACKET IovPacket, 40 | IN PDEVICE_OBJECT DeviceObject, 41 | IN PIO_STACK_LOCATION IrpLastSp OPTIONAL, 42 | IN PIO_STACK_LOCATION IrpSp, 43 | IN PIOV_STACK_LOCATION RequestHeadLocationData, 44 | IN PIOV_STACK_LOCATION StackLocationData, 45 | IN PVOID CallerAddress OPTIONAL 46 | ); 47 | 48 | VOID 49 | FASTCALL 50 | VfWmiVerifyIrpStackUpward( 51 | IN PIOV_REQUEST_PACKET IovPacket, 52 | IN PIO_STACK_LOCATION IrpSp, 53 | IN PIOV_STACK_LOCATION RequestHeadLocationData, 54 | IN PIOV_STACK_LOCATION StackLocationData, 55 | IN BOOLEAN IsNewlyCompleted, 56 | IN BOOLEAN RequestFinalized 57 | ); 58 | 59 | VOID 60 | FASTCALL 61 | VfWmiDumpIrpStack( 62 | IN PIO_STACK_LOCATION IrpSp 63 | ); 64 | 65 | VOID 66 | FASTCALL 67 | VfWmiTestStartedPdoStack( 68 | IN PDEVICE_OBJECT PhysicalDeviceObject 69 | ); 70 | 71 | -------------------------------------------------------------------------------- /base/ntos/cache/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | 10 | asobjs= 11 | ccarchobjs= 12 | 13 | ccobjs= \ 14 | $(OBJ)\cachedat.obj \ 15 | $(OBJ)\cachesub.obj \ 16 | $(OBJ)\copysup.obj \ 17 | $(OBJ)\fssup.obj \ 18 | $(OBJ)\lazyrite.obj \ 19 | $(OBJ)\logsup.obj \ 20 | $(OBJ)\mdlsup.obj \ 21 | $(OBJ)\pinsup.obj \ 22 | $(OBJ)\ccperf.obj \ 23 | $(OBJ)\vacbsup.obj 24 | 25 | !include $(ntos)\BUILD\makefile.build 26 | 27 | -------------------------------------------------------------------------------- /base/ntos/config/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | specialcflags = -D_WANT_MACHINE_IDENTIFICATION 10 | 11 | asobjs= 12 | ccarchobjs= 13 | 14 | ccobjs= \ 15 | $(OBJ)\cmapi.obj \ 16 | $(OBJ)\cmapi2.obj \ 17 | $(OBJ)\cmboot.obj \ 18 | $(OBJ)\cmchek.obj \ 19 | $(OBJ)\cmchek2.obj \ 20 | $(OBJ)\cmclose.obj \ 21 | $(OBJ)\cmconfig.obj \ 22 | $(OBJ)\cmcontrl.obj \ 23 | $(OBJ)\cmdat.obj \ 24 | $(OBJ)\cmdat2.obj \ 25 | $(OBJ)\cmdatini.obj \ 26 | $(OBJ)\cmdelete.obj \ 27 | $(OBJ)\cmgquota.obj \ 28 | $(OBJ)\cmhvlist.obj \ 29 | $(OBJ)\cmindex.obj \ 30 | $(OBJ)\cminit.obj \ 31 | $(OBJ)\cmname.obj \ 32 | $(OBJ)\cmnotify.obj \ 33 | $(OBJ)\cmparse.obj \ 34 | $(OBJ)\cmparse2.obj \ 35 | $(OBJ)\cmquery.obj \ 36 | $(OBJ)\cmsavres.obj \ 37 | $(OBJ)\cmsubs.obj \ 38 | $(OBJ)\cmsubs2.obj \ 39 | $(OBJ)\cmsubs3.obj \ 40 | $(OBJ)\cmse.obj \ 41 | $(OBJ)\cmsysini.obj \ 42 | $(OBJ)\cmtrecpy.obj \ 43 | $(OBJ)\cmtredel.obj \ 44 | $(OBJ)\cmtree.obj \ 45 | $(OBJ)\cmworker.obj \ 46 | $(OBJ)\cmwrapr.obj \ 47 | $(OBJ)\cmwrapr2.obj \ 48 | $(OBJ)\cmwmi.obj \ 49 | $(OBJ)\cmmapvw.obj \ 50 | $(OBJ)\cmdelay.obj \ 51 | $(OBJ)\cmvalue.obj \ 52 | $(OBJ)\cmsecache.obj \ 53 | $(OBJ)\cmdown.obj \ 54 | $(OBJ)\cmalloc.obj \ 55 | $(OBJ)\cmhook.obj \ 56 | $(OBJ)\hivebin.obj \ 57 | $(OBJ)\hivecell.obj \ 58 | $(OBJ)\hivechek.obj \ 59 | $(OBJ)\hivefree.obj \ 60 | $(OBJ)\hiveinit.obj \ 61 | $(OBJ)\hiveload.obj \ 62 | $(OBJ)\hivemap.obj \ 63 | $(OBJ)\hivesum.obj \ 64 | $(OBJ)\hivesync.obj \ 65 | $(OBJ)\hivehint.obj \ 66 | $(OBJ)\ntapi.obj 67 | 68 | !include $(ntos)\BUILD\makefile.build 69 | 70 | -------------------------------------------------------------------------------- /base/ntos/config/cmwrapr2.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | cmwrapr2.c 12 | 13 | Abstract: 14 | 15 | This module contains the source for wrapper routines called by the 16 | hive code, which in turn call the appropriate NT routines. But not 17 | callable from user mode. 18 | 19 | --*/ 20 | 21 | #include "cmp.h" 22 | 23 | #ifdef ALLOC_PRAGMA 24 | #pragma alloc_text(PAGE,CmpFileSetSize) 25 | #endif 26 | 27 | extern KEVENT StartRegistryCommand; 28 | extern KEVENT EndRegistryCommand; 29 | 30 | // 31 | // Write-Control: 32 | // CmpNoWrite is initially true. When set this way write and flush 33 | // do nothing, simply returning success. When cleared to FALSE, I/O 34 | // is enabled. This change is made after the I/O system is started 35 | // AND autocheck (chkdsk) has done its thing. 36 | // 37 | 38 | extern BOOLEAN CmpNoWrite; 39 | 40 | 41 | BOOLEAN 42 | CmpFileSetSize( 43 | PHHIVE Hive, 44 | ULONG FileType, 45 | ULONG FileSize, 46 | ULONG OldFileSize 47 | ) 48 | /*++ 49 | 50 | Routine Description: 51 | 52 | This routine sets the size of a file. It must not return until 53 | the size is guaranteed, therefore, it does a flush. 54 | 55 | It is environment specific. 56 | 57 | This routine will force execution to the correct thread context. 58 | 59 | Arguments: 60 | 61 | Hive - Hive we are doing I/O for 62 | 63 | FileType - which supporting file to use 64 | 65 | FileSize - 32 bit value to set the file's size to 66 | 67 | Return Value: 68 | 69 | FALSE if failure 70 | TRUE if success 71 | 72 | --*/ 73 | { 74 | NTSTATUS status; 75 | 76 | ASSERT(FIELD_OFFSET(CMHIVE, Hive) == 0); 77 | 78 | ASSERT_HIVE_WRITER_LOCK_OWNED((PCMHIVE)Hive); 79 | 80 | // 81 | // Call the worker to do real work for us. 82 | // 83 | status = CmpDoFileSetSize(Hive,FileType,FileSize,OldFileSize); 84 | 85 | if (!NT_SUCCESS(status)) { 86 | CmKdPrintEx((DPFLTR_CONFIG_ID,CML_BUGCHECK,"CmpFileSetSize:\n\t")); 87 | CmKdPrintEx((DPFLTR_CONFIG_ID,CML_BUGCHECK,"Failure: status = %08lx ", status)); 88 | return FALSE; 89 | } 90 | 91 | return TRUE; 92 | } 93 | -------------------------------------------------------------------------------- /base/ntos/config/hivesum.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | hivesum.c 12 | 13 | Abstract: 14 | 15 | Hive header checksum module. 16 | 17 | --*/ 18 | 19 | #include "cmp.h" 20 | 21 | #ifdef ALLOC_PRAGMA 22 | #pragma alloc_text(PAGE,HvpHeaderCheckSum) 23 | #endif 24 | 25 | ULONG 26 | HvpHeaderCheckSum( 27 | PHBASE_BLOCK BaseBlock 28 | ) 29 | /*++ 30 | 31 | Routine Description: 32 | 33 | Compute the checksum for a hive disk header. 34 | 35 | Arguments: 36 | 37 | BaseBlock - supplies pointer to the header to checksum 38 | 39 | Return Value: 40 | 41 | the check sum. 42 | 43 | --*/ 44 | { 45 | ULONG sum; 46 | ULONG i; 47 | 48 | sum = 0; 49 | for (i = 0; i < 127; i++) { 50 | sum ^= ((PULONG)BaseBlock)[i]; 51 | } 52 | if (sum == (ULONG)-1) { 53 | sum = (ULONG)-2; 54 | } 55 | if (sum == 0) { 56 | sum = 1; 57 | } 58 | return sum; 59 | } 60 | -------------------------------------------------------------------------------- /base/ntos/dbgk/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | 10 | asobjs= 11 | ccarchobjs= 12 | 13 | ccobjs= \ 14 | $(OBJ)\dbgkport.obj \ 15 | $(OBJ)\dbgkproc.obj \ 16 | $(OBJ)\dbgkobj.obj 17 | 18 | !include $(ntos)\BUILD\makefile.build 19 | 20 | -------------------------------------------------------------------------------- /base/ntos/ex/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | specialcflags = -I..\..\ke 10 | 11 | !if "$(targ)" == "i386" 12 | asobjs= \ 13 | $(OBJ)\intrlock.obj \ 14 | $(OBJ)\intrlfst.obj \ 15 | $(OBJ)\splocks.obj 16 | ccarchobjs= 17 | !else 18 | asobjs= \ 19 | $(OBJ)\hifreqlk.obj \ 20 | $(OBJ)\hrderror.obj \ 21 | $(OBJ)\intrlock.obj 22 | ccarchobjs= \ 23 | $(OBJ)\wowinfo.obj 24 | !endif 25 | 26 | 27 | ccobjs= \ 28 | $(OBJ)\callback.obj \ 29 | $(OBJ)\callperf.obj \ 30 | $(OBJ)\delay.obj \ 31 | $(OBJ)\event.obj \ 32 | $(OBJ)\eventpr.obj \ 33 | $(OBJ)\exatom.obj \ 34 | $(OBJ)\exdata.obj \ 35 | $(OBJ)\exinit.obj \ 36 | $(OBJ)\fmutexc.obj \ 37 | $(OBJ)\handle.obj \ 38 | $(OBJ)\harderr.obj \ 39 | $(OBJ)\lookasid.obj \ 40 | $(OBJ)\luid.obj \ 41 | $(OBJ)\mutant.obj \ 42 | $(OBJ)\nbqueue.obj \ 43 | $(OBJ)\pool.obj \ 44 | $(OBJ)\probe.obj \ 45 | $(OBJ)\profile.obj \ 46 | $(OBJ)\raise.obj \ 47 | $(OBJ)\resource.obj \ 48 | $(OBJ)\semphore.obj \ 49 | $(OBJ)\sysinfo.obj \ 50 | $(OBJ)\timer.obj \ 51 | $(OBJ)\worker.obj \ 52 | $(OBJ)\zone.obj \ 53 | $(OBJ)\uuid.obj \ 54 | $(OBJ)\win32.obj \ 55 | $(OBJ)\rundown.obj \ 56 | $(OBJ)\pushlock.obj \ 57 | $(OBJ)\keyedevent.obj 58 | 59 | !include $(ntos)\BUILD\makefile.build 60 | 61 | -------------------------------------------------------------------------------- /base/ntos/ex/amd64/wowinfo.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | wowinfo.c 12 | 13 | Abstract: 14 | 15 | This module implements the routines to returns processor-specific information 16 | about the x86 emulation capability. 17 | 18 | --*/ 19 | 20 | #include "exp.h" 21 | 22 | NTSTATUS 23 | ExpGetSystemEmulationProcessorInformation ( 24 | OUT PSYSTEM_PROCESSOR_INFORMATION ProcessorInformation 25 | ) 26 | 27 | /*++ 28 | 29 | Routine Description: 30 | 31 | Retrieves the processor information of the emulation hardware. 32 | 33 | Arguments: 34 | 35 | ProcessorInformation - Pointer to receive the processor's emulation information. 36 | 37 | Return Value: 38 | 39 | NTSTATUS 40 | 41 | --*/ 42 | 43 | { 44 | NTSTATUS NtStatus = STATUS_SUCCESS; 45 | 46 | // 47 | // Return INTEL processor architecture for compatibility. 48 | // Use the native values for processor revision and level. 49 | // 50 | 51 | try { 52 | 53 | ProcessorInformation->ProcessorArchitecture = PROCESSOR_ARCHITECTURE_INTEL; 54 | ProcessorInformation->ProcessorLevel = KeProcessorLevel; 55 | ProcessorInformation->ProcessorRevision = KeProcessorRevision; 56 | ProcessorInformation->Reserved = 0; 57 | ProcessorInformation->ProcessorFeatureBits = KeFeatureBits; 58 | } 59 | except (EXCEPTION_EXECUTE_HANDLER) { 60 | 61 | NtStatus = GetExceptionCode (); 62 | } 63 | 64 | return NtStatus; 65 | } 66 | 67 | -------------------------------------------------------------------------------- /base/ntos/ex/delay.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | delay.c 12 | 13 | Abstract: 14 | 15 | This module implements the executive delay execution system service. 16 | 17 | --*/ 18 | 19 | #include "exp.h" 20 | 21 | #pragma alloc_text(PAGE, NtDelayExecution) 22 | 23 | NTSTATUS 24 | NtDelayExecution ( 25 | __in BOOLEAN Alertable, 26 | __in PLARGE_INTEGER DelayInterval 27 | ) 28 | 29 | /*++ 30 | 31 | Routine Description: 32 | 33 | This function delays the execution of the current thread for the specified 34 | interval of time. 35 | 36 | Arguments: 37 | 38 | Alertable - Supplies a boolean value that specifies whether the delay 39 | is alertable. 40 | 41 | DelayInterval - Supplies the absolute of relative time over which the 42 | delay is to occur. 43 | 44 | Return Value: 45 | 46 | NTSTATUS. 47 | 48 | --*/ 49 | 50 | { 51 | 52 | LARGE_INTEGER Interval; 53 | KPROCESSOR_MODE PreviousMode; 54 | 55 | // 56 | // Get previous processor mode and probe delay interval address if 57 | // necessary. 58 | // 59 | 60 | PreviousMode = KeGetPreviousMode(); 61 | if (PreviousMode != KernelMode) { 62 | try { 63 | ProbeForReadSmallStructure(DelayInterval, sizeof(LARGE_INTEGER), sizeof(ULONG)); 64 | Interval = *DelayInterval; 65 | 66 | } except(EXCEPTION_EXECUTE_HANDLER) { 67 | return GetExceptionCode(); 68 | } 69 | 70 | } else { 71 | Interval = *DelayInterval; 72 | } 73 | 74 | // 75 | // Delay execution for the specified amount of time. 76 | // 77 | 78 | return KeDelayExecutionThread(PreviousMode, Alertable, &Interval); 79 | } 80 | 81 | -------------------------------------------------------------------------------- /base/ntos/ex/exdata.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | exdata.c 12 | 13 | Abstract: 14 | 15 | This module contains the global read/write data for the I/O system. 16 | 17 | --*/ 18 | 19 | #include "exp.h" 20 | 21 | // 22 | // Executive callbacks. 23 | // 24 | 25 | PCALLBACK_OBJECT ExCbSetSystemTime; 26 | PCALLBACK_OBJECT ExCbSetSystemState; 27 | PCALLBACK_OBJECT ExCbPowerState; 28 | 29 | #ifdef _PNP_POWER_ 30 | 31 | // 32 | // Work Item to scan SystemInformation levels 33 | // 34 | 35 | WORK_QUEUE_ITEM ExpCheckSystemInfoWorkItem; 36 | 37 | #endif 38 | 39 | 40 | // 41 | // Pageable data 42 | // 43 | 44 | #ifdef ALLOC_DATA_PRAGMA 45 | #pragma const_seg("PAGECONST") 46 | #endif 47 | 48 | #ifdef _PNP_POWER_ 49 | 50 | const WCHAR ExpWstrSystemInformation[] = L"Control\\System Information"; 51 | const WCHAR ExpWstrSystemInformationValue[] = L"Value"; 52 | 53 | #endif 54 | 55 | // 56 | // Initialization time data 57 | // 58 | 59 | #ifdef ALLOC_DATA_PRAGMA 60 | #pragma const_seg("INITCONST") 61 | #endif 62 | 63 | const WCHAR ExpWstrCallback[] = L"\\Callback"; 64 | 65 | const EXP_INITIALIZE_GLOBAL_CALLBACKS ExpInitializeCallback[] = { 66 | &ExCbSetSystemTime, L"\\Callback\\SetSystemTime", 67 | &ExCbSetSystemState, L"\\Callback\\SetSystemState", 68 | &ExCbPowerState, L"\\Callback\\PowerState", 69 | NULL, NULL 70 | }; 71 | 72 | #ifdef ALLOC_DATA_PRAGMA 73 | #pragma data_seg("PAGEDATA") 74 | #endif 75 | 76 | #ifdef _PNP_POWER_ 77 | 78 | LONG ExpCheckSystemInfoBusy = 0; 79 | 80 | #endif 81 | 82 | #ifdef ALLOC_DATA_PRAGMA 83 | #pragma data_seg() 84 | #pragma const_seg() 85 | #endif 86 | 87 | -------------------------------------------------------------------------------- /base/ntos/ex/raise.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | raise.c 12 | 13 | Abstract: 14 | 15 | This module implements routines to raise datatype misalignment and 16 | access violation for probe code. 17 | 18 | N.B. These routines are provided as function to save space in the 19 | probe macros. 20 | 21 | N.B. Since these routines are *only* called from the probe macros, 22 | it is assumed that the calling code is pageable. 23 | 24 | --*/ 25 | 26 | #include "exp.h" 27 | 28 | // 29 | // Define function sections. 30 | // 31 | 32 | #pragma alloc_text(PAGE, ExRaiseAccessViolation) 33 | #pragma alloc_text(PAGE, ExRaiseDatatypeMisalignment) 34 | 35 | DECLSPEC_NOINLINE 36 | VOID 37 | ExRaiseAccessViolation ( 38 | VOID 39 | ) 40 | 41 | /*++ 42 | 43 | Routine Description: 44 | 45 | This function raises an access violation exception. 46 | 47 | N.B. There is not return from this function. 48 | 49 | Arguments: 50 | 51 | None. 52 | 53 | Return Value: 54 | 55 | None. 56 | 57 | --*/ 58 | 59 | { 60 | 61 | ExRaiseStatus(STATUS_ACCESS_VIOLATION); 62 | } 63 | 64 | DECLSPEC_NOINLINE 65 | VOID 66 | ExRaiseDatatypeMisalignment ( 67 | VOID 68 | ) 69 | 70 | /*++ 71 | 72 | Routine Description: 73 | 74 | This function raises a datatype misalignment exception. 75 | 76 | N.B. There is not return from this function. 77 | 78 | Arguments: 79 | 80 | None. 81 | 82 | Return Value: 83 | 84 | None. 85 | 86 | --*/ 87 | 88 | { 89 | 90 | ExRaiseStatus(STATUS_DATATYPE_MISALIGNMENT); 91 | } 92 | 93 | -------------------------------------------------------------------------------- /base/ntos/fsrtl/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | 10 | asobjs= 11 | 12 | ccarchobjs= 13 | 14 | ccobjs= \ 15 | $(OBJ)\DbcsName.obj \ 16 | $(OBJ)\FastIo.obj \ 17 | $(OBJ)\FaultTol.obj \ 18 | $(OBJ)\FileLock.obj \ 19 | $(OBJ)\Filter.obj \ 20 | $(OBJ)\FiltrCtx.obj \ 21 | $(OBJ)\FsFilter.obj \ 22 | $(OBJ)\FsRtlPc.obj \ 23 | $(OBJ)\LargeMcb.obj \ 24 | $(OBJ)\Name.obj \ 25 | $(OBJ)\Notify.obj \ 26 | $(OBJ)\Oplock.obj \ 27 | $(OBJ)\PnP.obj \ 28 | $(OBJ)\Unc.obj \ 29 | $(OBJ)\Tunnel.obj \ 30 | $(OBJ)\StackOvf.obj 31 | 32 | !include $(ntos)\BUILD\makefile.build 33 | 34 | -------------------------------------------------------------------------------- /base/ntos/fstub/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | 10 | asobjs= 11 | 12 | ccarchobjs= 13 | 14 | ccobjs= \ 15 | $(OBJ)\drivesup.obj 16 | 17 | 18 | !include $(ntos)\BUILD\makefile.build 19 | 20 | -------------------------------------------------------------------------------- /base/ntos/fstub/drivesup.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | drivesup.c 12 | 13 | Abstract: 14 | 15 | Default handlers for hal functions which don't get handlers 16 | installed by the hal 17 | 18 | --*/ 19 | 20 | #ifndef _DRIVESUP_H_ 21 | #define _DRIVESUP_H_ 22 | 23 | #define BOOTABLE_PARTITION 0 24 | #define PRIMARY_PARTITION 1 25 | #define LOGICAL_PARTITION 2 26 | #define FT_PARTITION 3 27 | #define OTHER_PARTITION 4 28 | 29 | #endif // _DRIVESUP_H_ 30 | 31 | -------------------------------------------------------------------------------- /base/ntos/fstub/fstub.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | fstub.h 12 | 13 | Abstract: 14 | 15 | Fstub private header file. 16 | 17 | --*/ 18 | 19 | #pragma once 20 | 21 | #pragma warning(disable:4214) // bit field types other than int 22 | #pragma warning(disable:4201) // nameless struct/union 23 | #pragma warning(disable:4127) // condition expression is constant 24 | #pragma warning(disable:4115) // named type definition in parentheses 25 | #pragma warning(disable:4706) // assignment within conditional expression 26 | 27 | 28 | typedef struct _INTERNAL_DISK_GEOMETRY { 29 | DISK_GEOMETRY Geometry; 30 | LARGE_INTEGER DiskSize; 31 | } INTERNAL_DISK_GEOMETRY, *PINTERNAL_DISK_GEOMETRY; 32 | 33 | // 34 | // Verify that the INTERNAL_DISK_GEOMETRY structure matches the DISK_GEOMETRY 35 | // structure. 36 | // 37 | 38 | C_ASSERT (FIELD_OFFSET (DISK_GEOMETRY_EX, Geometry) == 39 | FIELD_OFFSET (INTERNAL_DISK_GEOMETRY, Geometry) && 40 | FIELD_OFFSET (DISK_GEOMETRY_EX, DiskSize) == 41 | FIELD_OFFSET (INTERNAL_DISK_GEOMETRY, DiskSize)); 42 | 43 | // 44 | // Debugging macros and flags 45 | // 46 | 47 | #define FSTUB_VERBOSE_LEVEL 4 48 | 49 | #if DBG 50 | 51 | VOID 52 | FstubDbgPrintPartition( 53 | IN PPARTITION_INFORMATION Partition, 54 | IN ULONG PartitionCount 55 | ); 56 | 57 | VOID 58 | FstubDbgPrintDriveLayout( 59 | IN PDRIVE_LAYOUT_INFORMATION Layout 60 | ); 61 | 62 | VOID 63 | FstubDbgPrintPartitionEx( 64 | IN PPARTITION_INFORMATION_EX PartitionEx, 65 | IN ULONG PartitionCount 66 | ); 67 | 68 | VOID 69 | FstubDbgPrintDriveLayoutEx( 70 | IN PDRIVE_LAYOUT_INFORMATION_EX LayoutEx 71 | ); 72 | 73 | VOID 74 | FstubDbgPrintSetPartitionEx( 75 | IN PSET_PARTITION_INFORMATION_EX SetPartition, 76 | IN ULONG PartitionNumber 77 | ); 78 | 79 | #else 80 | 81 | #define FstubDbgPrintPartition(Partition, PartitionCount) 82 | #define FstubDbgPrintDriveLayout(Layout) 83 | #define FstubDbgPrintPartitionEx(PartitionEx, PartitionCount) 84 | #define FstubDbgPrintDriveLayoutEx(LayoutEx) 85 | #define FstubDbgPrintSetPartitionEx(SetPartition, PartitionNumber) 86 | 87 | #endif // !DBG 88 | 89 | -------------------------------------------------------------------------------- /base/ntos/inc/cpyuchr.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | cpyuchr.h 12 | 13 | Abstract: 14 | 15 | A more central set of definitions for unpacking unaligned 16 | data (i.e. for unbpacking bios parameter blocks). 17 | 18 | --*/ 19 | 20 | #ifndef CopyUchar1 21 | // 22 | // The following types and macros are used to help unpack the packed and 23 | // misaligned fields found in the Bios parameter block 24 | // 25 | 26 | typedef union _UCHAR1 { 27 | UCHAR Uchar[1]; 28 | UCHAR ForceAlignment; 29 | } UCHAR1, *PUCHAR1; 30 | 31 | typedef union _UCHAR2 { 32 | UCHAR Uchar[2]; 33 | USHORT ForceAlignment; 34 | } UCHAR2, *PUCHAR2; 35 | 36 | typedef union _UCHAR4 { 37 | UCHAR Uchar[4]; 38 | ULONG ForceAlignment; 39 | } UCHAR4, *PUCHAR4; 40 | 41 | // 42 | // This macro copies an unaligned src byte to an aligned dst byte 43 | // 44 | 45 | #define CopyUchar1(Dst,Src) { \ 46 | *((UCHAR1 *)(Dst)) = *((UNALIGNED UCHAR1 *)(Src)); \ 47 | } 48 | 49 | // 50 | // This macro copies an unaligned src word to an aligned dst word 51 | // 52 | 53 | #define CopyUchar2(Dst,Src) { \ 54 | *((UCHAR2 *)(Dst)) = *((UNALIGNED UCHAR2 *)(Src)); \ 55 | } 56 | 57 | // 58 | // This macro copies an unaligned src longword to an aligned dsr longword 59 | // 60 | 61 | #define CopyUchar4(Dst,Src) { \ 62 | *((UCHAR4 *)(Dst)) = *((UNALIGNED UCHAR4 *)(Src)); \ 63 | } 64 | 65 | #define CopyU4char(Dst,Src) { \ 66 | *((UNALIGNED UCHAR4 *)(Dst)) = *((UCHAR4 *)(Src)); \ 67 | } 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /base/ntos/inc/dbgk.h: -------------------------------------------------------------------------------- 1 | /*++ BUILD Version: 0001 // Increment this if a change has global effects 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | dbgk.h 12 | 13 | Abstract: 14 | 15 | This header file describes public data structures and functions 16 | that make up the kernel mode portion of the Dbg subsystem. 17 | 18 | --*/ 19 | 20 | #ifndef _DBGK_ 21 | #define _DBGK_ 22 | 23 | // 24 | // Define the debug object thats used to attatch to processes that are being debugged. 25 | // 26 | #define DEBUG_OBJECT_DELETE_PENDING (0x1) // Debug object is delete pending. 27 | #define DEBUG_OBJECT_KILL_ON_CLOSE (0x2) // Kill all debugged processes on close 28 | 29 | typedef struct _DEBUG_OBJECT { 30 | // 31 | // Event thats set when the EventList is populated. 32 | // 33 | KEVENT EventsPresent; 34 | // 35 | // Mutex to protect the structure 36 | // 37 | FAST_MUTEX Mutex; 38 | // 39 | // Queue of events waiting for debugger intervention 40 | // 41 | LIST_ENTRY EventList; 42 | // 43 | // Flags for the object 44 | // 45 | ULONG Flags; 46 | } DEBUG_OBJECT, *PDEBUG_OBJECT; 47 | 48 | VOID 49 | DbgkCreateThread( 50 | PETHREAD Thread, 51 | PVOID StartAddress 52 | ); 53 | 54 | VOID 55 | DbgkExitThread( 56 | NTSTATUS ExitStatus 57 | ); 58 | 59 | VOID 60 | DbgkExitProcess( 61 | NTSTATUS ExitStatus 62 | ); 63 | 64 | VOID 65 | DbgkMapViewOfSection( 66 | IN HANDLE SectionHandle, 67 | IN PVOID BaseAddress, 68 | IN ULONG SectionOffset, 69 | IN ULONG_PTR ViewSize 70 | ); 71 | 72 | VOID 73 | DbgkUnMapViewOfSection( 74 | IN PVOID BaseAddress 75 | ); 76 | 77 | BOOLEAN 78 | DbgkForwardException ( 79 | IN PEXCEPTION_RECORD ExceptionRecord, 80 | IN BOOLEAN DebugException, 81 | IN BOOLEAN SecondChance 82 | ); 83 | 84 | NTSTATUS 85 | DbgkInitialize ( 86 | VOID 87 | ); 88 | 89 | VOID 90 | DbgkCopyProcessDebugPort ( 91 | IN PEPROCESS TargetProcess, 92 | IN PEPROCESS SourceProcess 93 | ); 94 | 95 | NTSTATUS 96 | DbgkOpenProcessDebugPort ( 97 | IN PEPROCESS TargetProcess, 98 | IN KPROCESSOR_MODE PreviousMode, 99 | OUT HANDLE *pHandle 100 | ); 101 | 102 | NTSTATUS 103 | DbgkClearProcessDebugObject ( 104 | IN PEPROCESS Process, 105 | IN PDEBUG_OBJECT SourceDebugObject 106 | ); 107 | 108 | 109 | extern POBJECT_TYPE DbgkDebugObjectType; 110 | 111 | 112 | #endif // _DBGK_ 113 | -------------------------------------------------------------------------------- /base/ntos/inc/dockintf.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | DockIntf.h 12 | 13 | Abstract: 14 | 15 | This header defines the Dock Interface 16 | 17 | --*/ 18 | 19 | DEFINE_GUID(GUID_DOCK_INTERFACE, 20 | 0xa9956ff5L, 0x13da, 0x11d3, 21 | 0x97, 0xdb, 0x00, 0xa0, 0xc9, 0x40, 0x52, 0x2e ); 22 | 23 | #ifndef _DOCKINTF_H_ 24 | #define _DOCKINTF_H_ 25 | 26 | // 27 | // The interface returned consists of the following structure and functions. 28 | // 29 | 30 | #define DOCK_INTRF_STANDARD_VER 1 31 | 32 | typedef enum { 33 | 34 | PDS_UPDATE_DEFAULT = 1, 35 | PDS_UPDATE_ON_REMOVE, 36 | PDS_UPDATE_ON_INTERFACE, 37 | PDS_UPDATE_ON_EJECT 38 | 39 | } PROFILE_DEPARTURE_STYLE; 40 | 41 | typedef ULONG (* PFN_PROFILE_DEPARTURE_SET_MODE)( 42 | IN PVOID Context, 43 | IN PROFILE_DEPARTURE_STYLE Style 44 | ); 45 | 46 | typedef ULONG (* PFN_PROFILE_DEPARTURE_UPDATE)( 47 | IN PVOID Context 48 | ); 49 | 50 | typedef struct { 51 | 52 | struct _INTERFACE; // Unnamed struct 53 | 54 | PFN_PROFILE_DEPARTURE_SET_MODE ProfileDepartureSetMode; 55 | PFN_PROFILE_DEPARTURE_UPDATE ProfileDepartureUpdate; 56 | 57 | } DOCK_INTERFACE, *PDOCK_INTERFACE; 58 | 59 | #endif // _DOCKINTF_H_ 60 | 61 | -------------------------------------------------------------------------------- /base/ntos/inc/exlevels.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | // If you do not agree to the terms, do not use the code. 6 | // 7 | // 8 | 9 | // 10 | // Kernel Mutex Level Numbers (must be globallly assigned within executive) 11 | // The third token in the name is the sub-component name that defines and 12 | // uses the level number. 13 | // 14 | 15 | // 16 | // Used by Vdm for protecting io simulation structures 17 | // 18 | 19 | #define MUTEX_LEVEL_VDM_IO (ULONG)0x00000001 20 | 21 | #define MUTEX_LEVEL_EX_PROFILE (ULONG)0x00000040 22 | 23 | // 24 | // The LANMAN Redirector uses the file system major function, but defines 25 | // it's own mutex levels. We can do this safely because we know that the 26 | // local filesystem will never call the remote filesystem and vice versa. 27 | // 28 | 29 | #define MUTEX_LEVEL_RDR_FILESYS_DATABASE (ULONG)0x10100000 30 | #define MUTEX_LEVEL_RDR_FILESYS_SECURITY (ULONG)0x10100001 31 | 32 | // 33 | // File System levels. 34 | // 35 | 36 | #define MUTEX_LEVEL_FILESYSTEM_RAW_VCB (ULONG)0x11000006 37 | 38 | // 39 | // In the NT STREAMS environment, a mutex is used to serialize open, close 40 | // and Scheduler threads executing in a subsystem-parallelized stack. 41 | // 42 | 43 | #define MUTEX_LEVEL_STREAMS_SUBSYS (ULONG)0x11001001 44 | 45 | // 46 | // Mutex level used by LDT support on x86 47 | // 48 | 49 | #define MUTEX_LEVEL_PS_LDT (ULONG)0x1F000000 50 | -------------------------------------------------------------------------------- /base/ntos/inc/fastsys.inc: -------------------------------------------------------------------------------- 1 | ; /* 2 | ; 3 | ; Copyright (c) Microsoft Corporation. All rights reserved. 4 | ; 5 | ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | ; If you do not agree to the terms, do not use the code. 7 | ; 8 | ; 9 | ; Module Name: 10 | ; 11 | ; fastsys.inc 12 | ; 13 | ; Abstract: 14 | ; 15 | ; This module implements the header for Fast System Calls for Intel 16 | ; x86 family processors. 17 | ; 18 | ;-- 19 | 20 | if 0 ; Begin C only code */ 21 | 22 | // CPUID Feature bit in EDX indicating that fast system calls are supported 23 | 24 | #define KI_FAST_SYSCALL_SUPPORTED 0x0800 25 | 26 | #define MSR_SYSENTER_CS 0x00000174 27 | #define MSR_SYSENTER_ESP 0x00000175 28 | #define MSR_SYSENTER_EIP 0x00000176 29 | 30 | #define MSR_EXT_FEATURE_ENABLE 0xC0000080 31 | #define MSR_SYSCALL_TARGET_ADDR 0xC0000081 32 | 33 | // 34 | // Define bits in the Extended Feature Enable Register (EFER) (MSR). 35 | // 36 | 37 | #define MSR_EFER_SCE 0x1 38 | 39 | /* 40 | endif 41 | ; 42 | ; Begin Assembly definitions 43 | ; 44 | 45 | 46 | iSYSENTER macro 47 | db 0fH,34H 48 | endm ;; SYSENTER 49 | 50 | iSYSEXIT macro 51 | db 0fH,35H 52 | endm ;; SYSEXIT 53 | 54 | iSYSCALL macro 55 | db 0fH,05H 56 | endm ;; SYSCALL 57 | 58 | iSYSRET macro 59 | db 0fH,07H 60 | endm ;; SYSRET 61 | 62 | ; */ 63 | -------------------------------------------------------------------------------- /base/ntos/inc/init.h: -------------------------------------------------------------------------------- 1 | /*++ BUILD Version: 0002 // Increment this if a change has global effects 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | init.h 12 | 13 | Abstract: 14 | 15 | Header file for the INIT subcomponent of NTOS 16 | 17 | --*/ 18 | 19 | #ifndef _INIT_ 20 | #define _INIT_ 21 | 22 | // begin_ntosp 23 | #define INIT_SYSTEMROOT_LINKNAME "\\SystemRoot" 24 | #define INIT_SYSTEMROOT_DLLPATH "\\SystemRoot\\System32" 25 | #define INIT_SYSTEMROOT_BINPATH "\\SystemRoot\\System32" 26 | // end_ntosp 27 | 28 | #define INIT_WINPEMODE_NONE 0x00000000 29 | #define INIT_WINPEMODE_REGULAR 0x00000001 30 | #define INIT_WINPEMODE_INRAM 0x80000000 31 | #define INIT_WINPEMODE_READONLY_MEDIA 0x00000100 32 | #define INIT_WINPEMODE_REMOVABLE_MEDIA 0x00000200 33 | 34 | extern UNICODE_STRING NtSystemRoot; 35 | // begin_ntosp 36 | extern ULONG NtBuildNumber; 37 | // end_ntosp 38 | extern const ULONG NtMajorVersion; 39 | extern const ULONG NtMinorVersion; 40 | extern ULONG CmNtCSDVersion; 41 | extern ULONG CmNtCSDReleaseType; 42 | extern ULONG CmNtSpBuildNumber; 43 | extern UNICODE_STRING CmVersionString; 44 | extern UNICODE_STRING CmCSDVersionString; 45 | 46 | extern const CHAR NtBuildLab[]; 47 | 48 | extern NLSTABLEINFO InitTableInfo; 49 | extern ULONG InitNlsTableSize; 50 | extern PVOID InitNlsTableBase; 51 | extern ULONG InitAnsiCodePageDataOffset; 52 | extern ULONG InitOemCodePageDataOffset; 53 | extern ULONG InitUnicodeCaseTableDataOffset; 54 | extern PVOID InitNlsSectionPointer; 55 | extern BOOLEAN InitSafeModeOptionPresent; 56 | extern ULONG InitSafeBootMode; 57 | 58 | extern BOOLEAN InitIsWinPEMode; 59 | extern ULONG InitWinPEModeType; 60 | 61 | #if defined(_M_IX86) || defined(_M_AMD64) 62 | 63 | VOID 64 | KiSystemStartup( 65 | IN PVOID LoaderBlock 66 | ); 67 | 68 | #else 69 | 70 | VOID 71 | KiSystemStartup( VOID ); 72 | 73 | #endif 74 | 75 | VOID 76 | Phase1Initialization( 77 | IN PVOID Context 78 | ); 79 | 80 | typedef 81 | BOOLEAN 82 | (*PTESTFCN)( VOID ); 83 | 84 | extern PTESTFCN TestFunction; 85 | extern ULONG InitializationPhase; 86 | 87 | #if DBG 88 | extern BOOLEAN ForceNonPagedPool; 89 | extern ULONG MmDebug; 90 | #endif // DBG 91 | 92 | #endif // _INIT_ 93 | -------------------------------------------------------------------------------- /base/ntos/inc/kddll.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | kddll.h 12 | 13 | Abstract: 14 | 15 | Kernel Debugger HW Extension DLL definitions 16 | 17 | --*/ 18 | 19 | #ifndef __KDDLL_H__ 20 | #define __KDDLL_H__ 21 | 22 | 23 | // 24 | // This Kernel Debugger Context structure is used to share 25 | // information between the Kernel Debugger and the Kernel 26 | // Debugger HW extension DLL 27 | // 28 | typedef struct _KD_CONTEXT { 29 | ULONG KdpDefaultRetries; 30 | BOOLEAN KdpControlCPending; 31 | } KD_CONTEXT, *PKD_CONTEXT; 32 | 33 | // 34 | // Kernel Debugger HW Extension DLL exported functions 35 | // 36 | NTSTATUS 37 | KdD0Transition( 38 | VOID 39 | ); 40 | 41 | NTSTATUS 42 | KdD3Transition( 43 | VOID 44 | ); 45 | 46 | NTSTATUS 47 | KdDebuggerInitialize0( 48 | IN PLOADER_PARAMETER_BLOCK LoaderBlock 49 | ); 50 | 51 | NTSTATUS 52 | KdDebuggerInitialize1( 53 | IN PLOADER_PARAMETER_BLOCK LoaderBlock 54 | ); 55 | 56 | ULONG 57 | KdReceivePacket( 58 | IN ULONG PacketType, 59 | OUT PSTRING MessageHeader, 60 | OUT PSTRING MessageData, 61 | OUT PULONG DataLength, 62 | IN OUT PKD_CONTEXT KdContext 63 | ); 64 | 65 | NTSTATUS 66 | KdRestore( 67 | IN BOOLEAN KdSleepTransition 68 | ); 69 | 70 | NTSTATUS 71 | KdSave( 72 | IN BOOLEAN KdSleepTransition 73 | ); 74 | 75 | // 76 | // status Constants for Packet waiting 77 | // 78 | 79 | #define KDP_PACKET_RECEIVED 0 80 | #define KDP_PACKET_TIMEOUT 1 81 | #define KDP_PACKET_RESEND 2 82 | 83 | VOID 84 | KdSendPacket( 85 | IN ULONG PacketType, 86 | IN PSTRING MessageHeader, 87 | IN PSTRING MessageData OPTIONAL, 88 | IN OUT PKD_CONTEXT KdContext 89 | ); 90 | 91 | #endif // __KDDLL_H__ 92 | -------------------------------------------------------------------------------- /base/ntos/inc/ntos.h: -------------------------------------------------------------------------------- 1 | /*++ BUILD Version: 0006 // Increment this if a change has global effects 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | ntos.h 12 | 13 | Abstract: 14 | 15 | Top level include file for the NTOS component. 16 | 17 | --*/ 18 | 19 | #ifndef _NTOS_ 20 | #define _NTOS_ 21 | 22 | #include 23 | #include 24 | #include "ntosdef.h" 25 | #include "exlevels.h" 26 | #include "exboosts.h" 27 | #include "bugcodes.h" 28 | #include "init.h" 29 | #include "v86emul.h" 30 | #include "procpowr.h" 31 | 32 | #if defined(_AMD64_) 33 | #include "amd64.h" 34 | 35 | #elif defined(_X86_) 36 | #include "i386.h" 37 | 38 | #else 39 | #error "no target defined" 40 | #endif // AMD64 41 | 42 | #include "intrlk.h" 43 | #include "arc.h" 44 | #include "ke.h" 45 | #include "kd.h" 46 | #include "ex.h" 47 | #include "ps.h" 48 | #include "se.h" 49 | #include "io.h" 50 | #include "ob.h" 51 | #include "mm.h" 52 | #include "lpc.h" 53 | #include "dbgk.h" 54 | #include "lfs.h" 55 | #include "cache.h" 56 | #include "pnp.h" 57 | #include "hal.h" 58 | #include "kx.h" 59 | #include "cm.h" 60 | #include "po.h" 61 | #include "perf.h" 62 | #include "wmi.h" 63 | #include "verifier.h" 64 | #define _NTDDK_ 65 | 66 | // 67 | // Temp. Until we define a header file for types 68 | // Outside of the kernel these are exported by reference 69 | // 70 | 71 | #ifdef _NTDRIVER_ 72 | extern POBJECT_TYPE *ExEventPairObjectType; 73 | extern POBJECT_TYPE *PsProcessType; 74 | extern POBJECT_TYPE *PsThreadType; 75 | extern POBJECT_TYPE *PsJobType; 76 | extern POBJECT_TYPE *LpcPortObjectType; 77 | extern POBJECT_TYPE *LpcWaitablePortObjectType; 78 | #else 79 | extern POBJECT_TYPE ExEventPairObjectType; 80 | extern POBJECT_TYPE PsProcessType; 81 | extern POBJECT_TYPE PsThreadType; 82 | extern POBJECT_TYPE PsJobType; 83 | extern POBJECT_TYPE LpcPortObjectType; 84 | extern POBJECT_TYPE LpcWaitablePortObjectType; 85 | #endif // _NTDRIVER 86 | 87 | #endif // _NTOS_ 88 | -------------------------------------------------------------------------------- /base/ntos/inc/stktrace.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | stktrace.h 12 | 13 | Abstract: 14 | 15 | This header file defines the format of the stack trace data base 16 | used to track caller backtraces. This is a header file so debugger 17 | extensions can lookup entries in the database remotely. 18 | 19 | --*/ 20 | 21 | #ifndef _STKTRACE_H_ 22 | #define _STKTRACE_H_ 23 | 24 | // 25 | // RTL_STACK_TRACE_ENTRY 26 | // 27 | 28 | typedef struct _RTL_STACK_TRACE_ENTRY { 29 | 30 | struct _RTL_STACK_TRACE_ENTRY * HashChain; 31 | 32 | ULONG TraceCount; 33 | USHORT Index; 34 | USHORT Depth; 35 | 36 | PVOID BackTrace [MAX_STACK_DEPTH]; 37 | 38 | } RTL_STACK_TRACE_ENTRY, *PRTL_STACK_TRACE_ENTRY; 39 | 40 | // 41 | // RTL_STACK_TRACE_DATABASE 42 | // 43 | 44 | typedef struct _STACK_TRACE_DATABASE { 45 | 46 | union { 47 | RTL_CRITICAL_SECTION CriticalSection; 48 | ERESOURCE Resource; 49 | PVOID Lock; // real lock (the other two kept for compatibility) 50 | }; 51 | 52 | PVOID Reserved[3]; // fields no longer used but kept for compatibility 53 | 54 | BOOLEAN PreCommitted; 55 | BOOLEAN DumpInProgress; 56 | 57 | PVOID CommitBase; 58 | PVOID CurrentLowerCommitLimit; 59 | PVOID CurrentUpperCommitLimit; 60 | 61 | PCHAR NextFreeLowerMemory; 62 | PCHAR NextFreeUpperMemory; 63 | 64 | ULONG NumberOfEntriesLookedUp; 65 | ULONG NumberOfEntriesAdded; 66 | 67 | PRTL_STACK_TRACE_ENTRY *EntryIndexArray; // Indexed by [-1 .. -NumberOfEntriesAdded] 68 | 69 | ULONG NumberOfBuckets; 70 | PRTL_STACK_TRACE_ENTRY Buckets [1]; 71 | 72 | } STACK_TRACE_DATABASE, *PSTACK_TRACE_DATABASE; 73 | 74 | PSTACK_TRACE_DATABASE 75 | RtlpAcquireStackTraceDataBase ( 76 | VOID 77 | ); 78 | 79 | VOID 80 | RtlpReleaseStackTraceDataBase ( 81 | VOID 82 | ); 83 | 84 | NTSTATUS 85 | RtlInitializeStackTraceDataBase( 86 | IN PVOID CommitBase, 87 | IN SIZE_T CommitSize, 88 | IN SIZE_T ReserveSize 89 | ); 90 | 91 | #endif // _STKTRACE_H_ 92 | -------------------------------------------------------------------------------- /base/ntos/init/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | 10 | asobjs= 11 | 12 | ccarchobjs= 13 | 14 | ccobjs= \ 15 | $(OBJ)\initos.obj 16 | 17 | nullobj = ntkrnlmp.obj 18 | extraobjs = $(OBJ)\$(nullobj) 19 | localtargets = nullobj 20 | localclean = nullclean 21 | 22 | !include $(ntos)\BUILD\makefile.build 23 | 24 | nullobj: $(extraobjs) 25 | @for %%i in ($**) do xcopy $** $(topobj)\ /Y 26 | 27 | nullclean: 28 | -del $(topobj)\$(nullobj) 29 | 30 | -------------------------------------------------------------------------------- /base/ntos/init/amd64def.src: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | // If you do not agree to the terms, do not use the code. 6 | // 7 | 8 | KeExpandKernelStackAndCallout 9 | 10 | KeInvalidateAllCaches 11 | KeQueryMultiThreadProcessorSet 12 | 13 | KeQueryPrcbAddress 14 | 15 | KeGetCurrentIrql PRIVATE 16 | KeLowerIrql PRIVATE 17 | KfRaiseIrql PRIVATE 18 | KeRaiseIrqlToDpcLevel PRIVATE 19 | 20 | KeAcquireSpinLockRaiseToDpc 21 | KeAcquireSpinLockRaiseToSynch 22 | KeReleaseSpinLock 23 | 24 | KeAcquireQueuedSpinLock 25 | KeAcquireQueuedSpinLockRaiseToSynch 26 | KeReleaseQueuedSpinLock 27 | KeTryToAcquireQueuedSpinLock 28 | KeTryToAcquireQueuedSpinLockRaiseToSynch 29 | 30 | KeAcquireInStackQueuedSpinLockRaiseToSynch 31 | 32 | KeSaveFloatingPointState PRIVATE 33 | KeRestoreFloatingPointState PRIVATE 34 | 35 | InitializeSListHead 36 | ExQueryDepthSList 37 | ExpInterlockedFlushSList 38 | ExpInterlockedPopEntrySList 39 | ExpInterlockedPushEntrySList 40 | 41 | ExAllocateFromPagedLookasideList 42 | ExFreeToPagedLookasideList 43 | 44 | ExQueryDepthSList 45 | 46 | KeSetProfileIrql 47 | 48 | KeLastBranchMSR CONSTANT // data - use pointer for access 49 | MmLockPageableImageSection=MmLockPageableDataSection 50 | MmLockPagableDataSection=MmLockPageableDataSection 51 | MmLockPagableImageSection=MmLockPageableDataSection 52 | MmHighestUserAddress CONSTANT // data - use pointer for access 53 | MmSystemRangeStart CONSTANT // data - use pointer for access 54 | MmUserProbeAddress CONSTANT // data - use pointer for access 55 | 56 | KeGetCurrentThread PRIVATE 57 | 58 | RtlCaptureContext 59 | RtlCopyMemory = memcpy 60 | RtlCopyMemoryNonTemporal 61 | RtlPcToFileHeader 62 | RtlRestoreContext 63 | RtlLookupFunctionEntry 64 | RtlVirtualUnwind 65 | RtlUnwindEx 66 | __C_specific_handler 67 | _local_unwind 68 | 69 | __chkstk 70 | __misaligned_access 71 | _setjmp 72 | _setjmpex 73 | longjmp 74 | 75 | KiCpuId 76 | 77 | memcmp PRIVATE 78 | memcpy PRIVATE 79 | memmove PRIVATE 80 | memset PRIVATE 81 | 82 | 83 | -------------------------------------------------------------------------------- /base/ntos/init/ntkrnlmp.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | // If you do not agree to the terms, do not use the code. 6 | // 7 | // 8 | 9 | #include "ntoskrnl.c" 10 | 11 | -------------------------------------------------------------------------------- /base/ntos/init/ntoskrnl.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | ntoskrnl.c 12 | 13 | Abstract: 14 | 15 | Null program for the INIT subcomponent of the NTOS project 16 | 17 | --*/ 18 | 19 | -------------------------------------------------------------------------------- /base/ntos/io/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | 10 | asobjs= 11 | 12 | ccarchobjs= 13 | 14 | ccobjs= \ 15 | $(OBJ)\ioguid.obj 16 | 17 | 18 | !include $(ntos)\BUILD\makefile.build 19 | 20 | -------------------------------------------------------------------------------- /base/ntos/io/PNPMGR/pplastgood.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | PpLastGood.h 12 | 13 | Abstract: 14 | 15 | This header exposed various routines needed for last known good processing 16 | in the IO subsystem. 17 | 18 | --*/ 19 | 20 | VOID 21 | PpLastGoodDoBootProcessing( 22 | VOID 23 | ); 24 | 25 | 26 | -------------------------------------------------------------------------------- /base/ntos/io/PNPMGR/ppvutil.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | ppvutil.h 12 | 13 | Abstract: 14 | 15 | This header exposes various utilities required to do driver verification. 16 | 17 | --*/ 18 | 19 | #ifndef _PPVUTIL_H_ 20 | #define _PPVUTIL_H_ 21 | 22 | typedef enum { 23 | 24 | PPVERROR_DUPLICATE_PDO_ENUMERATED = 0, 25 | PPVERROR_MISHANDLED_TARGET_DEVICE_RELATIONS, 26 | PPVERROR_DDI_REQUIRES_PDO 27 | 28 | } PPVFAILURE_TYPE; 29 | 30 | typedef enum { 31 | 32 | PPVREMOVAL_SHOULD_DELETE = 0, 33 | PPVREMOVAL_SHOULDNT_DELETE, 34 | PPVREMOVAL_MAY_DEFER_DELETION 35 | 36 | } PPVREMOVAL_OPTION; 37 | 38 | VOID 39 | FASTCALL 40 | PpvUtilInit( 41 | VOID 42 | ); 43 | 44 | NTSTATUS 45 | FASTCALL 46 | PpvUtilCallAddDevice( 47 | IN PDEVICE_OBJECT PhysicalDeviceObject, 48 | IN PDRIVER_OBJECT DriverObject, 49 | IN PDRIVER_ADD_DEVICE AddDeviceFunction, 50 | IN VF_DEVOBJ_TYPE DevObjType 51 | ); 52 | 53 | VOID 54 | FASTCALL 55 | PpvUtilTestStartedPdoStack( 56 | IN PDEVICE_OBJECT DeviceObject 57 | ); 58 | 59 | PPVREMOVAL_OPTION 60 | FASTCALL 61 | PpvUtilGetDevnodeRemovalOption( 62 | IN PDEVICE_OBJECT PhysicalDeviceObject 63 | ); 64 | 65 | VOID 66 | FASTCALL 67 | PpvUtilFailDriver( 68 | IN PPVFAILURE_TYPE FailureType, 69 | IN PVOID CulpritAddress, 70 | IN PDEVICE_OBJECT DeviceObject OPTIONAL, 71 | IN PVOID ExtraneousInfo OPTIONAL 72 | ); 73 | 74 | BOOLEAN 75 | FASTCALL 76 | PpvUtilIsHardwareBeingVerified( 77 | IN PDEVICE_OBJECT PhysicalDeviceObject 78 | ); 79 | 80 | #endif // _PPVUTIL_H_ 81 | 82 | -------------------------------------------------------------------------------- /base/ntos/io/ioguid.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | // If you do not agree to the terms, do not use the code. 6 | // 7 | // 8 | 9 | #include 10 | #undef DECLSPEC_SELECTANY 11 | #define DECLSPEC_SELECTANY 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | -------------------------------------------------------------------------------- /base/ntos/io/iomgr/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = iomgr 9 | specialcflags = -I..\.. 10 | 11 | asobjs= 12 | 13 | ccarchobjs= 14 | 15 | ccobjs= \ 16 | $(OBJ)\cancelapi.obj \ 17 | $(OBJ)\complete.obj \ 18 | $(OBJ)\create.obj \ 19 | $(OBJ)\devctrl.obj \ 20 | $(OBJ)\dev2dos.obj \ 21 | $(OBJ)\dir.obj \ 22 | $(OBJ)\errorlog.obj \ 23 | $(OBJ)\fsctrl.obj \ 24 | $(OBJ)\internal.obj \ 25 | $(OBJ)\iodata.obj \ 26 | $(OBJ)\ioinit.obj \ 27 | $(OBJ)\iosubs.obj \ 28 | $(OBJ)\loadunld.obj \ 29 | $(OBJ)\lock.obj \ 30 | $(OBJ)\misc.obj \ 31 | $(OBJ)\objsup.obj \ 32 | $(OBJ)\open.obj \ 33 | $(OBJ)\parse.obj \ 34 | $(OBJ)\qsea.obj \ 35 | $(OBJ)\qsfs.obj \ 36 | $(OBJ)\qsinfo.obj \ 37 | $(OBJ)\qsquota.obj \ 38 | $(OBJ)\read.obj \ 39 | $(OBJ)\write.obj 40 | 41 | !include $(ntos)\BUILD\makefile.build 42 | 43 | -------------------------------------------------------------------------------- /base/ntos/io/iomgr/open.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | open.c 12 | 13 | Abstract: 14 | 15 | This module contains the code to implement the NtOpenFile system 16 | service. 17 | 18 | --*/ 19 | 20 | #include "iomgr.h" 21 | 22 | #pragma alloc_text(PAGE, NtOpenFile) 23 | 24 | NTSTATUS 25 | NtOpenFile( 26 | __out PHANDLE FileHandle, 27 | __in ACCESS_MASK DesiredAccess, 28 | __in POBJECT_ATTRIBUTES ObjectAttributes, 29 | __out PIO_STATUS_BLOCK IoStatusBlock, 30 | __in ULONG ShareAccess, 31 | __in ULONG OpenOptions 32 | ) 33 | 34 | /*++ 35 | 36 | Routine Description: 37 | 38 | This service opens a file or a device. It is used to establish a file 39 | handle to the open device/file that can then be used in subsequent 40 | operations to perform I/O operations on. 41 | 42 | Arguments: 43 | 44 | FileHandle - A pointer to a variable to receive the handle to the open file. 45 | 46 | DesiredAccess - Supplies the types of access that the caller would like to 47 | the file. 48 | 49 | ObjectAttributes - Supplies the attributes to be used for file object (name, 50 | SECURITY_DESCRIPTOR, etc.) 51 | 52 | IoStatusBlock - Specifies the address of the caller's I/O status block. 53 | 54 | ShareAccess - Supplies the types of share access that the caller would like 55 | to the file. 56 | 57 | OpenOptions - Caller options for how to perform the open. 58 | 59 | Return Value: 60 | 61 | The function value is the final completion status of the open/create 62 | operation. 63 | 64 | --*/ 65 | 66 | { 67 | // 68 | // Simply invoke the common I/O file creation routine to perform the work. 69 | // 70 | 71 | PAGED_CODE(); 72 | 73 | return IoCreateFile( FileHandle, 74 | DesiredAccess, 75 | ObjectAttributes, 76 | IoStatusBlock, 77 | (PLARGE_INTEGER) NULL, 78 | 0L, 79 | ShareAccess, 80 | FILE_OPEN, 81 | OpenOptions, 82 | (PVOID) NULL, 83 | 0L, 84 | CreateFileTypeNone, 85 | (PVOID) NULL, 86 | 0 ); 87 | } 88 | 89 | -------------------------------------------------------------------------------- /base/ntos/io/iop.h: -------------------------------------------------------------------------------- 1 | /*++ BUILD Version: 0002 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | iop.h 12 | 13 | Abstract: 14 | 15 | This module contains the private structure definitions and APIs used by 16 | the NT I/O system. 17 | 18 | --*/ 19 | 20 | #ifndef _IOP_ 21 | #define _IOP_ 22 | 23 | #include "ntos.h" 24 | #include "iopcmn.h" 25 | #include "ioverifier.h" 26 | #include "zwapi.h" 27 | #include "stdio.h" 28 | #include "stdlib.h" 29 | #include "string.h" 30 | 31 | #endif // _IOP_ 32 | 33 | -------------------------------------------------------------------------------- /base/ntos/io/sessnirp.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | sessnirp.h 12 | 13 | Abstract: 14 | 15 | --*/ 16 | 17 | 18 | #ifndef _SESSIONIRP_H_ 19 | #define _SESSIONIRP_H_ 20 | 21 | PIOV_SESSION_DATA 22 | FASTCALL 23 | IovpSessionDataCreate( 24 | IN PDEVICE_OBJECT DeviceObject, 25 | IN OUT PIOV_REQUEST_PACKET *IovPacketPointer, 26 | OUT PBOOLEAN SurrogateSpawned 27 | ); 28 | 29 | VOID 30 | FASTCALL 31 | IovpSessionDataAdvance( 32 | IN PDEVICE_OBJECT DeviceObject, 33 | IN PIOV_SESSION_DATA IovSessionData, 34 | IN OUT PIOV_REQUEST_PACKET *IovPacketPointer, 35 | OUT PBOOLEAN SurrogateSpawned 36 | ); 37 | 38 | VOID 39 | FASTCALL 40 | IovpSessionDataReference( 41 | IN PIOV_SESSION_DATA IovSessionData 42 | ); 43 | 44 | VOID 45 | FASTCALL 46 | IovpSessionDataDereference( 47 | IN PIOV_SESSION_DATA IovSessionData 48 | ); 49 | 50 | VOID 51 | FASTCALL 52 | IovpSessionDataClose( 53 | IN PIOV_SESSION_DATA IovSessionData 54 | ); 55 | 56 | VOID 57 | IovpSessionDataDeterminePolicy( 58 | IN PIOV_REQUEST_PACKET IovRequestPacket, 59 | IN PDEVICE_OBJECT DeviceObject, 60 | OUT PBOOLEAN Trackable, 61 | OUT PBOOLEAN UseSurrogateIrp 62 | ); 63 | 64 | BOOLEAN 65 | FASTCALL 66 | IovpSessionDataAttachSurrogate( 67 | IN OUT PIOV_REQUEST_PACKET *IovPacketPointer, 68 | IN PIOV_SESSION_DATA IovSessionData 69 | ); 70 | 71 | VOID 72 | FASTCALL 73 | IovpSessionDataFinalizeSurrogate( 74 | IN PIOV_SESSION_DATA IovSessionData, 75 | IN OUT PIOV_REQUEST_PACKET IovPacket, 76 | IN PIRP Irp 77 | ); 78 | 79 | VOID 80 | FASTCALL 81 | IovpSessionDataBufferIO( 82 | IN OUT PIOV_REQUEST_PACKET IovSurrogatePacket, 83 | IN PIRP SurrogateIrp 84 | ); 85 | 86 | VOID 87 | FASTCALL 88 | IovpSessionDataUnbufferIO( 89 | IN OUT PIOV_REQUEST_PACKET IovSurrogatePacket, 90 | IN PIRP SurrogateIrp 91 | ); 92 | 93 | #endif // _SESSIONIRP_H_ 94 | 95 | -------------------------------------------------------------------------------- /base/ntos/ke/amd64/cpuid.asm: -------------------------------------------------------------------------------- 1 | title "Processor Type and Stepping Detection" 2 | ;++ 3 | ; 4 | ; Copyright (c) Microsoft Corporation. All rights reserved. 5 | ; 6 | ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 7 | ; If you do not agree to the terms, do not use the code. 8 | ; 9 | ; 10 | ; Module Name: 11 | ; 12 | ; cpu.asm 13 | ; 14 | ; Abstract: 15 | ; 16 | ; This module implements the code necessary to determine cpu information. 17 | ; 18 | ;-- 19 | 20 | include ksamd64.inc 21 | 22 | altentry KiCpuIdFault 23 | 24 | ;++ 25 | ; 26 | ; VOID 27 | ; KiCpuId ( 28 | ; ULONG Function, 29 | ; ULONG Index, 30 | ; PCPU_INFO CpuInfo 31 | ; ); 32 | ; 33 | ; Routine Description: 34 | ; 35 | ; Executes the cpuid instruction and returns the resultant register 36 | ; values. 37 | ; 38 | ; Arguments: 39 | ; 40 | ; ecx - Supplies the cpuid function value. 41 | ; 42 | ; edx - Supplies a index of cache descriptor. 43 | ; 44 | ; r8 - Supplies the address a cpu information structure. 45 | ; 46 | ; Return Value: 47 | ; 48 | ; The return values from the cpuid instruction are stored in the specified 49 | ; cpu information structure. 50 | ; 51 | ;-- 52 | 53 | NESTED_ENTRY KiCpuId, _TEXT$00 54 | 55 | push_reg rbx ; save nonvolatile register 56 | 57 | END_PROLOGUE 58 | 59 | mov eax, ecx ; set cpuid function 60 | mov ecx, edx ; set index (only used by function 4) 61 | cpuid ; get cpu information 62 | 63 | ALTERNATE_ENTRY KiCpuIdFault 64 | 65 | mov CpuEax[r8], eax ; save cpu information in structure 66 | mov CpuEbx[r8], ebx ; 67 | mov CpuEcx[r8], ecx ; 68 | mov CpuEdx[r8], edx ; 69 | pop rbx ; restore nonvolatile register 70 | ret ; return 71 | 72 | NESTED_END KiCpuId, _TEXT$00 73 | 74 | end 75 | 76 | -------------------------------------------------------------------------------- /base/ntos/ke/amd64/flush.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | flush.c 12 | 13 | Abstract: 14 | 15 | This module implements AMD64 machine dependent kernel functions to 16 | flush the data and instruction caches on all processors. 17 | 18 | --*/ 19 | 20 | #include "ki.h" 21 | 22 | BOOLEAN 23 | KeInvalidateAllCaches ( 24 | VOID 25 | ) 26 | 27 | /*++ 28 | 29 | Routine Description: 30 | 31 | This function writes back and invalidates the cache on all processors 32 | in the host configuration. 33 | 34 | Arguments: 35 | 36 | None. 37 | 38 | Return Value: 39 | 40 | TRUE is returned as the function value. 41 | 42 | --*/ 43 | 44 | { 45 | 46 | 47 | #if !defined(NT_UP) 48 | 49 | PKAFFINITY Barrier; 50 | KIRQL OldIrql; 51 | PKPRCB Prcb; 52 | KAFFINITY TargetProcessors; 53 | 54 | // 55 | // Raise IRQL to SYNCH level. 56 | // 57 | // Send request to target processors, if any, invalidate the current cache, 58 | // and wait for the IPI request barrier. 59 | // 60 | 61 | OldIrql = KeRaiseIrqlToSynchLevel(); 62 | Prcb = KeGetCurrentPrcb(); 63 | TargetProcessors = KeActiveProcessors & ~Prcb->SetMember; 64 | if (TargetProcessors != 0) { 65 | Barrier = KiIpiSendRequest(TargetProcessors, 0, 0, IPI_INVALIDATE_ALL); 66 | WritebackInvalidate(); 67 | KiIpiWaitForRequestBarrier(Barrier); 68 | 69 | } else { 70 | WritebackInvalidate(); 71 | } 72 | 73 | // 74 | // Lower IRQL to its previous value. 75 | // 76 | 77 | KeLowerIrql(OldIrql); 78 | 79 | #else 80 | 81 | WritebackInvalidate(); 82 | 83 | #endif 84 | 85 | return TRUE; 86 | } 87 | 88 | -------------------------------------------------------------------------------- /base/ntos/ke/amd64/intipi.asm: -------------------------------------------------------------------------------- 1 | title "Interprocessor Interrupts" 2 | ;++ 3 | ; 4 | ; Copyright (c) Microsoft Corporation. All rights reserved. 5 | ; 6 | ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 7 | ; If you do not agree to the terms, do not use the code. 8 | ; 9 | ; 10 | ; Module Name: 11 | ; 12 | ; intipi.asm 13 | ; 14 | ; Abstract: 15 | ; 16 | ; This module implements the code necessary to process interprocessor 17 | ; interrupt requests. 18 | ; 19 | ;-- 20 | 21 | include ksamd64.inc 22 | 23 | extern ExpInterlockedPopEntrySListEnd:proc 24 | extern ExpInterlockedPopEntrySListResume:proc 25 | extern KiCheckForSListAddress:proc 26 | extern KiDpcInterruptBypass:proc 27 | extern KiInitiateUserApc:proc 28 | extern KiIdleSummary:qword 29 | extern KiIpiProcessRequests:proc 30 | extern KiRestoreDebugRegisterState:proc 31 | extern KiSaveDebugRegisterState:proc 32 | extern __imp_HalRequestSoftwareInterrupt:qword 33 | 34 | subttl "Interprocess Interrupt Service Routine" 35 | ;++ 36 | ; 37 | ; VOID 38 | ; KiIpiInterrupt ( 39 | ; VOID 40 | ; ) 41 | ; 42 | ; Routine Description: 43 | ; 44 | ; This routine is entered as the result of an interprocessor interrupt at 45 | ; IPI level. Its function is to process all interprocessor requests. 46 | ; 47 | ; Arguments: 48 | ; 49 | ; None. 50 | ; 51 | ; Return Value: 52 | ; 53 | ; None. 54 | ; 55 | ;-- 56 | 57 | NESTED_ENTRY KiIpiInterrupt, _TEXT$00 58 | 59 | .pushframe ; mark machine frame 60 | 61 | alloc_stack 8 ; allocate dummy vector 62 | push_reg rbp ; save nonvolatile register 63 | 64 | GENERATE_INTERRUPT_FRAME <>, ; generate interrupt frame 65 | 66 | mov ecx, IPI_LEVEL ; set new IRQL level 67 | 68 | ENTER_INTERRUPT ; raise IRQL and enable interrupts 69 | 70 | ; 71 | ; Process all interprocessor requests. 72 | ; 73 | 74 | call KiIpiProcessRequests ; process interprocessor requests 75 | 76 | EXIT_INTERRUPT <>, <>, ; do EOI, lower IRQL and restore state 77 | 78 | NESTED_END KiIpiInterrupt, _TEXT$00 79 | 80 | end 81 | 82 | -------------------------------------------------------------------------------- /base/ntos/ke/amd64/pat.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | pat.c 12 | 13 | Abstract: 14 | 15 | This module initializes the page attributes table. 16 | 17 | --*/ 18 | 19 | #include "ki.h" 20 | 21 | #pragma alloc_text(PAGELK, KiSetPageAttributesTable) 22 | 23 | VOID 24 | KiSetPageAttributesTable ( 25 | VOID 26 | ) 27 | 28 | /*++ 29 | 30 | Routine Description: 31 | 32 | This function initializes the page attribute table for the current 33 | processor. The page attribute table is set up to provide write back, 34 | write combining, uncacheable/stronly order, and uncacheable/weakly 35 | ordered. 36 | 37 | PAT_Entry PAT Index PCD PWT Memory Type 38 | 39 | 0 0 0 0 WB 40 | 1 0 0 1 WC * 41 | 2 0 1 0 WEAK_UC 42 | 3 0 1 1 STRONG_UC 43 | 4 1 0 0 WB 44 | 5 1 0 1 WC * 45 | 6 1 1 0 WEAK_UC 46 | 7 1 1 1 STRONG_UC 47 | 48 | N.B. The caller must have the PAGELK code locked before calling this 49 | function. 50 | 51 | Arguments: 52 | 53 | None. 54 | 55 | Return Value: 56 | 57 | None. 58 | 59 | --*/ 60 | 61 | { 62 | 63 | PAT_ATTRIBUTES Attributes; 64 | 65 | // 66 | // Initialize the page attribute table. 67 | // 68 | 69 | Attributes.hw.Pat[0] = PAT_TYPE_WB; 70 | Attributes.hw.Pat[1] = PAT_TYPE_USWC; 71 | Attributes.hw.Pat[2] = PAT_TYPE_WEAK_UC; 72 | Attributes.hw.Pat[3] = PAT_TYPE_STRONG_UC; 73 | Attributes.hw.Pat[4] = PAT_TYPE_WB; 74 | Attributes.hw.Pat[5] = PAT_TYPE_USWC; 75 | Attributes.hw.Pat[6] = PAT_TYPE_WEAK_UC; 76 | Attributes.hw.Pat[7] = PAT_TYPE_STRONG_UC; 77 | 78 | // 79 | // Invalidate the cache on the current processor, write the page attributes 80 | // table, and invalidate the cache a second time. 81 | // 82 | 83 | WritebackInvalidate(); 84 | WriteMSR(MSR_PAT, Attributes.QuadPart); 85 | WritebackInvalidate(); 86 | return; 87 | } 88 | 89 | -------------------------------------------------------------------------------- /base/ntos/ke/amd64/table.stb: -------------------------------------------------------------------------------- 1 | 4 ; This is the number of in register arguments 2 | ;++ 3 | ; 4 | ; Copyright (c) Microsoft Corporation. All rights reserved. 5 | ; 6 | ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 7 | ; If you do not agree to the terms, do not use the code. 8 | ; 9 | ; 10 | ; Module Name: 11 | ; 12 | ; systable.asm 13 | ; 14 | ; Abstract: 15 | ; 16 | ; This module implements the system service dispatch table. 17 | ; 18 | ;-- 19 | 20 | include ksamd64.inc 21 | 22 | TABLE_ERROR macro t 23 | .err ; Maximum number of in-memory system service arguments exceeded. 24 | endm 25 | 26 | TABLE_BEGIN1 macro t 27 | title t 28 | endm 29 | 30 | TABLE_BEGIN2 macro t 31 | _TEXT$00 segment page 'code' 32 | endm 33 | 34 | TABLE_BEGIN3 macro t 35 | endm 36 | 37 | TABLE_BEGIN4 macro t 38 | public KiServiceTable 39 | KiServiceTable label qword 40 | endm 41 | 42 | TABLE_BEGIN5 macro t 43 | endm 44 | 45 | TABLE_BEGIN6 macro t 46 | endm 47 | 48 | TABLE_BEGIN7 macro t 49 | endm 50 | 51 | TABLE_BEGIN8 macro t 52 | endm 53 | 54 | 55 | TABLE_ENTRY macro l,bias,numargs 56 | .erre numargs le 14 57 | extrn Nt&l:proc 58 | dq offset Nt&l+numargs 59 | endm 60 | 61 | TABLE_END macro n 62 | public KiServiceLimit 63 | KiServiceLimit label dword 64 | dd n + 1 65 | endm 66 | 67 | ARGTBL_BEGIN macro 68 | endm 69 | 70 | ARGTBL_ENTRY macro e0, e1, e2, e3, e4, e5, e6, e7 71 | endm 72 | 73 | ARGTBL_END macro 74 | _TEXT$00 ends 75 | end 76 | endm 77 | 78 | TABLE_BEGIN1 <"System Service Dispatch Table"> 79 | TABLE_BEGIN2 <"System Service Dispatch Table"> 80 | TABLE_BEGIN3 <"System Service Dispatch Table"> 81 | TABLE_BEGIN4 <"System Service Dispatch Table"> 82 | TABLE_BEGIN5 <"System Service Dispatch Table"> 83 | TABLE_BEGIN6 <"System Service Dispatch Table"> 84 | TABLE_BEGIN7 <"System Service Dispatch Table"> 85 | TABLE_BEGIN8 <"System Service Dispatch Table"> 86 | 87 | -------------------------------------------------------------------------------- /base/ntos/ke/hifreqlk.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | hifreqlk.c 12 | 13 | Abstract: 14 | 15 | This module contains the declaration and allocation of high frequency 16 | spin locks. 17 | 18 | --*/ 19 | 20 | #include "ki.h" 21 | 22 | #if !defined(NT_UP) 23 | 24 | #pragma data_seg("SPINLOCK") 25 | 26 | #endif 27 | 28 | // 29 | // Cache manager spin locks. 30 | // 31 | 32 | ALIGNED_SPINLOCK CcMasterSpinLock = 0; 33 | ALIGNED_SPINLOCK CcWorkQueueSpinLock = 0; 34 | ALIGNED_SPINLOCK CcVacbSpinLock = 0; 35 | ALIGNED_SPINLOCK CcDeferredWriteSpinLock = 0; 36 | ALIGNED_SPINLOCK CcDebugTraceLock = 0; 37 | ALIGNED_SPINLOCK CcBcbSpinLock = 0; 38 | 39 | // 40 | // Execute spin locks. 41 | // 42 | 43 | ALIGNED_SPINLOCK NonPagedPoolLock = 0; 44 | ALIGNED_SPINLOCK ExpResourceSpinLock = 0; 45 | 46 | // 47 | // I/O spin locks. 48 | // 49 | 50 | ALIGNED_SPINLOCK IopCompletionLock = 0; 51 | ALIGNED_SPINLOCK IopCancelSpinLock = 0; 52 | ALIGNED_SPINLOCK IopVpbSpinLock = 0; 53 | ALIGNED_SPINLOCK IopDatabaseLock = 0; 54 | ALIGNED_SPINLOCK IopErrorLogLock = 0; 55 | ALIGNED_SPINLOCK IopTimerLock = 0; 56 | ALIGNED_SPINLOCK IoStatisticsLock = 0; 57 | 58 | // 59 | // Kernel debugger spin locks. 60 | // 61 | 62 | ALIGNED_SPINLOCK KdpDebuggerLock = 0; 63 | 64 | // 65 | // Kernel spin locks. 66 | // 67 | 68 | ALIGNED_SPINLOCK KiDispatcherLock = 0; 69 | ALIGNED_SPINLOCK KiFreezeExecutionLock = 0; 70 | ALIGNED_SPINLOCK KiFreezeLockBackup = 0; 71 | ALIGNED_SPINLOCK KiProcessListLock = 0; 72 | ALIGNED_SPINLOCK KiProfileLock = 0; 73 | ALIGNED_SPINLOCK KiReverseStallIpiLock = 0; 74 | ALIGNED_SPINLOCK_STRUCT KiTimerTableLock[LOCK_QUEUE_TIMER_TABLE_LOCKS] = {0}; 75 | 76 | #if defined(_AMD64_) 77 | 78 | ALIGNED_SPINLOCK KiNMILock = 0; 79 | 80 | #endif 81 | 82 | // 83 | // Memory management spin locks. 84 | // 85 | 86 | ALIGNED_SPINLOCK MmPfnLock = 0; 87 | ALIGNED_SPINLOCK MmSystemSpaceLock = 0; 88 | ALIGNED_SPINLOCK MmNonPagedPoolLock = 0; 89 | 90 | // 91 | // Process structure spin locks. 92 | // 93 | 94 | ALIGNED_SPINLOCK PsLoadedModuleSpinLock = 0; 95 | 96 | // 97 | // Ntfs spin locks. 98 | // 99 | 100 | ALIGNED_SPINLOCK NtfsStructLock = 0; 101 | 102 | // 103 | // Afd spin locks. 104 | // 105 | 106 | ALIGNED_SPINLOCK AfdWorkQueueSpinLock = 0; 107 | 108 | // 109 | // Dummy lock for alignment. 110 | // 111 | 112 | ALIGNED_SPINLOCK KiDummyLock = 0; 113 | 114 | #pragma data_seg() 115 | 116 | // 117 | // Hardware trigger. 118 | // 119 | 120 | volatile LONG KiHardwareTrigger = 0; 121 | 122 | -------------------------------------------------------------------------------- /base/ntos/ke/i386/cpu.inc: -------------------------------------------------------------------------------- 1 | ;++ 2 | ; 3 | ; Copyright (c) Microsoft Corporation. All rights reserved. 4 | ; 5 | ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | ; If you do not agree to the terms, do not use the code. 7 | ; 8 | ; 9 | ; Module Name: 10 | ; 11 | ; cpu.inc 12 | ; 13 | ; Abstract: 14 | ; 15 | ; This module contains the assembly structures and definitions 16 | ; for INTEL 80x86 CPU specifiec information. This include file 17 | ; is mainly used by CPU.ASM to determine CPU type and stepping 18 | ; number. 19 | ; 20 | ;-- 21 | 22 | ; 23 | ; The following equates define the control bits of CR0 register 24 | ; 25 | 26 | CR0_AM equ 40000h 27 | CR0_ET equ 00010h 28 | 29 | ; 30 | ; The following equates define the control bits of EFALGS register 31 | ; 32 | 33 | EFLAGS_AC equ 40000h 34 | EFLAGS_VM equ 20000h 35 | EFLAGS_RF equ 10000h 36 | EFLAGS_NF equ 4000h 37 | EFLAGS_IOPL equ 3000h 38 | EFLAGS_IF equ 200h 39 | EFLAGS_TF equ 100h 40 | EFLAGS_ID equ 200000h 41 | 42 | ; 43 | ; Define the iret frame 44 | ; 45 | 46 | IretFrame struc 47 | 48 | IretEip dd 0 49 | IretCs dd 0 50 | IretEFlags dd 0 51 | 52 | IretFrame ends 53 | 54 | ; 55 | ; Misc. definitions 56 | ; 57 | 58 | ADDRESS_OVERRIDE equ 67h 59 | OPERAND_OVERRIDE equ 66h 60 | 61 | -------------------------------------------------------------------------------- /base/ntos/ke/i386/i386init.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | i386init.c 12 | 13 | Abstract: 14 | 15 | This module contains code to manipulate i386 hardware structures used 16 | only by the kernel. 17 | 18 | --*/ 19 | 20 | #include "ki.h" 21 | 22 | VOID 23 | KiInitializeMachineType ( 24 | VOID 25 | ); 26 | 27 | #pragma alloc_text(INIT,KiInitializeMachineType) 28 | 29 | KIRQL KiProfileIrql = PROFILE_LEVEL; 30 | ULONG KeI386MachineType = 0; 31 | BOOLEAN KeI386NpxPresent; 32 | BOOLEAN KeI386FxsrPresent; 33 | ULONG KeI386ForceNpxEmulation; 34 | ULONG KiMXCsrMask; 35 | ULONG KeI386CpuType; 36 | ULONG KeI386CpuStep; 37 | PVOID Ki387RoundModeTable; // R3 emulators RoundingMode vector table 38 | ULONG KiBootFeatureBits; 39 | 40 | ULONG KiInBiosCall = FALSE; 41 | ULONG FlagState = 0; // bios calls shouldn't automatically turn interrupts back on. 42 | 43 | KTRAP_FRAME KiBiosFrame; 44 | 45 | #if DBG 46 | UCHAR MsgDpcTrashedEsp[] = "\n*** DPC routine %lx trashed ESP\n"; 47 | UCHAR MsgDpcTimeout[] = "\n*** DPC routine > 1 sec --- This is not a break in KeUpdateSystemTime\n"; 48 | UCHAR MsgISRTimeout[] = "\n*** ISR at %lx took over .5 second\n"; 49 | 50 | ULONG KiISRTimeout = 55; 51 | #endif 52 | UCHAR MsgISROverflow[] = "\n*** ISR at %lx appears to have an interrupt storm\n"; 53 | USHORT KiISROverflow = 30000; 54 | 55 | VOID 56 | KiInitializeMachineType ( 57 | VOID 58 | ) 59 | 60 | /*++ 61 | 62 | Routine Description: 63 | 64 | This function initializes machine type, i.e. MCA, ABIOS, ISA 65 | or EISA. 66 | N.B. This is a temporary routine. machine type: 67 | Byte 0 - Machine Type, ISA, EISA or MCA 68 | Byte 1 - CPU type, i386 or i486 69 | Byte 2 - Cpu Step, A or B ... etc. 70 | Highest bit indicates if NPX is present. 71 | 72 | Arguments: 73 | 74 | None. 75 | 76 | Return Value: 77 | 78 | None. 79 | 80 | --*/ 81 | 82 | { 83 | KeI386MachineType = KeLoaderBlock->u.I386.MachineType & 0x000ff; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /base/ntos/ke/i386/int.asm: -------------------------------------------------------------------------------- 1 | title "Trap Processing" 2 | ;++ 3 | ; 4 | ; Copyright (c) Microsoft Corporation. All rights reserved. 5 | ; 6 | ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 7 | ; If you do not agree to the terms, do not use the code. 8 | ; 9 | ; 10 | ; Module Name: 11 | ; 12 | ; int.asm 13 | ; 14 | ; Abstract: 15 | ; 16 | ; This module implements the code necessary to field and process i386 17 | ; interrupt. 18 | ; 19 | ;-- 20 | 21 | .386p 22 | .xlist 23 | include ks386.inc 24 | include i386\kimacro.inc 25 | include callconv.inc 26 | .list 27 | 28 | ; 29 | ; Interrupt flag bit maks for EFLAGS 30 | ; 31 | 32 | EFLAGS_IF equ 200H 33 | EFLAGS_SHIFT equ 9 34 | 35 | _TEXT SEGMENT DWORD PUBLIC 'CODE' 36 | ASSUME DS:FLAT, ES:FLAT, SS:FLAT, FS:NOTHING, GS:NOTHING 37 | 38 | ; NOTE This routine is never actually called on standard x86 hardware, 39 | ; because passive level doesn't actually exist. It's here to 40 | ; fill out the portable skeleton. 41 | ; 42 | ; The following code is called when a passive release occurs and there is 43 | ; no interrupt to process. 44 | ; 45 | 46 | cPublicProc _KiPassiveRelease ,0 47 | stdRET _KiPassiveRelease ; cReturn 48 | stdENDP _KiPassiveRelease 49 | 50 | 51 | page ,132 52 | subttl "Disable Processor Interrupts" 53 | ;++ 54 | ; 55 | ; BOOLEAN 56 | ; KeDisableInterrupts( 57 | ; VOID 58 | ; ) 59 | ; 60 | ; Routine Description: 61 | ; 62 | ; This routine disables interrupts at the processor level. It does not 63 | ; edit the PICS or adjust IRQL, it is for use in the debugger only. 64 | ; 65 | ; Arguments: 66 | ; 67 | ; None 68 | ; 69 | ; Return Value: 70 | ; 71 | ; (eax) = !0 if interrupts were on, 0 if they were off 72 | ; 73 | ;-- 74 | 75 | cPublicProc _KeDisableInterrupts ,0 76 | cPublicFpo 0, 0 77 | pushfd 78 | pop eax 79 | and eax,EFLAGS_IF ; (eax) = the interrupt bit 80 | shr eax,EFLAGS_SHIFT ; low bit of (eax) == interrupt bit 81 | cli 82 | stdRET _KeDisableInterrupts 83 | 84 | stdENDP _KeDisableInterrupts 85 | 86 | _TEXT ends 87 | end 88 | 89 | -------------------------------------------------------------------------------- /base/ntos/ke/i386/mi.inc: -------------------------------------------------------------------------------- 1 | ;++ 2 | ; 3 | ; Copyright (c) Microsoft Corporation. All rights reserved. 4 | ; 5 | ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | ; If you do not agree to the terms, do not use the code. 7 | ; 8 | ; 9 | ; Module Name: 10 | ; 11 | ; MI.INC 12 | ; 13 | ; Abstract: 14 | ; 15 | ; This module contains equates for x86 machine instructions 16 | ; 17 | ; Revision History: 18 | ; 19 | ; This information used to reside in Trap.asm, but is now needed in 20 | ; multiple source files. 21 | ; 22 | ;-- 23 | 24 | 25 | MAX_INSTRUCTION_LENGTH EQU 15 26 | MAX_INSTRUCTION_PREFIX_LENGTH EQU 4 27 | MI_LOCK_PREFIX EQU 0F0H 28 | MI_ADDR_PREFIX EQU 067H 29 | MI_TWO_BYTE EQU 0FH 30 | MI_HLT EQU 0F4H 31 | MI_LTR_LLDT EQU 0 32 | MI_LGDT_LIDT_LMSW EQU 01H 33 | MI_MODRM_MASK EQU 38H 34 | MI_LLDT_MASK EQU 10h 35 | MI_LTR_MASK EQU 18H 36 | MI_LGDT_MASK EQU 10H 37 | MI_LIDT_MASK EQU 18H 38 | MI_LMSW_MASK EQU 30H 39 | MI_SPECIAL_MOV_MASK EQU 20H 40 | MI_REP_INS_OUTS EQU 0F3H 41 | MI_MIN_INS_OUTS EQU 06CH 42 | MI_MAX_INS_OUTS EQU 06FH 43 | 44 | MI_CLTS EQU 006H 45 | MI_INVD EQU 008H 46 | MI_WBINVD EQU 009H 47 | 48 | MI_MOV_FROM_CR EQU 020H 49 | MI_MOV_FROM_DR EQU 021H 50 | MI_MOV_TO_CR EQU 022H 51 | MI_MOV_TO_DR EQU 023H 52 | MI_MOV_FROM_TR EQU 024H 53 | MI_MOV_TO_TR EQU 026H 54 | 55 | MI_WRMSR EQU 030H 56 | MI_RDTSC EQU 031H 57 | MI_RDMSR EQU 032H 58 | MI_RDPMC EQU 033H 59 | MI_SYSEXIT EQU 035H 60 | 61 | -------------------------------------------------------------------------------- /base/ntos/ke/i386/pat.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | pat.h 12 | 13 | Abstract: 14 | 15 | This module contains the i386 specific Page Attribute 16 | Table (PAT) register hardware definitions. 17 | 18 | --*/ 19 | 20 | // 21 | // PAT MSR architecture definitions 22 | // 23 | 24 | // 25 | // PAT model specific register 26 | // 27 | 28 | #define PAT_MSR 0x277 29 | 30 | // 31 | // PAT memory attributes 32 | // 33 | 34 | #define PAT_TYPE_STRONG_UC 0 // corresponds to PPro PCD=1,PWT=1 35 | #define PAT_TYPE_USWC 1 36 | #define PAT_TYPE_WT 4 37 | #define PAT_TYPE_WP 5 38 | #define PAT_TYPE_WB 6 39 | #define PAT_TYPE_WEAK_UC 7 // corresponds to PPro PCD=1,PWT=0 40 | #define PAT_TYPE_MAX 8 41 | 42 | #include "pshpack1.h" 43 | 44 | typedef union _PAT { 45 | struct { 46 | UCHAR Pat[8]; 47 | } hw; 48 | ULONGLONG QuadPart; 49 | } PAT, *PPAT; 50 | 51 | #include "poppack.h" 52 | 53 | -------------------------------------------------------------------------------- /base/ntos/ke/i386/table.stb: -------------------------------------------------------------------------------- 1 | 0 ; This is the number of in register arguments 2 | ;++ 3 | ; 4 | ; Copyright (c) Microsoft Corporation. All rights reserved. 5 | ; 6 | ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 7 | ; If you do not agree to the terms, do not use the code. 8 | ; 9 | ; 10 | ; Module Name: 11 | ; 12 | ; systable.asm 13 | ; 14 | ; Abstract: 15 | ; 16 | ; This module implements the system service dispatch table. 17 | ; 18 | ;-- 19 | 20 | ; 21 | ; To add a system service simply add the name of the service to the below 22 | ; table. If the system service has arguments, then immediately 23 | ; follow the name of the serice with a comma and following that the number 24 | ; of bytes of in memory arguments, e.g. CreateObject,40. 25 | ; 26 | 27 | ;ifdef i386 28 | 29 | .386p 30 | include callconv.inc 31 | 32 | TABLE_ERROR macro t 33 | .err ; Maximum number of in-memory system service arguments exceeded. 34 | endm 35 | 36 | TABLE_BEGIN1 macro t 37 | TITLE t 38 | endm 39 | TABLE_BEGIN2 macro t 40 | _TEXT SEGMENT DWORD PUBLIC 'DATA' 41 | ASSUME DS:FLAT 42 | endm 43 | TABLE_BEGIN3 macro t 44 | align 4 45 | endm 46 | TABLE_BEGIN4 macro t 47 | public _KiServiceTable 48 | _KiServiceTable label dword 49 | endm 50 | TABLE_BEGIN5 macro t 51 | endm 52 | TABLE_BEGIN6 macro t 53 | endm 54 | TABLE_BEGIN7 macro t 55 | endm 56 | TABLE_BEGIN8 macro t 57 | endm 58 | 59 | TABLE_ENTRY macro l,bias,numargs 60 | Local Bytes 61 | 62 | Bytes = numargs*4 63 | 64 | EXTRNP _Nt&l,&numargs 65 | ComposeInst
,_Nt,l,<@>,%(Bytes) 66 | endm 67 | 68 | TABLE_END macro n 69 | public _KiServiceLimit 70 | _KiServiceLimit dd n+1 71 | endm 72 | 73 | ARGTBL_BEGIN macro 74 | public _KiArgumentTable 75 | _KiArgumentTable label dword 76 | endm 77 | 78 | ARGTBL_ENTRY macro e0,e1,e2,e3,e4,e5,e6,e7 79 | db e0,e1,e2,e3,e4,e5,e6,e7 80 | endm 81 | 82 | ARGTBL_END macro 83 | _TEXT ENDS 84 | end 85 | endm 86 | 87 | ;endif 88 | 89 | TABLE_BEGIN1 <"System Service Dispatch Table"> 90 | TABLE_BEGIN2 <"System Service Dispatch Table"> 91 | TABLE_BEGIN3 <"System Service Dispatch Table"> 92 | TABLE_BEGIN4 <"System Service Dispatch Table"> 93 | TABLE_BEGIN5 <"System Service Dispatch Table"> 94 | TABLE_BEGIN6 <"System Service Dispatch Table"> 95 | TABLE_BEGIN7 <"System Service Dispatch Table"> 96 | TABLE_BEGIN8 <"System Service Dispatch Table"> 97 | 98 | -------------------------------------------------------------------------------- /base/ntos/ke/i386/threadbg.asm: -------------------------------------------------------------------------------- 1 | title "Thread Startup" 2 | ;++ 3 | ; 4 | ; Copyright (c) Microsoft Corporation. All rights reserved. 5 | ; 6 | ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 7 | ; If you do not agree to the terms, do not use the code. 8 | ; 9 | ; 10 | ; Module Name: 11 | ; 12 | ; threadbg.asm 13 | ; 14 | ; Abstract: 15 | ; 16 | ; This module implements the code necessary to startup a thread in kernel 17 | ; mode. 18 | ; 19 | ; Environment: 20 | ; 21 | ; IRQL APC_LEVEL. 22 | ; 23 | ;-- 24 | 25 | .386p 26 | .xlist 27 | include ks386.inc 28 | include i386\kimacro.inc 29 | include callconv.inc 30 | include irqli386.inc 31 | .list 32 | 33 | EXTRNP _KeBugCheck,1 34 | extrn _KiServiceExit2:PROC 35 | 36 | page ,132 37 | subttl "Thread Startup" 38 | 39 | _TEXT$00 SEGMENT DWORD PUBLIC 'CODE' 40 | ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING 41 | 42 | ;++ 43 | ; 44 | ; Routine Description: 45 | ; 46 | ; This routine is called at thread startup. Its function is to call the 47 | ; initial thread procedure. If control returns from the initial thread 48 | ; procedure and a user mode context was established when the thread 49 | ; was initialized, then the user mode context is restored and control 50 | ; is transferred to user mode. Otherwise a bugcheck will occur. 51 | ; 52 | ; 53 | ; Arguments: 54 | ; 55 | ; (TOS) = SystemRoutine - address of initial system routine. 56 | ; (TOS+4) = StartRoutine - Initial thread routine. 57 | ; (TOS+8) = StartContext - Context parm for initial thread routine. 58 | ; (TOS+12) = UserContextFlag - 0 if no user context, !0 if there is one 59 | ; (TOS+16) = Base of KTrapFrame if and only if there's a user context. 60 | ; 61 | ; Return Value: 62 | ; 63 | ; None. 64 | ; 65 | ;-- 66 | 67 | cPublicProc _KiThreadStartup ,1 68 | 69 | xor ebx,ebx ; clear registers 70 | xor esi,esi ; 71 | xor edi,edi ; 72 | xor ebp,ebp ; 73 | LowerIrql APC_LEVEL ; KeLowerIrql(APC_LEVEL) 74 | 75 | pop eax ; (eax)->SystemRoutine 76 | call eax ; SystemRoutine(StartRoutine, StartContext) 77 | 78 | pop ecx ; (ecx) = UserContextFlag 79 | or ecx, ecx 80 | jz short kits10 ; No user context, go bugcheck 81 | 82 | mov ebp,esp ; (bp) -> TrapFrame holding UserContext 83 | 84 | jmp _KiServiceExit2 85 | 86 | kits10: stdCall _KeBugCheck, 87 | 88 | stdENDP _KiThreadStartup 89 | 90 | _TEXT$00 ends 91 | end 92 | 93 | -------------------------------------------------------------------------------- /base/ntos/ke/interobj.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | interobj.c 12 | 13 | Abstract: 14 | 15 | This module implements functions to acquire and release the spin lock 16 | associated with an interrupt object. 17 | 18 | --*/ 19 | 20 | #include "ki.h" 21 | 22 | KIRQL 23 | KeAcquireInterruptSpinLock ( 24 | __inout PKINTERRUPT Interrupt 25 | ) 26 | 27 | /*++ 28 | 29 | Routine Description: 30 | 31 | This function raises the IRQL to the interrupt synchronization level 32 | and acquires the actual spin lock associated with an interrupt object. 33 | 34 | Arguments: 35 | 36 | Interrupt - Supplies a pointer to a control object of type interrupt. 37 | 38 | Return Value: 39 | 40 | The previous IRQL is returned as the function value. 41 | 42 | --*/ 43 | 44 | { 45 | 46 | KIRQL OldIrql; 47 | 48 | // 49 | // Raise IRQL to interrupt synchronization level and acquire the actual 50 | // spin lock associated with the interrupt object. 51 | // 52 | 53 | KeRaiseIrql(Interrupt->SynchronizeIrql, &OldIrql); 54 | KeAcquireSpinLockAtDpcLevel(Interrupt->ActualLock); 55 | return OldIrql; 56 | } 57 | 58 | VOID 59 | KeReleaseInterruptSpinLock ( 60 | __inout PKINTERRUPT Interrupt, 61 | __in KIRQL OldIrql 62 | ) 63 | 64 | /*++ 65 | 66 | Routine Description: 67 | 68 | This function releases the actual spin lock associated with an interrupt 69 | object and lowers the IRQL to its previous value. 70 | 71 | Arguments: 72 | 73 | Interrupt - Supplies a pointer to a control object of type interrupt. 74 | 75 | OldIrql - Supplies the previous IRQL value. 76 | 77 | Return Value: 78 | 79 | None. 80 | 81 | --*/ 82 | 83 | { 84 | 85 | // 86 | // Release the actual spin lock associated with the interrupt object 87 | // and lower IRQL to its previous value. 88 | // 89 | 90 | KeReleaseSpinLockFromDpcLevel(Interrupt->ActualLock); 91 | KeLowerIrql(OldIrql); 92 | return; 93 | } 94 | 95 | -------------------------------------------------------------------------------- /base/ntos/lpc/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | 10 | !if "$(targ)" == "i386" 11 | asobjs= \ 12 | $(OBJ)\lpcmove.obj 13 | ccarchobjs= 14 | !else 15 | asobjs= 16 | ccarchobjs= 17 | !endif 18 | 19 | ccobjs= \ 20 | $(OBJ)\lpcinit.obj \ 21 | $(OBJ)\lpccreat.obj \ 22 | $(OBJ)\lpclistn.obj \ 23 | $(OBJ)\lpcconn.obj \ 24 | $(OBJ)\lpccompl.obj \ 25 | $(OBJ)\lpcsend.obj \ 26 | $(OBJ)\lpcrecv.obj \ 27 | $(OBJ)\lpcreply.obj \ 28 | $(OBJ)\lpcquery.obj \ 29 | $(OBJ)\lpcqueue.obj \ 30 | $(OBJ)\lpcclose.obj \ 31 | $(OBJ)\lpcpriv.obj 32 | 33 | 34 | !include $(ntos)\BUILD\makefile.build 35 | 36 | -------------------------------------------------------------------------------- /base/ntos/lpc/lpclistn.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | lpclistn.c 12 | 13 | Abstract: 14 | 15 | Local Inter-Process Communication (LPC) connection system services. 16 | 17 | --*/ 18 | 19 | #include "lpcp.h" 20 | 21 | #ifdef ALLOC_PRAGMA 22 | #pragma alloc_text(PAGE,NtListenPort) 23 | #endif 24 | 25 | 26 | NTSTATUS 27 | NtListenPort ( 28 | __in HANDLE PortHandle, 29 | __out PPORT_MESSAGE ConnectionRequest 30 | ) 31 | 32 | /*++ 33 | 34 | Routine Description: 35 | 36 | A server thread can listen for connection requests from client threads 37 | using the NtReplyWaitReceivePort service and looking for an 38 | LPC_CONNECTION_REQUEST message type. 39 | 40 | This call will loop, calling the NtReplyWaitReceivePort service, and 41 | return when it sees a message of type LPC_CONNECTION_REQUEST 42 | 43 | Arguments: 44 | 45 | PortHandle - Specifies the connection port to listen for connection 46 | requests to. 47 | 48 | ConnectionRequest - Pointer to a structure that describes the 49 | connection request the client is making: 50 | 51 | Return Value: 52 | 53 | NTSTATUS - An appropriate status value 54 | 55 | --*/ 56 | 57 | { 58 | NTSTATUS Status; 59 | 60 | PAGED_CODE(); 61 | 62 | // 63 | // Keep on looping until we get a connection request on the lpc port 64 | // 65 | 66 | while (TRUE) { 67 | 68 | Status = NtReplyWaitReceivePort( PortHandle, 69 | NULL, 70 | NULL, 71 | ConnectionRequest ); 72 | 73 | // 74 | // We'll return from this procedure if ever we get back non success 75 | // or the message is a connection request. We still need to protect 76 | // the testing of ConnectionRequest because it is a user supplied 77 | // buffer. 78 | // 79 | 80 | try { 81 | 82 | if ((Status != STATUS_SUCCESS) || 83 | ((ConnectionRequest->u2.s2.Type & ~LPC_KERNELMODE_MESSAGE) == LPC_CONNECTION_REQUEST)) { 84 | 85 | break; 86 | } 87 | 88 | } except( EXCEPTION_EXECUTE_HANDLER ) { 89 | 90 | Status = GetExceptionCode(); 91 | 92 | break; 93 | } 94 | } 95 | 96 | // 97 | // And return to our caller 98 | // 99 | 100 | return Status; 101 | } 102 | 103 | -------------------------------------------------------------------------------- /base/ntos/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | subargs=/$(MAKEFLAGS) ntos=$(MAKEDIR) pub=$(MAKEDIR)\..\..\public 9 | 10 | !if defined(x86) && !defined(amd64) 11 | subargs = $(subargs) targ=i386 topobj=$(MAKEDIR)\BUILD\obji386 12 | targ = i386 13 | lmachine = x86 14 | 15 | !else if !defined(x86) && defined(amd64) 16 | subargs = $(subargs) targ=amd64 topobj=$(MAKEDIR)\BUILD\objamd64 17 | targ = amd64 18 | lmachine = amd64 19 | 20 | !else 21 | !ERROR Usage: nmake (x86=|amd64=) [clean] 22 | !endif 23 | 24 | OBJ = obj$(targ) 25 | 26 | modules = rtl config ex ob se mm ke ps io\iomgr io cache lpc dbgk raw fstub fsrtl wmi perf init 27 | buildtargets = $(modules: =.build ).build 28 | cleantargets = $(modules: =.clean ).clean 29 | 30 | default: checktoolpath $(buildtargets) kernel 31 | 32 | checktoolpath: 33 | checktoolarch $(lmachine) 34 | 35 | kernel: 36 | cd $(MAKEDIR)\BUILD 37 | @$(MAKE) $(subargs) module=BUILD 38 | @cd $(MAKEDIR) 39 | 40 | $(buildtargets): 41 | cd $(MAKEDIR)\$(@R)\BUILD 42 | @$(MAKE) $(subargs) module=$(@R) 43 | @cd $(MAKEDIR) 44 | 45 | clean: $(cleantargets) clean0 46 | 47 | clean0: 48 | -del $(MAKEDIR)\BUILD\$(OBJ)\** $(MAKEDIR)\BUILD\EXE\** /Q 49 | 50 | $(cleantargets): 51 | cd $(MAKEDIR)\$(@R)\BUILD 52 | @$(MAKE) $(subargs) module=$(@R) clean 53 | @cd $(MAKEDIR) 54 | 55 | #################### DEBUG 56 | kernelexe: 57 | cd $(MAKEDIR)\BUILD 58 | @$(MAKE) $(subargs) module=BUILD kernelexe 59 | 60 | -------------------------------------------------------------------------------- /base/ntos/mm/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | specialcflags = -I..\..\ke 10 | 11 | !if "$(targ)" == "i386" 12 | asobjs= \ 13 | $(OBJ)\pae.obj 14 | ccarchobjs= \ 15 | $(OBJ)\init386.obj \ 16 | $(OBJ)\data386.obj \ 17 | $(OBJ)\procpae.obj \ 18 | $(OBJ)\procx86.obj \ 19 | $(OBJ)\paesup.obj \ 20 | $(OBJ)\setmodfy.obj 21 | !else 22 | asobjs= 23 | ccarchobjs= \ 24 | $(OBJ)\dataamd.obj \ 25 | $(OBJ)\initamd.obj 26 | 27 | !endif 28 | 29 | ccobjs= \ 30 | $(OBJ)\acceschk.obj \ 31 | $(OBJ)\addrsup.obj \ 32 | $(OBJ)\allocpag.obj \ 33 | $(OBJ)\allocvm.obj \ 34 | $(OBJ)\buildmdl.obj \ 35 | $(OBJ)\creasect.obj \ 36 | $(OBJ)\deleteva.obj \ 37 | $(OBJ)\dmpaddr.obj \ 38 | $(OBJ)\extsect.obj \ 39 | $(OBJ)\flushbuf.obj \ 40 | $(OBJ)\flushsec.obj \ 41 | $(OBJ)\forksup.obj \ 42 | $(OBJ)\freevm.obj \ 43 | $(OBJ)\hypermap.obj \ 44 | $(OBJ)\iosup.obj \ 45 | $(OBJ)\lockvm.obj \ 46 | $(OBJ)\mapcache.obj \ 47 | $(OBJ)\mapview.obj \ 48 | $(OBJ)\miglobal.obj \ 49 | $(OBJ)\mmfault.obj \ 50 | $(OBJ)\mminit.obj \ 51 | $(OBJ)\mmsup.obj \ 52 | $(OBJ)\mmquota.obj \ 53 | $(OBJ)\modwrite.obj \ 54 | $(OBJ)\pagfault.obj \ 55 | $(OBJ)\pfndec.obj \ 56 | $(OBJ)\pfnlist.obj \ 57 | $(OBJ)\physical.obj \ 58 | $(OBJ)\procsup.obj \ 59 | $(OBJ)\protect.obj \ 60 | $(OBJ)\querysec.obj \ 61 | $(OBJ)\queryvm.obj \ 62 | $(OBJ)\readwrt.obj \ 63 | $(OBJ)\sectsup.obj \ 64 | $(OBJ)\session.obj \ 65 | $(OBJ)\sessload.obj \ 66 | $(OBJ)\shutdown.obj \ 67 | $(OBJ)\sysload.obj \ 68 | $(OBJ)\sysptes.obj \ 69 | $(OBJ)\umapview.obj \ 70 | $(OBJ)\vadtree.obj \ 71 | $(OBJ)\wslist.obj \ 72 | $(OBJ)\wsmanage.obj \ 73 | $(OBJ)\wstree.obj \ 74 | $(OBJ)\wrtfault.obj \ 75 | $(OBJ)\wrtwatch.obj \ 76 | $(OBJ)\zeropage.obj 77 | 78 | !include $(ntos)\BUILD\makefile.build 79 | 80 | -------------------------------------------------------------------------------- /base/ntos/mm/i386/pae.asm: -------------------------------------------------------------------------------- 1 | title "pae" 2 | ;++ 3 | ; 4 | ; Copyright (c) Microsoft Corporation. All rights reserved. 5 | ; 6 | ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 7 | ; If you do not agree to the terms, do not use the code. 8 | ; 9 | ; 10 | ; Module Name: 11 | ; 12 | ; pae.asm 13 | ; 14 | ; Abstract: 15 | ; 16 | ; This module implements the code necessary to swap PTEs on a PAE system. 17 | ; 18 | ;-- 19 | 20 | .586p 21 | .xlist 22 | include callconv.inc 23 | FPOFRAME macro a, b 24 | .FPO ( a, b, 0, 0, 0, 0 ) 25 | endm 26 | .list 27 | 28 | _TEXT$00 SEGMENT PARA PUBLIC 'CODE' 29 | ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING 30 | 31 | page , 132 32 | subttl "Interlocked Swap PTE" 33 | 34 | ;++ 35 | ; 36 | ; ULONGLONG 37 | ; InterlockedExchangePte ( 38 | ; IN OUT PMMPTE Destination, 39 | ; IN ULONGLONG Exchange 40 | ; ) 41 | ; 42 | ; Routine Description: 43 | ; 44 | ; This function performs an interlocked swap of a PTE. This is only needed 45 | ; for the PAE architecture where the PTE width is larger than the register 46 | ; width. 47 | ; 48 | ; Both PTEs must be valid or a careful write would have been done instead. 49 | ; 50 | ; Arguments: 51 | ; 52 | ; PtePointer - Address of PTE to update with new value. 53 | ; 54 | ; NewPteContents - The new value to put in the PTE. 55 | ; 56 | ; Return Value: 57 | ; 58 | ; The old PTE contents (highpart in edx, lowpart in eax). 59 | ; 60 | ;-- 61 | 62 | cPublicProc _InterlockedExchangePte ,3 63 | 64 | push ebx 65 | push esi 66 | 67 | mov ebx, [esp] + 16 ; ebx = NewPteContents lowpart 68 | mov ecx, [esp] + 20 ; ecx = NewPteContents highpart 69 | 70 | mov esi, [esp] + 12 ; esi = PtePointer 71 | 72 | mov edx, [esi] + 4 73 | mov eax, [esi] ; edx:eax = OldPteContents 74 | 75 | swapagain: 76 | 77 | ; 78 | ; cmpxchg loads edx:eax with the updated current contents of the 79 | ; target quadword in the event of success (or failure). 80 | ; 81 | 82 | lock cmpxchg8b qword ptr [esi] ; compare and exchange 83 | 84 | jnz short swapagain ; if z clear, exchange failed 85 | 86 | pop esi 87 | pop ebx 88 | 89 | stdRET _InterlockedExchangePte 90 | stdENDP _InterlockedExchangePte 91 | 92 | _TEXT$00 ends 93 | 94 | end 95 | 96 | -------------------------------------------------------------------------------- /base/ntos/mm/i386/setmodfy.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | setmodfy.c 12 | 13 | Abstract: 14 | 15 | This module contains the setting modify bit routine for memory management. 16 | x86 specific. 17 | 18 | --*/ 19 | 20 | #include "mi.h" 21 | 22 | #if defined (_X86PAE_) 23 | extern PMMPTE MmSystemCacheWorkingSetListPte; 24 | #endif 25 | 26 | 27 | ULONG 28 | FASTCALL 29 | MiDetermineUserGlobalPteMask ( 30 | IN PMMPTE Pte 31 | ) 32 | 33 | /*++ 34 | 35 | Routine Description: 36 | 37 | Builds a mask to OR with the PTE frame field. 38 | This mask has the valid and access bits set and 39 | has the global and owner bits set based on the 40 | address of the PTE. 41 | 42 | ******************* NOTE ********************************************* 43 | THIS ROUTINE DOES NOT CHECK FOR PDEs WHICH NEED TO BE 44 | SET GLOBAL AS IT ASSUMES PDEs FOR SYSTEM SPACE ARE 45 | PROPERLY SET AT INITIALIZATION TIME! 46 | 47 | Arguments: 48 | 49 | Pte - Supplies a pointer to the PTE in which to fill. 50 | 51 | Return Value: 52 | 53 | Mask to OR into the frame to make a valid PTE. 54 | 55 | Environment: 56 | 57 | Kernel mode, 386 specific. 58 | 59 | --*/ 60 | 61 | 62 | { 63 | MMPTE Mask; 64 | 65 | Mask.u.Long = 0; 66 | Mask.u.Hard.Valid = 1; 67 | Mask.u.Hard.Accessed = 1; 68 | 69 | #if defined (_X86PAE_) 70 | ASSERT (MmSystemCacheWorkingSetListPte != NULL); 71 | #endif 72 | 73 | if (Pte <= MiHighestUserPte) { 74 | Mask.u.Hard.Owner = 1; 75 | } 76 | else if ((Pte < MiGetPteAddress (PTE_BASE)) || 77 | #if defined (_X86PAE_) 78 | (Pte >= MmSystemCacheWorkingSetListPte) 79 | #else 80 | (Pte >= MiGetPteAddress (MM_SYSTEM_CACHE_WORKING_SET)) 81 | #endif 82 | ) { 83 | 84 | if (MI_IS_SESSION_PTE (Pte) == FALSE) { 85 | #if defined (_X86PAE_) 86 | if ((Pte < (PMMPTE)PDE_BASE) || (Pte > (PMMPTE)PDE_TOP)) 87 | #endif 88 | Mask.u.Long |= MmPteGlobal.u.Long; 89 | } 90 | } 91 | else if ((Pte >= MiGetPdeAddress (NULL)) && (Pte <= MiHighestUserPde)) { 92 | Mask.u.Hard.Owner = 1; 93 | } 94 | 95 | // 96 | // Since the valid, accessed, global and owner bits are always in the 97 | // low dword of the PTE, returning a ULONG is ok. 98 | // 99 | 100 | return (ULONG)Mask.u.Long; 101 | } 102 | 103 | -------------------------------------------------------------------------------- /base/ntos/ob/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | 10 | asobjs= 11 | 12 | ccarchobjs= 13 | 14 | ccobjs= \ 15 | $(OBJ)\obinit.obj \ 16 | $(OBJ)\obcreate.obj \ 17 | $(OBJ)\obhandle.obj \ 18 | $(OBJ)\obinsert.obj \ 19 | $(OBJ)\obref.obj \ 20 | $(OBJ)\obse.obj \ 21 | $(OBJ)\obtype.obj \ 22 | $(OBJ)\obdir.obj \ 23 | $(OBJ)\obdevmap.obj \ 24 | $(OBJ)\oblink.obj \ 25 | $(OBJ)\obclose.obj \ 26 | $(OBJ)\obquery.obj \ 27 | $(OBJ)\obsdata.obj \ 28 | $(OBJ)\obwait.obj \ 29 | $(OBJ)\fastref.obj 30 | 31 | !include $(ntos)\BUILD\makefile.build 32 | 33 | -------------------------------------------------------------------------------- /base/ntos/ob/obvutil.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | obvutil.h 12 | 13 | Abstract: 14 | 15 | This header exposes various utilities required to do driver verification. 16 | 17 | --*/ 18 | 19 | LONG_PTR 20 | ObvUtilStartObRefMonitoring( 21 | IN PDEVICE_OBJECT DeviceObject 22 | ); 23 | 24 | LONG_PTR 25 | ObvUtilStopObRefMonitoring( 26 | IN PDEVICE_OBJECT DeviceObject, 27 | IN LONG StartSkew 28 | ); 29 | 30 | -------------------------------------------------------------------------------- /base/ntos/perf/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | 10 | asobjs= 11 | 12 | ccarchobjs= 13 | 14 | ccobjs= \ 15 | $(OBJ)\hooks.obj \ 16 | $(OBJ)\logging.obj \ 17 | $(OBJ)\perfdata.obj \ 18 | $(OBJ)\perfsup.obj 19 | 20 | !include $(ntos)\BUILD\makefile.build 21 | 22 | -------------------------------------------------------------------------------- /base/ntos/perf/perfdata.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | perfdata.c 12 | 13 | Abstract: 14 | 15 | This module contains the global read/write data for the perf subsystem 16 | 17 | --*/ 18 | 19 | #include "perfp.h" 20 | 21 | PERFINFO_GROUPMASK PerfGlobalGroupMask; 22 | PERFINFO_GROUPMASK *PPerfGlobalGroupMask; 23 | const PERFINFO_HOOK_HANDLE PerfNullHookHandle = { NULL, NULL }; 24 | 25 | // 26 | // Profiling 27 | // 28 | 29 | KPROFILE PerfInfoProfileObject; 30 | KPROFILE_SOURCE PerfInfoProfileSourceActive = ProfileMaximum; // Set to invalid source 31 | KPROFILE_SOURCE PerfInfoProfileSourceRequested = ProfileTime; 32 | KPROFILE_SOURCE PerfInfoProfileInterval = 10000; // 1ms in 100ns ticks 33 | BOOLEAN PerfInfoSampledProfileCaching; 34 | LONG PerfInfoSampledProfileFlushInProgress; 35 | PERFINFO_SAMPLED_PROFILE_CACHE PerfProfileCache; 36 | 37 | -------------------------------------------------------------------------------- /base/ntos/perf/perfp.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | perfp.h 12 | 13 | Abstract: 14 | 15 | This module contains the definitions of data structures and macros 16 | used by kernel-mode logging in the performance data event log. 17 | 18 | --*/ 19 | 20 | #ifndef _PERFP_ 21 | #define _PERFP_ 22 | 23 | #if _MSC_VER >= 1000 24 | #pragma once 25 | #endif 26 | 27 | #pragma warning(error:4100) // Unreferenced formal parameter 28 | #pragma warning(error:4101) // Unreferenced local variable 29 | #pragma warning(error:4705) // Statement has no effect 30 | 31 | #pragma warning(disable:4214) // bit field types other than int 32 | #pragma warning(disable:4201) // nameless struct/union 33 | #pragma warning(disable:4127) // condition expression is constant 34 | #pragma warning(disable:4115) // named type definition in parentheses 35 | 36 | #include "ntos.h" 37 | 38 | // 39 | // Profiling structures 40 | // 41 | extern KPROFILE PerfInfoProfileObject; 42 | extern PERFINFO_SAMPLED_PROFILE_CACHE PerfProfileCache; 43 | extern BOOLEAN PerfInfoSampledProfileCaching; 44 | extern KPROFILE_SOURCE PerfInfoProfileSourceActive; 45 | extern KPROFILE_SOURCE PerfInfoProfileSourceRequested; 46 | extern KPROFILE_SOURCE PerfInfoProfileInterval; 47 | extern LONG PerfInfoSampledProfileFlushInProgress; 48 | extern PERFINFO_GROUPMASK PerfGlobalGroupMask; 49 | 50 | 51 | #define PERFPOOLTAG 'freP' 52 | 53 | NTSTATUS 54 | PerfInfoReserveBytesWMI( 55 | PPERFINFO_HOOK_HANDLE Hook, 56 | USHORT HookId, 57 | ULONG BytesToReserve 58 | ); 59 | 60 | NTSTATUS 61 | PerfInfoFileNameRunDown( 62 | ); 63 | 64 | NTSTATUS 65 | PerfInfoProcessRunDown( 66 | ); 67 | 68 | NTSTATUS 69 | PerfInfoSysModuleRunDown( 70 | ); 71 | 72 | VOID 73 | PerfInfoProfileInit( 74 | ); 75 | 76 | VOID 77 | PerfInfoProfileUninit( 78 | ); 79 | 80 | VOID 81 | PerfSetLogging ( 82 | PVOID MaskAddress 83 | ); 84 | 85 | #endif // _PERFP_ 86 | 87 | -------------------------------------------------------------------------------- /base/ntos/ps/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | specialcflags = -I..\..\ke 10 | 11 | !if "$(targ)" == "i386" 12 | asobjs= 13 | 14 | ccarchobjs= \ 15 | $(OBJ)\psctx386.obj \ 16 | $(OBJ)\psldt.obj \ 17 | $(OBJ)\psvdm.obj 18 | !else 19 | asobjs= \ 20 | $(OBJ)\psctxwrap.obj 21 | 22 | ccarchobjs= \ 23 | $(OBJ)\psctxamd64.obj \ 24 | $(OBJ)\psldt.obj \ 25 | $(OBJ)\psvdm.obj 26 | !endif 27 | 28 | ccobjs= \ 29 | $(OBJ)\psspnd.obj \ 30 | $(OBJ)\pscid.obj \ 31 | $(OBJ)\psimpers.obj \ 32 | $(OBJ)\psinit.obj \ 33 | $(OBJ)\psdelete.obj \ 34 | $(OBJ)\psquery.obj \ 35 | $(OBJ)\create.obj \ 36 | $(OBJ)\kulookup.obj \ 37 | $(OBJ)\psquota.obj \ 38 | $(OBJ)\psctx.obj \ 39 | $(OBJ)\psopen.obj \ 40 | $(OBJ)\psjob.obj \ 41 | $(OBJ)\security.obj \ 42 | $(OBJ)\pshelper.obj \ 43 | $(OBJ)\psenum.obj 44 | 45 | !include $(ntos)\BUILD\makefile.build 46 | 47 | -------------------------------------------------------------------------------- /base/ntos/ps/amd64/psvdm.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | psvdm.c 12 | 13 | Abstract: 14 | 15 | This module contains mips stubs for the Io port handler support 16 | 17 | --*/ 18 | 19 | #include "psp.h" 20 | 21 | 22 | NTSTATUS 23 | PspSetProcessIoHandlers( 24 | IN PEPROCESS Process, 25 | IN PVOID IoHandlerInformation, 26 | IN ULONG IoHandlerLength 27 | ) 28 | /*++ 29 | 30 | Routine Description: 31 | 32 | This routine returns STATUS_NOT_IMPLEMENTED 33 | 34 | Arguments: 35 | 36 | Process -- Supplies a pointer to the process for which Io port handlers 37 | are to be installed 38 | IoHandlerInformation -- Supplies a pointer to the information about the 39 | io port handlers 40 | IoHandlerLength -- Supplies the length of the IoHandlerInformation 41 | structure. 42 | 43 | Return Value: 44 | 45 | Returns STATUS_NOT_IMPLEMENTED 46 | 47 | --*/ 48 | { 49 | UNREFERENCED_PARAMETER(Process); 50 | UNREFERENCED_PARAMETER(IoHandlerInformation); 51 | UNREFERENCED_PARAMETER(IoHandlerLength); 52 | return STATUS_NOT_IMPLEMENTED; 53 | } 54 | 55 | VOID 56 | PspDeleteVdmObjects( 57 | IN PEPROCESS Process 58 | ) 59 | /*++ 60 | 61 | Routine Description: 62 | 63 | This is a stub for the Vdm Objects delete routine 64 | 65 | Arguments: 66 | 67 | Process -- Supplies a pointer to the process 68 | 69 | Return Value: 70 | 71 | None 72 | --*/ 73 | { 74 | UNREFERENCED_PARAMETER(Process); 75 | } 76 | 77 | -------------------------------------------------------------------------------- /base/ntos/raw/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | 10 | asobjs= 11 | 12 | ccarchobjs= 13 | 14 | ccobjs= \ 15 | $(OBJ)\Cleanup.obj \ 16 | $(OBJ)\Close.obj \ 17 | $(OBJ)\Create.obj \ 18 | $(OBJ)\FileInfo.obj \ 19 | $(OBJ)\FsCtrl.obj \ 20 | $(OBJ)\StrucSup.obj \ 21 | $(OBJ)\RawDisp.obj \ 22 | $(OBJ)\RawInit.obj \ 23 | $(OBJ)\ReadWrit.obj \ 24 | $(OBJ)\VolInfo.obj 25 | 26 | !include $(ntos)\BUILD\makefile.build 27 | 28 | -------------------------------------------------------------------------------- /base/ntos/raw/cleanup.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | Cleanup.c 12 | 13 | Abstract: 14 | 15 | This module implements the File Cleanup routine for Raw called by the 16 | dispatch driver. 17 | 18 | --*/ 19 | 20 | #include "RawProcs.h" 21 | 22 | #ifdef ALLOC_PRAGMA 23 | #pragma alloc_text(PAGE, RawCleanup) 24 | #endif 25 | 26 | 27 | NTSTATUS 28 | RawCleanup ( 29 | IN PVCB Vcb, 30 | IN PIRP Irp, 31 | IN PIO_STACK_LOCATION IrpSp 32 | ) 33 | 34 | /*++ 35 | 36 | Routine Description: 37 | 38 | This is the routine for cleaning up a handle. 39 | 40 | Arguments: 41 | 42 | Vcb - Supplies the volume being queried. 43 | 44 | Irp - Supplies the Irp being processed. 45 | 46 | IrpSp - Supplies parameters describing the read 47 | 48 | Return Value: 49 | 50 | NTSTATUS - The return status for the operation 51 | 52 | --*/ 53 | 54 | { 55 | NTSTATUS Status; 56 | 57 | PAGED_CODE(); 58 | 59 | // 60 | // This is a Cleanup operation. All we have to do is deal with 61 | // share access. 62 | // 63 | 64 | Status = KeWaitForSingleObject( &Vcb->Mutex, 65 | Executive, 66 | KernelMode, 67 | FALSE, 68 | (PLARGE_INTEGER) NULL ); 69 | ASSERT( NT_SUCCESS( Status ) ); 70 | 71 | IoRemoveShareAccess( IrpSp->FileObject, &Vcb->ShareAccess ); 72 | 73 | // 74 | // If the volume has been dismounted then the close count should be one. 75 | // we will let the volume dismount complete at this point if so. 76 | // 77 | 78 | if (FlagOn( Vcb->VcbState, VCB_STATE_FLAG_DISMOUNTED )) { 79 | 80 | ASSERT( Vcb->OpenCount == 1 ); 81 | 82 | // 83 | // Float this Vcb and Vpb while we wait for the close. 84 | // We know the Vcb won't go away in this call because our 85 | // reference keeps the OpenCount above zero. 86 | // 87 | 88 | RawCheckForDismount( Vcb, FALSE ); 89 | } 90 | 91 | (VOID)KeReleaseMutex( &Vcb->Mutex, FALSE ); 92 | 93 | RawCompleteRequest( Irp, STATUS_SUCCESS ); 94 | 95 | return STATUS_SUCCESS; 96 | } 97 | 98 | -------------------------------------------------------------------------------- /base/ntos/raw/close.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | Close.c 12 | 13 | Abstract: 14 | 15 | This module implements the File Close routine for Raw called by the 16 | dispatch driver. 17 | 18 | --*/ 19 | 20 | #include "RawProcs.h" 21 | 22 | #ifdef ALLOC_PRAGMA 23 | #pragma alloc_text(PAGE, RawClose) 24 | #endif 25 | 26 | NTSTATUS 27 | RawClose ( 28 | IN PVCB Vcb, 29 | IN PIRP Irp, 30 | IN PIO_STACK_LOCATION IrpSp 31 | ) 32 | 33 | /*++ 34 | 35 | Routine Description: 36 | 37 | This is the routine for closing a volume. 38 | 39 | Arguments: 40 | 41 | Vcb - Supplies the volume being queried. 42 | 43 | Irp - Supplies the Irp being processed. 44 | 45 | IrpSp - Supplies parameters describing the read 46 | 47 | Return Value: 48 | 49 | NTSTATUS - The return status for the operation 50 | 51 | --*/ 52 | 53 | { 54 | NTSTATUS Status; 55 | BOOLEAN DeleteVolume = FALSE; 56 | 57 | PAGED_CODE(); 58 | 59 | // 60 | // This is a close operation. If it is the last one, dismount. 61 | // 62 | 63 | // 64 | // Skip stream files as they are unopened fileobjects. 65 | // This might be a close from IopInvalidateVolumesForDevice 66 | // 67 | if (IrpSp->FileObject->Flags & FO_STREAM_FILE) { 68 | RawCompleteRequest( Irp, STATUS_SUCCESS ); 69 | return STATUS_SUCCESS; 70 | } 71 | 72 | Status = KeWaitForSingleObject( &Vcb->Mutex, 73 | Executive, 74 | KernelMode, 75 | FALSE, 76 | (PLARGE_INTEGER) NULL ); 77 | ASSERT( NT_SUCCESS( Status ) ); 78 | 79 | Vcb->OpenCount -= 1; 80 | 81 | if (Vcb->OpenCount == 0) { 82 | 83 | DeleteVolume = RawCheckForDismount( Vcb, FALSE ); 84 | } 85 | 86 | if (!DeleteVolume) { 87 | (VOID)KeReleaseMutex( &Vcb->Mutex, FALSE ); 88 | } 89 | 90 | RawCompleteRequest( Irp, STATUS_SUCCESS ); 91 | 92 | return STATUS_SUCCESS; 93 | } 94 | 95 | -------------------------------------------------------------------------------- /base/ntos/raw/nodetype.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | NodeType.h 12 | 13 | Abstract: 14 | 15 | This module defines all of the node type codes used in this development 16 | shell. Every major data structure in the file system is assigned a node 17 | type code that is. This code is the first CSHORT in the structure and is 18 | followed by a CSHORT containing the size, in bytes, of the structure. 19 | 20 | --*/ 21 | 22 | #ifndef _NODETYPE_ 23 | #define _NODETYPE_ 24 | 25 | typedef CSHORT NODE_TYPE_CODE; 26 | typedef NODE_TYPE_CODE *PNODE_TYPE_CODE; 27 | 28 | #define NTC_UNDEFINED ((NODE_TYPE_CODE)0x0000) 29 | 30 | #define RAW_NTC_VCB ((NODE_TYPE_CODE)0x0600) 31 | 32 | typedef CSHORT NODE_BYTE_SIZE; 33 | 34 | // 35 | // So all records start with 36 | // 37 | // typedef struct _RECORD_NAME { 38 | // NODE_TYPE_CODE NodeTypeCode; 39 | // NODE_BYTE_SIZE NodeByteSize; 40 | // : 41 | // } RECORD_NAME; 42 | // typedef RECORD_NAME *PRECORD_NAME; 43 | // 44 | 45 | #define NodeType(Ptr) (*((PNODE_TYPE_CODE)(Ptr))) 46 | 47 | #endif // _NODETYPE_ 48 | 49 | -------------------------------------------------------------------------------- /base/ntos/raw/readwrit.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | ReadWrit.c 12 | 13 | Abstract: 14 | 15 | This module implements the File Read and Write routines called by the 16 | dispatch driver. 17 | 18 | --*/ 19 | 20 | #include "RawProcs.h" 21 | 22 | #ifdef ALLOC_PRAGMA 23 | #pragma alloc_text(PAGE, RawReadWriteDeviceControl) 24 | #endif 25 | 26 | NTSTATUS 27 | RawReadWriteDeviceControl ( 28 | IN PVCB Vcb, 29 | IN PIRP Irp, 30 | IN PIO_STACK_LOCATION IrpSp 31 | ) 32 | 33 | /*++ 34 | 35 | Routine Description: 36 | 37 | This is the a common routine for both reading and writing a volume. 38 | 39 | Arguments: 40 | 41 | Vcb - Supplies the volume being queried. 42 | 43 | Irp - Supplies the Irp to process 44 | 45 | IrpSp - Supplies parameters describing the read or write 46 | 47 | Return Value: 48 | 49 | NTSTATUS - The return status for the operation 50 | 51 | --*/ 52 | 53 | { 54 | PIO_STACK_LOCATION NextIrpSp; 55 | NTSTATUS Status; 56 | 57 | PAGED_CODE(); 58 | 59 | // 60 | // If this was for a zero byte read or write transfer, just complete 61 | // it with success. 62 | // 63 | 64 | if (((IrpSp->MajorFunction == IRP_MJ_READ) || 65 | (IrpSp->MajorFunction == IRP_MJ_WRITE)) && 66 | (IrpSp->Parameters.Read.Length == 0)) { 67 | 68 | RawCompleteRequest( Irp, STATUS_SUCCESS ); 69 | 70 | return STATUS_SUCCESS; 71 | } 72 | 73 | // 74 | // This is a very simple operation. Simply forward the 75 | // request to the device driver since exact blocks are 76 | // being read and return whatever status was given. 77 | // 78 | // Get the next stack location, and copy over the stack location 79 | // 80 | 81 | NextIrpSp = IoGetNextIrpStackLocation( Irp ); 82 | 83 | *NextIrpSp = *IrpSp; 84 | 85 | // 86 | // Prohibit verifies all together. 87 | // 88 | 89 | NextIrpSp->Flags |= SL_OVERRIDE_VERIFY_VOLUME; 90 | 91 | // 92 | // Set up the completion routine 93 | // 94 | 95 | IoSetCompletionRoutine( Irp, 96 | RawCompletionRoutine, 97 | NULL, 98 | TRUE, 99 | TRUE, 100 | TRUE ); 101 | 102 | // 103 | // Send the request. 104 | // 105 | 106 | Status = IoCallDriver(Vcb->TargetDeviceObject, Irp); 107 | 108 | return Status; 109 | 110 | } 111 | 112 | -------------------------------------------------------------------------------- /base/ntos/rtl/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = ntos$(module) 9 | 10 | !if "$(targ)" == "i386" 11 | asobjs= \ 12 | $(OBJ)\debug2.obj \ 13 | $(OBJ)\stringsp.obj \ 14 | $(OBJ)\ioaccess.obj \ 15 | $(OBJ)\largeint.obj \ 16 | $(OBJ)\movemem.obj \ 17 | $(OBJ)\raise.obj \ 18 | $(OBJ)\stkwalk.obj \ 19 | $(OBJ)\xcptmisc.obj \ 20 | $(OBJ)\slist.obj 21 | 22 | ccarchobjs= \ 23 | $(OBJ)\context.obj \ 24 | $(OBJ)\debug3.obj \ 25 | $(OBJ)\divlarge.obj \ 26 | $(OBJ)\exdsptch.obj \ 27 | $(OBJ)\getcalr.obj 28 | !else 29 | asobjs= \ 30 | $(OBJ)\capture.obj \ 31 | $(OBJ)\chkstk.obj \ 32 | $(OBJ)\debugstb.obj \ 33 | $(OBJ)\movemem.obj \ 34 | $(OBJ)\slist.obj \ 35 | $(OBJ)\xcptmisc.obj 36 | 37 | ccarchobjs= \ 38 | $(OBJ)\context.obj \ 39 | $(OBJ)\exdsptch.obj \ 40 | $(OBJ)\misalign.obj \ 41 | $(OBJ)\raise.obj \ 42 | $(OBJ)\stkwalk.obj 43 | !endif 44 | 45 | 46 | ccobjs= \ 47 | $(OBJ)\byteswap.obj \ 48 | $(OBJ)\acledit.obj \ 49 | $(OBJ)\add2stra.obj \ 50 | $(OBJ)\add2strw.obj \ 51 | $(OBJ)\assert.obj \ 52 | $(OBJ)\atom.obj \ 53 | $(OBJ)\avltable.obj \ 54 | $(OBJ)\bitmap.obj \ 55 | $(OBJ)\cnvint.obj \ 56 | $(OBJ)\debug.obj \ 57 | $(OBJ)\eballoc.obj \ 58 | $(OBJ)\environ.obj \ 59 | $(OBJ)\error.obj \ 60 | $(OBJ)\excptdbg.obj \ 61 | $(OBJ)\gentable.obj \ 62 | $(OBJ)\guid.obj \ 63 | $(OBJ)\imagedir.obj \ 64 | $(OBJ)\rtlnthdr.obj \ 65 | $(OBJ)\intbits.obj \ 66 | $(OBJ)\ldrrsrc.obj \ 67 | $(OBJ)\ldrreloc.obj \ 68 | $(OBJ)\lookup.obj \ 69 | $(OBJ)\message.obj \ 70 | $(OBJ)\nls.obj \ 71 | $(OBJ)\nlsxlat.obj \ 72 | $(OBJ)\pctohdr.obj \ 73 | $(OBJ)\peb.obj \ 74 | $(OBJ)\prefix.obj \ 75 | $(OBJ)\regutil.obj \ 76 | $(OBJ)\rtlassig.obj \ 77 | $(OBJ)\rtldata.obj \ 78 | $(OBJ)\rtlexec.obj \ 79 | $(OBJ)\sertl.obj \ 80 | $(OBJ)\splay.obj \ 81 | $(OBJ)\str2adda.obj \ 82 | $(OBJ)\str2addw.obj \ 83 | $(OBJ)\string.obj \ 84 | $(OBJ)\stktrace.obj \ 85 | $(OBJ)\sysvol.obj \ 86 | $(OBJ)\time.obj \ 87 | $(OBJ)\tracedb.obj 88 | 89 | !include $(ntos)\BUILD\makefile.build 90 | 91 | -------------------------------------------------------------------------------- /base/ntos/rtl/add2stra.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | // If you do not agree to the terms, do not use the code. 6 | // 7 | 8 | #undef UNICODE 9 | #undef _UNICODE 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #define RtlIpv6AddressToStringT RtlIpv6AddressToStringA 17 | #define RtlIpv4AddressToStringT RtlIpv4AddressToStringA 18 | #define RtlIpv6AddressToStringExT RtlIpv6AddressToStringExA 19 | #define RtlIpv4AddressToStringExT RtlIpv4AddressToStringExA 20 | 21 | #include "add2strt.h" 22 | 23 | -------------------------------------------------------------------------------- /base/ntos/rtl/add2strw.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | // If you do not agree to the terms, do not use the code. 6 | // 7 | 8 | #define UNICODE 9 | #define _UNICODE 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #define RtlIpv4AddressToStringT RtlIpv4AddressToStringW 17 | #define RtlIpv6AddressToStringT RtlIpv6AddressToStringW 18 | #define RtlIpv4AddressToStringExT RtlIpv4AddressToStringExW 19 | #define RtlIpv6AddressToStringExT RtlIpv6AddressToStringExW 20 | 21 | #include "add2strt.h" 22 | 23 | -------------------------------------------------------------------------------- /base/ntos/rtl/amd64/chkstk.asm: -------------------------------------------------------------------------------- 1 | TITLE "Runtime Stack Checking" 2 | ;++ 3 | ; 4 | ; Copyright (c) Microsoft Corporation. All rights reserved. 5 | ; 6 | ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 7 | ; If you do not agree to the terms, do not use the code. 8 | ; 9 | ; 10 | ; Module Name: 11 | ; 12 | ; chkstk.s 13 | ; 14 | ; Abstract: 15 | ; 16 | ; This module implements runtime stack checking. 17 | ; 18 | ;-- 19 | 20 | include ksamd64.inc 21 | 22 | subttl "Check Stack" 23 | ;++ 24 | ; 25 | ; ULONG64 26 | ; __chkstk ( 27 | ; VOID 28 | ; ) 29 | ; 30 | ; Routine Description: 31 | ; 32 | ; This function provides runtime stack checking for local allocations 33 | ; that are more than a page and for storage dynamically allocated with 34 | ; the alloca function. Stack checking consists of probing downward in 35 | ; the stack a page at a time. If the current stack commitment is exceeded, 36 | ; then the system will automatically attempts to expand the stack. If the 37 | ; attempt succeeds, then another page is committed. Otherwise, a stack 38 | ; overflow exception is raised. It is the responsibility of the caller to 39 | ; handle this exception. 40 | ; 41 | ; N.B. This routine is called using a non-standard calling sequence since 42 | ; it is typically called from within the prologue. The allocation size 43 | ; argument is in register rax and it must be preserved. Registers r10 44 | ; and r11 are used by this function, but are preserved. 45 | ; 46 | ; The typical calling sequence from the prologue is: 47 | ; 48 | ; mov rax, allocation-size ; set requested stack frame size 49 | ; call __chkstk ; check stack page allocation 50 | ; sub rsp, rax ; allocate stack frame 51 | ; 52 | ; Arguments: 53 | ; 54 | ; None. 55 | ; 56 | ; Implicit Arguments: 57 | ; 58 | ; Allocation (rax) - Supplies the size of the allocation on the stack. 59 | ; 60 | ; Return Value: 61 | ; 62 | ; The allocation size is returned as the function value. 63 | ; 64 | ;-- 65 | 66 | LEAF_ENTRY __chkstk, _TEXT$00 67 | 68 | ret ; return 69 | 70 | LEAF_END __chkstk, _TEXT$00 71 | 72 | end 73 | 74 | -------------------------------------------------------------------------------- /base/ntos/rtl/amd64/misalign.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | miaslign.c 12 | 13 | Abstract: 14 | 15 | This module implements __misaligned_access(). 16 | 17 | --*/ 18 | 19 | #include "ntrtlp.h" 20 | 21 | 22 | VOID 23 | __misaligned_access ( 24 | IN PVOID Address, 25 | IN LONG Size, 26 | IN LONG Alignment, 27 | IN BOOLEAN Write 28 | ) 29 | { 30 | } 31 | 32 | -------------------------------------------------------------------------------- /base/ntos/rtl/amd64/ntrtlamd64.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | ntrtlamd64.h 12 | 13 | Abstract: 14 | 15 | AMD64 specific parts of ntrtlp.h. 16 | 17 | --*/ 18 | 19 | #ifndef _NTRTLAMD64_ 20 | #define _NTRTLAMD64_ 21 | 22 | // 23 | // Define exception routine function prototypes. 24 | // 25 | 26 | EXCEPTION_DISPOSITION 27 | RtlpExecuteHandlerForException ( 28 | IN PEXCEPTION_RECORD ExceptionRecord, 29 | IN ULONG64 EstablisherFrame, 30 | IN OUT PCONTEXT ContextRecord, 31 | IN OUT PDISPATCHER_CONTEXT DispatcherContext 32 | ); 33 | 34 | EXCEPTION_DISPOSITION 35 | RtlpExecuteHandlerForUnwind ( 36 | IN PEXCEPTION_RECORD ExceptionRecord, 37 | IN ULONG_PTR EstablisherFrame, 38 | IN OUT PCONTEXT ContextRecord, 39 | IN OUT PDISPATCHER_CONTEXT DispatcherContext 40 | ); 41 | 42 | BOOLEAN 43 | RtlpIsFrameInBounds ( 44 | IN OUT PULONG64 LowLimit, 45 | IN ULONG64 StackFrame, 46 | IN OUT PULONG64 HighLimit 47 | ); 48 | 49 | #endif // _NTRTLAMD64_ 50 | 51 | -------------------------------------------------------------------------------- /base/ntos/rtl/eballoc.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | eballoc.c 12 | 13 | Abstract: 14 | 15 | Process/Thread Environment Block allocation functions 16 | 17 | --*/ 18 | 19 | #include "ntrtlp.h" 20 | #include 21 | 22 | #if defined(ALLOC_PRAGMA) 23 | #pragma alloc_text(INIT,RtlAcquirePebLock) 24 | #pragma alloc_text(INIT,RtlReleasePebLock) 25 | #endif 26 | 27 | 28 | #undef RtlAcquirePebLock 29 | 30 | VOID 31 | RtlAcquirePebLock( VOID ) 32 | { 33 | } 34 | 35 | 36 | #undef RtlReleasePebLock 37 | 38 | VOID 39 | RtlReleasePebLock( VOID ) 40 | { 41 | } 42 | 43 | #if DBG 44 | VOID 45 | RtlAssertPebLockOwned( VOID ) 46 | { 47 | } 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /base/ntos/rtl/i386/debug2.asm: -------------------------------------------------------------------------------- 1 | title "Debug Support Functions" 2 | ;++ 3 | ; 4 | ; Copyright (c) Microsoft Corporation. All rights reserved. 5 | ; 6 | ; You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 7 | ; If you do not agree to the terms, do not use the code. 8 | ; 9 | ; 10 | ; Module Name: 11 | ; 12 | ; debug.s 13 | ; 14 | ; Abstract: 15 | ; 16 | ; This module implements functions to support debugging NT. 17 | ; 18 | ;-- 19 | .386p 20 | 21 | 22 | .xlist 23 | include ks386.inc 24 | include callconv.inc ; calling convention macros 25 | .list 26 | 27 | _TEXT SEGMENT PUBLIC DWORD 'CODE' 28 | ASSUME DS:FLAT, ES:FLAT, FS:NOTHING, GS:NOTHING, SS:NOTHING 29 | 30 | cPublicProc _DbgBreakPoint ,0 31 | cPublicFpo 0,0 32 | int 3 33 | stdRET _DbgBreakPoint 34 | stdENDP _DbgBreakPoint 35 | 36 | cPublicProc _DbgUserBreakPoint ,0 37 | cPublicFpo 0,0 38 | int 3 39 | stdRET _DbgUserBreakPoint 40 | stdENDP _DbgUserBreakPoint 41 | 42 | cPublicProc _DbgBreakPointWithStatus,1 43 | cPublicFpo 1,0 44 | mov eax,[esp+4] 45 | public _RtlpBreakWithStatusInstruction@0 46 | _RtlpBreakWithStatusInstruction@0: 47 | int 3 48 | stdRET _DbgBreakPointWithStatus 49 | stdENDP _DbgBreakPointWithStatus 50 | 51 | 52 | _TEXT ends 53 | end 54 | 55 | -------------------------------------------------------------------------------- /base/ntos/rtl/i386/ntrtl386.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | ntrtl386.h 12 | 13 | Abstract: 14 | 15 | i386 specific parts of ntrtlp.h 16 | 17 | --*/ 18 | 19 | // 20 | // Exception handling procedure prototypes. 21 | // 22 | VOID 23 | RtlpCaptureContext ( 24 | OUT PCONTEXT ContextRecord 25 | ); 26 | 27 | VOID 28 | RtlpUnlinkHandler ( 29 | PEXCEPTION_REGISTRATION_RECORD UnlinkPointer 30 | ); 31 | 32 | PEXCEPTION_REGISTRATION_RECORD 33 | RtlpGetRegistrationHead ( 34 | VOID 35 | ); 36 | 37 | // 38 | // Record dump procedures. 39 | // 40 | 41 | VOID 42 | RtlpContextDump( 43 | IN PVOID Object, 44 | IN ULONG Control OPTIONAL 45 | ); 46 | 47 | VOID 48 | RtlpExceptionReportDump( 49 | IN PVOID Object, 50 | IN ULONG Control OPTIONAL 51 | ); 52 | 53 | VOID 54 | RtlpExceptionRegistrationDump( 55 | IN PVOID Object, 56 | IN ULONG Control OPTIONAL 57 | ); 58 | 59 | -------------------------------------------------------------------------------- /base/ntos/rtl/intbits.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | intbits.c 12 | 13 | Abstract: 14 | 15 | This module contains routines to do interlocked bit manipulation 16 | 17 | --*/ 18 | 19 | #include "ntrtlp.h" 20 | #pragma hdrstop 21 | 22 | ULONG 23 | FASTCALL 24 | RtlInterlockedSetClearBits ( 25 | IN OUT PULONG Flags, 26 | IN ULONG sFlag, 27 | IN ULONG cFlag 28 | ) 29 | 30 | /*++ 31 | 32 | Routine Description: 33 | 34 | This function atomically sets and clears the specified flags in the target 35 | 36 | Arguments: 37 | 38 | Flags - Pointer to variable containing current mask. 39 | 40 | sFlag - Flags to set in target 41 | 42 | CFlag - Flags to clear in target 43 | 44 | Return Value: 45 | 46 | ULONG - Old value of mask before modification 47 | 48 | --*/ 49 | 50 | { 51 | 52 | ULONG NewFlags, OldFlags; 53 | 54 | OldFlags = *Flags; 55 | NewFlags = (OldFlags | sFlag) & ~cFlag; 56 | while (NewFlags != OldFlags) { 57 | NewFlags = InterlockedCompareExchange ((PLONG) Flags, (LONG) NewFlags, (LONG) OldFlags); 58 | if (NewFlags == OldFlags) { 59 | break; 60 | } 61 | 62 | OldFlags = NewFlags; 63 | NewFlags = (NewFlags | sFlag) & ~cFlag; 64 | } 65 | 66 | return OldFlags; 67 | } 68 | 69 | -------------------------------------------------------------------------------- /base/ntos/rtl/message.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | message.c 12 | 13 | Abstract: 14 | 15 | Message table resource accessing functions 16 | 17 | --*/ 18 | 19 | #include "ntrtlp.h" 20 | 21 | #if defined(ALLOC_PRAGMA) 22 | #pragma alloc_text(PAGE,RtlFindMessage) 23 | #endif 24 | 25 | NTSTATUS 26 | RtlFindMessage( 27 | IN PVOID DllHandle, 28 | IN ULONG MessageTableId, 29 | IN ULONG MessageLanguageId, 30 | IN ULONG MessageId, 31 | OUT PMESSAGE_RESOURCE_ENTRY *MessageEntry 32 | ) 33 | { 34 | NTSTATUS Status; 35 | ULONG NumberOfBlocks; 36 | ULONG EntryIndex; 37 | PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry; 38 | PMESSAGE_RESOURCE_DATA MessageData; 39 | PMESSAGE_RESOURCE_BLOCK MessageBlock; 40 | PCHAR s; 41 | ULONG_PTR ResourceIdPath[ 3 ]; 42 | 43 | RTL_PAGED_CODE(); 44 | 45 | ResourceIdPath[ 0 ] = MessageTableId; 46 | ResourceIdPath[ 1 ] = 1; 47 | ResourceIdPath[ 2 ] = MessageLanguageId; 48 | 49 | Status = LdrpSearchResourceSection_U( DllHandle, 50 | ResourceIdPath, 51 | 3, 52 | 0, 53 | (PVOID *)&ResourceDataEntry 54 | ); 55 | if (!NT_SUCCESS( Status )) { 56 | return( Status ); 57 | } 58 | 59 | Status = LdrpAccessResourceData( DllHandle, 60 | ResourceDataEntry, 61 | (PVOID *)&MessageData, 62 | NULL 63 | ); 64 | if (!NT_SUCCESS( Status )) { 65 | return( Status ); 66 | } 67 | 68 | NumberOfBlocks = MessageData->NumberOfBlocks; 69 | MessageBlock = &MessageData->Blocks[ 0 ]; 70 | while (NumberOfBlocks--) { 71 | if (MessageId >= MessageBlock->LowId && 72 | MessageId <= MessageBlock->HighId 73 | ) { 74 | s = (PCHAR)MessageData + MessageBlock->OffsetToEntries; 75 | EntryIndex = MessageId - MessageBlock->LowId; 76 | while (EntryIndex--) { 77 | s += ((PMESSAGE_RESOURCE_ENTRY)s)->Length; 78 | } 79 | 80 | *MessageEntry = (PMESSAGE_RESOURCE_ENTRY)s; 81 | return( STATUS_SUCCESS ); 82 | } 83 | 84 | MessageBlock++; 85 | } 86 | 87 | return( STATUS_MESSAGE_NOT_FOUND ); 88 | } 89 | 90 | -------------------------------------------------------------------------------- /base/ntos/rtl/str2adda.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | // If you do not agree to the terms, do not use the code. 6 | // 7 | 8 | // 9 | // Without this define, link errors can occur due to missing _pctype and 10 | // __mb_cur_max 11 | // 12 | #define _CTYPE_DISABLE_MACROS 13 | 14 | #undef UNICODE 15 | #undef _UNICODE 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define RtlIpv4StringToAddressT RtlIpv4StringToAddressA 23 | #define RtlIpv6StringToAddressT RtlIpv6StringToAddressA 24 | #define RtlIpv4StringToAddressExT RtlIpv4StringToAddressExA 25 | #define RtlIpv6StringToAddressExT RtlIpv6StringToAddressExA 26 | #include "str2addt.h" 27 | 28 | -------------------------------------------------------------------------------- /base/ntos/rtl/str2addw.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | // If you do not agree to the terms, do not use the code. 6 | // 7 | 8 | // Without this define, link errors can occur due to missing _pctype and 9 | // __mb_cur_max 10 | // 11 | #define _CTYPE_DISABLE_MACROS 12 | 13 | #define UNICODE 14 | #define _UNICODE 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #define RtlIpv4StringToAddressT RtlIpv4StringToAddressW 22 | #define RtlIpv6StringToAddressT RtlIpv6StringToAddressW 23 | #define RtlIpv4StringToAddressExT RtlIpv4StringToAddressExW 24 | #define RtlIpv6StringToAddressExT RtlIpv6StringToAddressExW 25 | 26 | #include "str2addt.h" 27 | 28 | -------------------------------------------------------------------------------- /base/ntos/rtl/tracedbp.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | tracedbp.h 12 | 13 | Abstract: 14 | 15 | This header contains the private interfaces for the trace database 16 | module (hash table to store stack traces in Kernel mode). 17 | 18 | --*/ 19 | 20 | #ifndef _TRACEDBP_H 21 | #define _TRACEDBP_H 22 | 23 | // 24 | // RTL_TRACE_SEGMENT 25 | // 26 | 27 | typedef struct _RTL_TRACE_SEGMENT { 28 | 29 | ULONG Magic; 30 | 31 | struct _RTL_TRACE_DATABASE * Database; 32 | struct _RTL_TRACE_SEGMENT * NextSegment; 33 | SIZE_T TotalSize; 34 | PCHAR SegmentStart; 35 | PCHAR SegmentEnd; 36 | PCHAR SegmentFree; 37 | 38 | } RTL_TRACE_SEGMENT, * PRTL_TRACE_SEGMENT; 39 | 40 | // 41 | // RTL_TRACE_DATABASE 42 | // 43 | 44 | typedef struct _RTL_TRACE_DATABASE { 45 | 46 | ULONG Magic; 47 | ULONG Flags; 48 | ULONG Tag; 49 | 50 | struct _RTL_TRACE_SEGMENT * SegmentList; 51 | 52 | SIZE_T MaximumSize; 53 | SIZE_T CurrentSize; 54 | 55 | KIRQL SavedIrql; 56 | PVOID Owner; 57 | 58 | union { 59 | KSPIN_LOCK SpinLock; 60 | FAST_MUTEX FastMutex; 61 | } u; 62 | 63 | ULONG NoOfBuckets; 64 | struct _RTL_TRACE_BLOCK * * Buckets; 65 | RTL_TRACE_HASH_FUNCTION HashFunction; 66 | 67 | SIZE_T NoOfTraces; 68 | SIZE_T NoOfHits; 69 | 70 | ULONG HashCounter[16]; 71 | 72 | } RTL_TRACE_DATABASE, * PRTL_TRACE_DATABASE; 73 | 74 | #endif // #ifndef _TRACEDBP_H 75 | 76 | -------------------------------------------------------------------------------- /base/ntos/se/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = ntos$(module) 9 | 10 | asobjs= 11 | 12 | ccarchobjs= 13 | 14 | ccobjs= \ 15 | $(OBJ)\accessck.obj \ 16 | $(OBJ)\capture.obj \ 17 | $(OBJ)\privileg.obj \ 18 | $(OBJ)\rmlogon.obj \ 19 | $(OBJ)\rmmain.obj \ 20 | $(OBJ)\rmvars.obj \ 21 | $(OBJ)\seassign.obj \ 22 | $(OBJ)\seaudit.obj \ 23 | $(OBJ)\sepaudit.obj \ 24 | $(OBJ)\seclient.obj \ 25 | $(OBJ)\seglobal.obj \ 26 | $(OBJ)\seinit.obj \ 27 | $(OBJ)\semethod.obj \ 28 | $(OBJ)\sep.obj \ 29 | $(OBJ)\subject.obj \ 30 | $(OBJ)\seastate.obj \ 31 | $(OBJ)\token.obj \ 32 | $(OBJ)\tokenadj.obj \ 33 | $(OBJ)\tokendup.obj \ 34 | $(OBJ)\tokenopn.obj \ 35 | $(OBJ)\tokenqry.obj \ 36 | $(OBJ)\tokenset.obj \ 37 | $(OBJ)\adtlog.obj \ 38 | $(OBJ)\adtinit.obj \ 39 | $(OBJ)\adtvars.obj \ 40 | $(OBJ)\adtutil.obj \ 41 | $(OBJ)\rmaudit.obj 42 | 43 | !include $(ntos)\BUILD\makefile.build 44 | 45 | -------------------------------------------------------------------------------- /base/ntos/se/adt.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | adt.h 12 | 13 | Abstract: 14 | 15 | Auditing - Defines, Function Prototypes and Macro Functions. 16 | These are public to the Security Component only. 17 | 18 | --*/ 19 | 20 | #include 21 | 22 | 23 | ////////////////////////////////////////////////////////////////////////////// 24 | // // 25 | // Auditing Routines visible to rest of Security Component outside Auditing // 26 | // subcomponent. // 27 | // // 28 | ////////////////////////////////////////////////////////////////////////////// 29 | 30 | 31 | BOOLEAN 32 | SepAdtInitializePhase0(); 33 | 34 | BOOLEAN 35 | SepAdtInitializePhase1(); 36 | 37 | VOID 38 | SepAdtLogAuditRecord( 39 | IN PSE_ADT_PARAMETER_ARRAY AuditParameters 40 | ); 41 | 42 | NTSTATUS 43 | SepAdtCopyToLsaSharedMemory( 44 | IN HANDLE LsaProcessHandle, 45 | IN PVOID Buffer, 46 | IN ULONG BufferLength, 47 | OUT PVOID *LsaBufferAddress 48 | ); 49 | 50 | -------------------------------------------------------------------------------- /base/ntos/se/adtutil.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | adtutil.h - Security Auditing - Utility Routines 12 | 13 | Abstract: 14 | 15 | This Module contains miscellaneous utility routines private to the 16 | Security Auditing Component. 17 | 18 | --*/ 19 | 20 | NTSTATUS 21 | SepRegQueryDwordValue( 22 | IN PCWSTR KeyName, 23 | IN PCWSTR ValueName, 24 | OUT PULONG Value 25 | ); 26 | 27 | NTSTATUS 28 | SepRegQueryHelper( 29 | IN PCWSTR KeyName, 30 | IN PCWSTR ValueName, 31 | IN ULONG ValueType, 32 | IN ULONG ValueLength, 33 | OUT PVOID ValueBuffer, 34 | OUT PULONG LengthRequired 35 | ); 36 | 37 | -------------------------------------------------------------------------------- /base/ntos/se/adtvars.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | adtvars.c 12 | 13 | Abstract: 14 | 15 | Auditing - Private Variables 16 | 17 | --*/ 18 | 19 | #include "pch.h" 20 | 21 | #pragma hdrstop 22 | 23 | 24 | #ifdef ALLOC_DATA_PRAGMA 25 | #pragma data_seg("PAGEDATA") 26 | #endif 27 | 28 | // 29 | // Auditing State. This contains the Auditing Mode and the array of 30 | // Event Auditing Options 31 | // 32 | 33 | //POLICY_AUDIT_EVENTS_INFO SepAdtState; 34 | 35 | // 36 | // Audit Log Information 37 | // 38 | 39 | POLICY_AUDIT_LOG_INFO SepAdtLogInformation = {0}; 40 | 41 | // 42 | // High and low water marks to control the length of the audit queue 43 | // These are initialized to their default values in case we can't get 44 | // them out of the registry. 45 | // 46 | 47 | ULONG SepAdtMaxListLength = 0x3000; 48 | ULONG SepAdtMinListLength = 0x2000; 49 | 50 | ULONG SepAdtCurrentListLength = 0; 51 | 52 | // 53 | // Number of events discarded 54 | // 55 | 56 | ULONG SepAdtCountEventsDiscarded = 0; 57 | 58 | // 59 | // Flag used to indicate that we are currently discarding audit events 60 | // 61 | 62 | BOOLEAN SepAdtDiscardingAudits = FALSE; 63 | 64 | // 65 | // see note in adtp.h regarding SEP_AUDIT_OPTIONS 66 | // 67 | 68 | SEP_AUDIT_OPTIONS SepAuditOptions = { 0 }; 69 | 70 | // 71 | // Used to indicate that LSA process has died 72 | // (see adtlog.c and rmmain.c) 73 | // 74 | 75 | PKEVENT SepAdtLsaDeadEvent = NULL; 76 | 77 | #ifdef ALLOC_DATA_PRAGMA 78 | #pragma data_seg() 79 | #endif 80 | 81 | -------------------------------------------------------------------------------- /base/ntos/se/pch.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | // If you do not agree to the terms, do not use the code. 6 | // 7 | // 8 | 9 | #pragma warning(push, 3) 10 | #include 11 | #include 12 | #include 13 | #include "zwapi.h" 14 | #include "nturtl.h" 15 | 16 | #include "sep.h" 17 | #include "tokenp.h" 18 | #include "sertlp.h" 19 | #include "adt.h" 20 | #include "adtp.h" 21 | #include "rmp.h" 22 | #include "adtutil.h" 23 | #pragma warning(pop) 24 | 25 | // 26 | // uncomment the following to enable a lot of warnings 27 | // 28 | // #include 29 | // #pragma warning(3:4100) // Unreferenced formal parameter 30 | // #pragma warning(3:4701) // local may be used w/o init 31 | // #pragma warning(3:4702) // Unreachable code 32 | // #pragma warning(3:4705) // Statement has no effect 33 | // #pragma warning(3:4706) // assignment w/i conditional expression 34 | // #pragma warning(3:4709) // command operator w/o index expression 35 | 36 | -------------------------------------------------------------------------------- /base/ntos/se/sep.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | Sep.c 12 | 13 | Abstract: 14 | 15 | This Module implements the private security routine that are defined 16 | in sep.h 17 | 18 | --*/ 19 | 20 | #include "pch.h" 21 | 22 | #pragma hdrstop 23 | 24 | 25 | #ifdef ALLOC_PRAGMA 26 | #pragma alloc_text(PAGE,SepCheckAcl) 27 | #endif 28 | 29 | 30 | 31 | BOOLEAN 32 | SepCheckAcl ( 33 | IN PACL Acl, 34 | IN ULONG Length 35 | ) 36 | 37 | /*++ 38 | 39 | Routine Description: 40 | 41 | This is a private routine that checks that an acl is well formed. 42 | 43 | Arguments: 44 | 45 | Acl - Supplies the acl to check 46 | 47 | Length - Supplies the real size of the acl. The internal acl size 48 | must agree. 49 | 50 | Return Value: 51 | 52 | BOOLEAN - TRUE if the acl is well formed and FALSE otherwise 53 | 54 | --*/ 55 | { 56 | if ((Length < sizeof(ACL)) || (Length != Acl->AclSize)) { 57 | return FALSE; 58 | } 59 | return RtlValidAcl( Acl ); 60 | } 61 | 62 | -------------------------------------------------------------------------------- /base/ntos/wmi/BUILD/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # 4 | # You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | # If you do not agree to the terms, do not use the code. 6 | # 7 | 8 | library = $(module) 9 | specialcflags = -DUNICODE 10 | 11 | asobjs= 12 | 13 | ccarchobjs= \ 14 | $(OBJ)\mcaevent.obj 15 | 16 | ccobjs= \ 17 | $(OBJ)\wmi.obj \ 18 | $(OBJ)\register.obj \ 19 | $(OBJ)\api.obj \ 20 | $(OBJ)\notify.obj \ 21 | $(OBJ)\callouts.obj \ 22 | $(OBJ)\tracelog.obj \ 23 | $(OBJ)\traceapi.obj \ 24 | $(OBJ)\tracesup.obj \ 25 | $(OBJ)\secure.obj \ 26 | $(OBJ)\globalog.obj \ 27 | $(OBJ)\wmidata.obj \ 28 | $(OBJ)\dataprov.obj \ 29 | $(OBJ)\alloc.obj \ 30 | $(OBJ)\chunk.obj \ 31 | $(OBJ)\ds.obj \ 32 | $(OBJ)\consumer.obj \ 33 | $(OBJ)\enabdisa.obj \ 34 | $(OBJ)\smbios.obj \ 35 | $(OBJ)\mca.obj \ 36 | $(OBJ)\provider.obj 37 | 38 | !include $(ntos)\BUILD\makefile.build 39 | 40 | -------------------------------------------------------------------------------- /base/ntos/wmi/wmidata.c: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | WmiData.c 12 | 13 | Abstract: 14 | 15 | Define storage for Guids and common global structures 16 | 17 | --*/ 18 | 19 | #pragma warning(disable:4214) // bit field types other than int 20 | #pragma warning(disable:4201) // nameless struct/union 21 | #pragma warning(disable:4324) // alignment sensitive to declspec 22 | #pragma warning(disable:4127) // condition expression is constant 23 | #pragma warning(disable:4115) // named type definition in parentheses 24 | 25 | #include 26 | #include 27 | 28 | // 29 | // Time out constants 30 | // 31 | const LARGE_INTEGER WmiOneSecond = {(ULONG)(-1 * 1000 * 1000 * 10), -1}; 32 | const LARGE_INTEGER WmiShortTime = {(ULONG)(-10 * 1000 * 10), -1}; // 10 milliseconds 33 | 34 | #ifdef ALLOC_DATA_PRAGMA 35 | #pragma const_seg("PAGECONST") 36 | #endif 37 | #include 38 | #include 39 | #define _WMIKM_ 40 | #include 41 | 42 | #ifdef ALLOC_DATA_PRAGMA 43 | #pragma const_seg() 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /public/ddk/inc/mountdev.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | mountdev.h 12 | 13 | Abstract: 14 | 15 | This file defines the private interfaces between the mount point manager 16 | and the mounted devices. 17 | 18 | --*/ 19 | 20 | #ifndef _MOUNTDEV_ 21 | #define _MOUNTDEV_ 22 | 23 | #include 24 | 25 | #define IOCTL_MOUNTDEV_QUERY_UNIQUE_ID CTL_CODE(MOUNTDEVCONTROLTYPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) 26 | #define IOCTL_MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY CTL_CODE(MOUNTDEVCONTROLTYPE, 1, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) 27 | #define IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME CTL_CODE(MOUNTDEVCONTROLTYPE, 3, METHOD_BUFFERED, FILE_ANY_ACCESS) 28 | #define IOCTL_MOUNTDEV_LINK_CREATED CTL_CODE(MOUNTDEVCONTROLTYPE, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) 29 | #define IOCTL_MOUNTDEV_LINK_DELETED CTL_CODE(MOUNTDEVCONTROLTYPE, 5, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) 30 | #define IOCTL_MOUNTDEV_QUERY_STABLE_GUID CTL_CODE(MOUNTDEVCONTROLTYPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS) 31 | 32 | // 33 | // Output structure for IOCTL_MOUNTDEV_QUERY_UNIQUE_ID. 34 | // Input structure for IOCTL_MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY. 35 | // 36 | 37 | typedef struct _MOUNTDEV_UNIQUE_ID { 38 | USHORT UniqueIdLength; 39 | UCHAR UniqueId[1]; 40 | } MOUNTDEV_UNIQUE_ID, *PMOUNTDEV_UNIQUE_ID; 41 | 42 | // 43 | // Output structure for IOCTL_MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY. 44 | // 45 | 46 | typedef struct _MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY_OUTPUT { 47 | ULONG Size; 48 | USHORT OldUniqueIdOffset; 49 | USHORT OldUniqueIdLength; 50 | USHORT NewUniqueIdOffset; 51 | USHORT NewUniqueIdLength; 52 | } MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY_OUTPUT, *PMOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY_OUTPUT; 53 | 54 | // 55 | // MOUNTDEV_NAME 56 | // 57 | // Input structure for IOCTL_MOUNTDEV_LINK_CREATED. 58 | // Input structure for IOCTL_MOUNTDEV_LINK_DELETED. 59 | // 60 | 61 | // 62 | // Output structure for IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME 63 | // 64 | 65 | typedef struct _MOUNTDEV_SUGGESTED_LINK_NAME { 66 | BOOLEAN UseOnlyIfThereAreNoOtherLinks; 67 | USHORT NameLength; 68 | WCHAR Name[1]; 69 | } MOUNTDEV_SUGGESTED_LINK_NAME, *PMOUNTDEV_SUGGESTED_LINK_NAME; 70 | 71 | // 72 | // Output structure for IOCTL_MOUNTDEV_QUERY_STABLE_GUID. 73 | // 74 | 75 | typedef struct _MOUNTDEV_STABLE_GUID { 76 | GUID StableGuid; 77 | } MOUNTDEV_STABLE_GUID, *PMOUNTDEV_STABLE_GUID; 78 | 79 | #endif 80 | 81 | -------------------------------------------------------------------------------- /public/halkit/inc/arccodes.h: -------------------------------------------------------------------------------- 1 | /*++ BUILD Version: 0001 // Increment this if a change has global effects 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | arc.h 12 | 13 | Abstract: 14 | 15 | This header file defines the ARC status codes. 16 | 17 | --*/ 18 | 19 | #ifndef _ARCCODES_ 20 | #define _ARCCODES_ 21 | 22 | // 23 | // Define ARC status codes. 24 | // 25 | 26 | typedef enum _ARC_CODES { 27 | ESUCCESS, // 0 28 | E2BIG, // 1 29 | EACCES, // 2 30 | EAGAIN, // 3 31 | EBADF, // 4 32 | EBUSY, // 5 33 | EFAULT, // 6 34 | EINVAL, // 7 35 | EIO, // 8 36 | EISDIR, // 9 37 | EMFILE, // 10 38 | EMLINK, // 11 39 | ENAMETOOLONG, // 12 40 | ENODEV, // 13 41 | ENOENT, // 14 42 | ENOEXEC, // 15 43 | ENOMEM, // 16 44 | ENOSPC, // 17 45 | ENOTDIR, // 18 46 | ENOTTY, // 19 47 | ENXIO, // 20 48 | EROFS, // 21 49 | EWRONGARCH, // 22 50 | EMAXIMUM // 23 51 | } ARC_CODES; 52 | 53 | #endif // ARCCODES 54 | 55 | -------------------------------------------------------------------------------- /public/internal/base/inc/atom.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | atom.h 12 | 13 | Abstract: 14 | 15 | This is the header file that describes the constants and data 16 | structures used by the atom manager, exported by ntdll.dll and 17 | ntrtl.lib 18 | 19 | Procedure prototypes are defined in ntrtl.h 20 | 21 | --*/ 22 | 23 | typedef struct _RTL_ATOM_TABLE_ENTRY { 24 | struct _RTL_ATOM_TABLE_ENTRY *HashLink; 25 | USHORT HandleIndex; 26 | RTL_ATOM Atom; 27 | USHORT ReferenceCount; 28 | UCHAR Flags; 29 | UCHAR NameLength; 30 | WCHAR Name[ 1 ]; 31 | } RTL_ATOM_TABLE_ENTRY, *PRTL_ATOM_TABLE_ENTRY; 32 | 33 | typedef struct _RTL_ATOM_TABLE { 34 | ULONG Signature; 35 | 36 | #if defined(NTOS_KERNEL_RUNTIME) 37 | EX_PUSH_LOCK PushLock; 38 | PHANDLE_TABLE ExHandleTable; 39 | #else 40 | RTL_CRITICAL_SECTION CriticalSection; 41 | RTL_HANDLE_TABLE RtlHandleTable; 42 | #endif 43 | ULONG NumberOfBuckets; 44 | PRTL_ATOM_TABLE_ENTRY Buckets[ 1 ]; 45 | } RTL_ATOM_TABLE, *PRTL_ATOM_TABLE; 46 | 47 | #define RTL_ATOM_TABLE_SIGNATURE (ULONG)'motA' 48 | 49 | typedef struct _RTL_ATOM_HANDLE_TABLE_ENTRY { 50 | USHORT Flags; 51 | USHORT LockCount; 52 | PRTL_ATOM_TABLE_ENTRY Atom; 53 | } RTL_ATOM_HANDLE_TABLE_ENTRY, *PRTL_ATOM_HANDLE_TABLE_ENTRY; 54 | 55 | -------------------------------------------------------------------------------- /public/internal/base/inc/elfkrnl.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | elfkrnl.h 12 | 13 | Abstract: 14 | 15 | This file contains defines for kernel->elf data structures 16 | 17 | --*/ 18 | 19 | #ifndef _ELFKRNL_ 20 | #define _ELFKRNL_ 21 | 22 | #define ELF_PORT_NAME "\\ErrorLogPort" 23 | #define ELF_PORT_NAME_U L"\\ErrorLogPort" 24 | 25 | // 26 | // Type discriminator 27 | // 28 | 29 | typedef enum { 30 | IO_ERROR_LOG = 0, 31 | SM_ERROR_LOG, 32 | } ELF_MESSAGE_TYPE; 33 | 34 | 35 | // 36 | // SM event structure 37 | // 38 | 39 | typedef struct { 40 | LARGE_INTEGER TimeStamp; 41 | NTSTATUS Status; 42 | ULONG StringOffset; 43 | ULONG StringLength; 44 | } SM_ERROR_LOG_MESSAGE, *PSM_ERROR_LOG_MESSAGE; 45 | 46 | 47 | // 48 | // Max size of data sent to the eventlogging service through the LPC port. 49 | // 50 | 51 | #define ELF_PORT_MAX_MESSAGE_LENGTH PORT_MAXIMUM_MESSAGE_LENGTH 52 | 53 | 54 | // 55 | // Structure that is passed in from the system thread to the LPC port 56 | // 57 | 58 | typedef struct { 59 | PORT_MESSAGE PortMessage; 60 | ULONG MessageType; 61 | union { 62 | IO_ERROR_LOG_MESSAGE IoErrorLogMessage; 63 | SM_ERROR_LOG_MESSAGE SmErrorLogMessage; 64 | } u; 65 | } ELF_PORT_MSG, *PELF_PORT_MSG; 66 | 67 | 68 | // 69 | // Structure for the message as a reply from the eventlogging service to 70 | // the LPC client. 71 | // 72 | 73 | typedef struct _ELF_REPLY_MESSAGE { 74 | PORT_MESSAGE PortMessage; 75 | NTSTATUS Status; 76 | } ELF_REPLY_MESSAGE, *PELF_REPLY_MESSAGE; 77 | 78 | #endif // ifndef _ELFLPC_ 79 | 80 | -------------------------------------------------------------------------------- /public/internal/base/inc/hdlsblk.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | hdlsblk.h 12 | 13 | Abstract: 14 | 15 | This module contains the public header information (function prototypes, 16 | data and type declarations) for the Headless Loader Block information. 17 | 18 | --*/ 19 | 20 | #ifndef _HDLSBLK_ 21 | #define _HDLSBLK_ 22 | 23 | // 24 | // Block for passing headless parameters from the loader to the kernel. 25 | // 26 | 27 | typedef struct _HEADLESS_LOADER_BLOCK { 28 | 29 | // 30 | // Where did the COM parameters come from. 31 | // 32 | BOOLEAN UsedBiosSettings; 33 | 34 | // 35 | // COM parameters. 36 | // 37 | UCHAR DataBits; 38 | UCHAR StopBits; 39 | BOOLEAN Parity; 40 | ULONG BaudRate; 41 | ULONG PortNumber; 42 | PUCHAR PortAddress; 43 | 44 | // 45 | // PCI device settings. 46 | // 47 | USHORT PciDeviceId; 48 | USHORT PciVendorId; 49 | UCHAR PciBusNumber; 50 | UCHAR PciSlotNumber; 51 | UCHAR PciFunctionNumber; 52 | ULONG PciFlags; 53 | 54 | GUID SystemGUID; // Machine's GUID. 55 | 56 | BOOLEAN IsMMIODevice; // Is the UART in SYSIO or MMIO space 57 | 58 | // 59 | UCHAR TerminalType; // What kind of terminal do we think 60 | // we're talking to? 61 | // 0 = VT100 62 | // 1 = VT100+ 63 | // 2 = VT-UTF8 64 | // 3 = PC ANSI 65 | // 4-255 = reserved 66 | 67 | } HEADLESS_LOADER_BLOCK, *PHEADLESS_LOADER_BLOCK; 68 | 69 | #endif // _HDLSBLK_ 70 | 71 | -------------------------------------------------------------------------------- /public/internal/base/inc/pnpsetup.h: -------------------------------------------------------------------------------- 1 | /*++ BUILD Version: 0001 // Increment this if a change has global effects 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | pnpsetup.h 12 | 13 | Abstract: 14 | 15 | This file contains the private data, interfaces and definitions 16 | associated with the integration of text mode setup and plug & play. 17 | 18 | --*/ 19 | 20 | #ifndef FAR 21 | #define FAR 22 | #endif 23 | 24 | // 25 | // Private Notification for setupdd.sys during setup 26 | // This should NOT be propagated into any public headers 27 | // 28 | 29 | #ifndef _SETUP_DEVICE_ARRIVAL_NOTIFICATION_DEFINED_ 30 | #define _SETUP_DEVICE_ARRIVAL_NOTIFICATION_DEFINED_ 31 | 32 | typedef struct _SETUP_DEVICE_ARRIVAL_NOTIFICATION { 33 | USHORT Version; 34 | USHORT Size; 35 | GUID Event; 36 | // 37 | // Event-specific data 38 | // 39 | PDEVICE_OBJECT PhysicalDeviceObject; 40 | HANDLE EnumEntryKey; 41 | PUNICODE_STRING EnumPath; 42 | BOOLEAN InstallDriver; 43 | } SETUP_DEVICE_ARRIVAL_NOTIFICATION, *PSETUP_DEVICE_ARRIVAL_NOTIFICATION; 44 | 45 | #endif 46 | 47 | 48 | // 49 | // Device arrival GUID 50 | // 51 | DEFINE_GUID( GUID_SETUP_DEVICE_ARRIVAL, 0xcb3a4000L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x5, 0x3f); 52 | 53 | -------------------------------------------------------------------------------- /public/sdk/inc/diskguid.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | diskguid.h 12 | 13 | Abstract: 14 | 15 | GPT disk GUIDs. 16 | 17 | --*/ 18 | 19 | // 20 | // GPT Partition Type GUIDs 21 | // 22 | // need these GUIDs outside conditional includes so that user can 23 | // #include in precompiled header 24 | // #include in a single source file 25 | // #include in that source file a second time to instantiate the GUIDs 26 | // 27 | 28 | #ifdef DEFINE_GUID 29 | 30 | // 31 | // Make sure FAR is defined... 32 | // 33 | #ifndef FAR 34 | #ifdef _WIN32 35 | #define FAR 36 | #else 37 | #define FAR _far 38 | #endif 39 | #endif 40 | 41 | 42 | // 43 | // Define the GPT partition guids known by disk drivers and volume managers. 44 | // 45 | 46 | DEFINE_GUID(PARTITION_ENTRY_UNUSED_GUID, 0x00000000L, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); // Entry unused 47 | DEFINE_GUID(PARTITION_SYSTEM_GUID, 0xC12A7328L, 0xF81F, 0x11D2, 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B); // EFI system partition 48 | DEFINE_GUID(PARTITION_MSFT_RESERVED_GUID, 0xE3C9E316L, 0x0B5C, 0x4DB8, 0x81, 0x7D, 0xF9, 0x2D, 0xF0, 0x02, 0x15, 0xAE); // Microsoft reserved space 49 | DEFINE_GUID(PARTITION_BASIC_DATA_GUID, 0xEBD0A0A2L, 0xB9E5, 0x4433, 0x87, 0xC0, 0x68, 0xB6, 0xB7, 0x26, 0x99, 0xC7); // Basic data partition 50 | DEFINE_GUID(PARTITION_LDM_METADATA_GUID, 0x5808C8AAL, 0x7E8F, 0x42E0, 0x85, 0xD2, 0xE1, 0xE9, 0x04, 0x34, 0xCF, 0xB3); // Logical Disk Manager metadata partition 51 | DEFINE_GUID(PARTITION_LDM_DATA_GUID, 0xAF9B60A0L, 0x1431, 0x4F62, 0xBC, 0x68, 0x33, 0x11, 0x71, 0x4A, 0x69, 0xAD); // Logical Disk Manager data partition 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /public/sdk/inc/initguid.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // 4 | // You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 5 | // If you do not agree to the terms, do not use the code. 6 | // 7 | // 8 | // Module: 9 | // initguid.h 10 | // 11 | // Abstract: 12 | // Definitions for controlling GUID initialization 13 | // 14 | 15 | #if _MSC_VER > 1000 16 | #pragma once 17 | #endif 18 | 19 | #define INITGUID 20 | #include 21 | 22 | -------------------------------------------------------------------------------- /public/sdk/inc/ntddmup.h: -------------------------------------------------------------------------------- 1 | /*++ BUILD Version: 0001 // Increment this if a change has global effects 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | ntddmup.h 12 | 13 | Abstract: 14 | 15 | This is the include file that defines all constants and types for 16 | accessing the Multiple UNC provider system device. 17 | 18 | --*/ 19 | 20 | #ifndef _NTDDMUP_ 21 | #define _NTDDMUP_ 22 | 23 | #if _MSC_VER > 1000 24 | #pragma once 25 | #endif 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | // 32 | // Device Name - this string is the name of the device. It is the name 33 | // that should be passed to NtOpenFile when accessing the device. 34 | // 35 | // 36 | 37 | #define DD_MUP_DEVICE_NAME L"\\Device\\Mup" // ntifs 38 | 39 | // 40 | // NtFsControlFile FsControlCode values for this device. 41 | // 42 | 43 | #define FSCTL_MUP_REGISTER_UNC_PROVIDER CTL_CODE(FILE_DEVICE_MULTI_UNC_PROVIDER, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) 44 | 45 | // 46 | // Fs control parameter blocks. 47 | // 48 | 49 | typedef struct _REDIRECTOR_REGISTRATION { 50 | ULONG DeviceNameOffset; 51 | ULONG DeviceNameLength; 52 | ULONG ShortNameOffset; 53 | ULONG ShortNameLength; 54 | BOOLEAN MailslotsSupported; 55 | } REDIRECTOR_REGISTRATION, *PREDIRECTOR_REGISTRATION; 56 | 57 | #ifndef _NTIFS_ 58 | 59 | 60 | // begin_ntifs 61 | 62 | #define IOCTL_REDIR_QUERY_PATH CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 99, METHOD_NEITHER, FILE_ANY_ACCESS) 63 | 64 | typedef struct _QUERY_PATH_REQUEST { 65 | ULONG PathNameLength; 66 | PIO_SECURITY_CONTEXT SecurityContext; 67 | WCHAR FilePathName[1]; 68 | } QUERY_PATH_REQUEST, *PQUERY_PATH_REQUEST; 69 | 70 | typedef struct _QUERY_PATH_RESPONSE { 71 | ULONG LengthAccepted; 72 | } QUERY_PATH_RESPONSE, *PQUERY_PATH_RESPONSE; 73 | 74 | // end_ntifs 75 | 76 | #endif // _NTIFS_ 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif // _NTDDMUP_ 82 | 83 | -------------------------------------------------------------------------------- /public/sdk/inc/ntddnull.h: -------------------------------------------------------------------------------- 1 | /*++ BUILD Version: 0001 // Increment this if a change has global effects 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | ntddnull.h 12 | 13 | Abstract: 14 | 15 | This is the include file that defines all constants and types for 16 | accessing the Null device. 17 | 18 | --*/ 19 | 20 | #ifndef _NTDDNULL_ 21 | #define _NTDDNULL_ 22 | 23 | #if _MSC_VER > 1000 24 | #pragma once 25 | #endif 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | // 32 | // Device Name - this string is the name of the device. It is the name 33 | // that should be passed to NtOpenFile when accessing the device. 34 | // 35 | // Note: For devices that support multiple units, it should be suffixed 36 | // with the Ascii representation of the unit number. 37 | // 38 | 39 | #define DD_NULL_DEVICE_NAME "\\Device\\Null" 40 | 41 | 42 | // 43 | // NtDeviceIoControlFile IoControlCode values for this device. 44 | // 45 | // Warning: Remember that the low two bits of the code specify how the 46 | // buffers are passed to the driver! 47 | // 48 | 49 | #define IOCTL_NULL_BASE FILE_DEVICE_NULL 50 | 51 | 52 | // 53 | // NtDeviceIoControlFile InputBuffer/OutputBuffer record structures for 54 | // this device. 55 | // 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif // _NTDDNULL_ 62 | 63 | -------------------------------------------------------------------------------- /public/sdk/inc/ntia64.h: -------------------------------------------------------------------------------- 1 | /*++ BUILD Version: 0011 // Increment this if a change has global effects 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | ntia64.h 12 | 13 | Abstract: 14 | 15 | User-mode visible IA64 specific structures and constants 16 | 17 | --*/ 18 | 19 | #ifndef _NTIA64H_ 20 | #define _NTIA64H_ 21 | 22 | #if _MSC_VER > 1000 23 | #pragma once 24 | #endif 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #include "ia64inst.h" 31 | 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif // _NTIA64H_ 38 | 39 | -------------------------------------------------------------------------------- /public/sdk/inc/ntnls.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | ntnls.h 12 | 13 | Abstract: 14 | 15 | NLS file formats and data types 16 | 17 | --*/ 18 | 19 | #ifndef _NTNLS_ 20 | #define _NTNLS_ 21 | 22 | #if _MSC_VER > 1000 23 | #pragma once 24 | #endif 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #define MAXIMUM_LEADBYTES 12 31 | 32 | typedef struct _CPTABLEINFO { 33 | USHORT CodePage; // code page number 34 | USHORT MaximumCharacterSize; // max length (bytes) of a char 35 | USHORT DefaultChar; // default character (MB) 36 | USHORT UniDefaultChar; // default character (Unicode) 37 | USHORT TransDefaultChar; // translation of default char (Unicode) 38 | USHORT TransUniDefaultChar; // translation of Unic default char (MB) 39 | USHORT DBCSCodePage; // Non 0 for DBCS code pages 40 | UCHAR LeadByte[MAXIMUM_LEADBYTES]; // lead byte ranges 41 | PUSHORT MultiByteTable; // pointer to MB translation table 42 | PVOID WideCharTable; // pointer to WC translation table 43 | PUSHORT DBCSRanges; // pointer to DBCS ranges 44 | PUSHORT DBCSOffsets; // pointer to DBCS offsets 45 | } CPTABLEINFO, *PCPTABLEINFO; 46 | 47 | typedef struct _NLSTABLEINFO { 48 | CPTABLEINFO OemTableInfo; 49 | CPTABLEINFO AnsiTableInfo; 50 | PUSHORT UpperCaseTable; // 844 format upcase table 51 | PUSHORT LowerCaseTable; // 844 format lower case table 52 | } NLSTABLEINFO, *PNLSTABLEINFO; 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif // _NTNLS_ 59 | 60 | -------------------------------------------------------------------------------- /public/sdk/inc/nxamd64.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | nxamd64.w 12 | 13 | Abstract: 14 | 15 | User mode visible AMD64 specific structures and constants. 16 | 17 | This file contains platform specific definitions that are included 18 | after all other files have been included from nt.h. 19 | 20 | --*/ 21 | 22 | #ifndef _NXAMD64_ 23 | #define _NXAMD64_ 24 | 25 | #if _MSC_VER > 1000 26 | #pragma once 27 | #endif 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | // 34 | // Define platform specific functions to access the TEB. 35 | // 36 | 37 | // begin_winnt 38 | 39 | #if defined(_M_AMD64) && !defined(__midl) 40 | 41 | __forceinline 42 | struct _TEB * 43 | NtCurrentTeb ( 44 | VOID 45 | ) 46 | 47 | { 48 | return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self)); 49 | } 50 | 51 | __forceinline 52 | PVOID 53 | GetCurrentFiber ( 54 | VOID 55 | ) 56 | 57 | { 58 | 59 | return (PVOID)__readgsqword(FIELD_OFFSET(NT_TIB, FiberData)); 60 | } 61 | 62 | __forceinline 63 | PVOID 64 | GetFiberData ( 65 | VOID 66 | ) 67 | 68 | { 69 | 70 | return *(PVOID *)GetCurrentFiber(); 71 | } 72 | 73 | #endif // _M_AMD64 && !defined(__midl) 74 | 75 | // end_winnt 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif // _NXAMD64_ 82 | 83 | -------------------------------------------------------------------------------- /public/sdk/inc/nxi386.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | nxi386.w 12 | 13 | Abstract: 14 | 15 | User mode visible X86 specific structures and constants. 16 | 17 | This file contains platform specific definitions that are included 18 | after all other files have been included from nt.h. 19 | 20 | --*/ 21 | 22 | #ifndef _NXI386_ 23 | #define _NXI386_ 24 | 25 | #if _MSC_VER > 1000 26 | #pragma once 27 | #endif 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | // 34 | // Define platform specific functions to access the TEB. 35 | // 36 | 37 | // begin_winnt 38 | 39 | #if defined(_M_IX86) && !defined(MIDL_PASS) 40 | 41 | #define PcTeb 0x18 42 | 43 | #if (_MSC_FULL_VER >= 13012035) 44 | 45 | __inline struct _TEB * NtCurrentTeb( void ) { return (struct _TEB *) (ULONG_PTR) __readfsdword (PcTeb); } 46 | 47 | #else 48 | 49 | #if _MSC_VER >= 1200 50 | #pragma warning(push) 51 | #endif 52 | 53 | #pragma warning (disable:4035) // disable 4035 (function must return something) 54 | 55 | __inline struct _TEB * NtCurrentTeb( void ) { __asm mov eax, fs:[PcTeb] } 56 | 57 | #if _MSC_VER >= 1200 58 | #pragma warning(pop) 59 | #else 60 | #pragma warning (default:4035) // reenable it 61 | #endif 62 | 63 | #endif 64 | 65 | #endif // defined(_M_IX86) && !defined(MIDL_PASS) 66 | 67 | // end_winnt 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif // _NXI386_ 74 | 75 | -------------------------------------------------------------------------------- /public/sdk/inc/poppack.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | poppack.h 12 | 13 | Abstract: 14 | 15 | This file turns packing of structures off. (That is, it enables 16 | automatic alignment of structure fields.) An include file is needed 17 | because various compilers do this in different ways. 18 | 19 | poppack.h is the complement to pshpack?.h. An inclusion of poppack.h 20 | MUST ALWAYS be preceded by an inclusion of one of pshpack?.h, in one-to-one 21 | correspondence. 22 | 23 | For Microsoft compatible compilers, this file uses the pop option 24 | to the pack pragma so that it can restore the previous saved by the 25 | pshpack?.h include file. 26 | 27 | --*/ 28 | 29 | #if ! (defined(lint) || defined(RC_INVOKED)) 30 | #if ( _MSC_VER >= 800 && !defined(_M_I86)) || defined(_PUSHPOP_SUPPORTED) 31 | #pragma warning(disable:4103) 32 | #if !(defined( MIDL_PASS )) || defined( __midl ) 33 | #pragma pack(pop) 34 | #else 35 | #pragma pack() 36 | #endif 37 | #else 38 | #pragma pack() 39 | #endif 40 | #endif // ! (defined(lint) || defined(RC_INVOKED)) 41 | 42 | -------------------------------------------------------------------------------- /public/sdk/inc/pshpack1.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | pshpack1.h 12 | 13 | Abstract: 14 | 15 | This file turns 1 byte packing of structures on. (That is, it disables 16 | automatic alignment of structure fields.) An include file is needed 17 | because various compilers do this in different ways. For Microsoft 18 | compatible compilers, this files uses the push option to the pack pragma 19 | so that the poppack.h include file can restore the previous packing 20 | reliably. 21 | 22 | The file poppack.h is the complement to this file. 23 | 24 | --*/ 25 | 26 | #if ! (defined(lint) || defined(RC_INVOKED)) 27 | #if ( _MSC_VER >= 800 && !defined(_M_I86)) || defined(_PUSHPOP_SUPPORTED) 28 | #pragma warning(disable:4103) 29 | #if !(defined( MIDL_PASS )) || defined( __midl ) 30 | #pragma pack(push,1) 31 | #else 32 | #pragma pack(1) 33 | #endif 34 | #else 35 | #pragma pack(1) 36 | #endif 37 | #endif // ! (defined(lint) || defined(RC_INVOKED)) 38 | 39 | -------------------------------------------------------------------------------- /public/sdk/inc/pshpack2.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | pshpack2.h 12 | 13 | Abstract: 14 | 15 | This file turns 2 byte packing of structures on. (That is, it disables 16 | automatic alignment of structure fields.) An include file is needed 17 | because various compilers do this in different ways. For Microsoft 18 | compatible compilers, this files uses the push option to the pack pragma 19 | so that the poppack.h include file can restore the previous packing 20 | reliably. 21 | 22 | The file poppack.h is the complement to this file. 23 | 24 | --*/ 25 | 26 | #if ! (defined(lint) || defined(RC_INVOKED)) 27 | #if ( _MSC_VER >= 800 && !defined(_M_I86)) || defined(_PUSHPOP_SUPPORTED) 28 | #pragma warning(disable:4103) 29 | #if !(defined( MIDL_PASS )) || defined( __midl ) 30 | #pragma pack(push,2) 31 | #else 32 | #pragma pack(2) 33 | #endif 34 | #else 35 | #pragma pack(2) 36 | #endif 37 | #endif // ! (defined(lint) || defined(RC_INVOKED)) 38 | 39 | -------------------------------------------------------------------------------- /public/sdk/inc/pshpack4.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | pshpack4.h 12 | 13 | Abstract: 14 | 15 | This file turns 4 byte packing of structures on. (That is, it disables 16 | automatic alignment of structure fields.) An include file is needed 17 | because various compilers do this in different ways. For Microsoft 18 | compatible compilers, this files uses the push option to the pack pragma 19 | so that the poppack.h include file can restore the previous packing 20 | reliably. 21 | 22 | The file poppack.h is the complement to this file. 23 | 24 | --*/ 25 | 26 | #if ! (defined(lint) || defined(RC_INVOKED)) 27 | #if ( _MSC_VER >= 800 && !defined(_M_I86)) || defined(_PUSHPOP_SUPPORTED) 28 | #pragma warning(disable:4103) 29 | #if !(defined( MIDL_PASS )) || defined( __midl ) 30 | #pragma pack(push,4) 31 | #else 32 | #pragma pack(4) 33 | #endif 34 | #else 35 | #pragma pack(4) 36 | #endif 37 | #endif // ! (defined(lint) || defined(RC_INVOKED)) 38 | 39 | -------------------------------------------------------------------------------- /public/sdk/inc/pshpack8.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | pshpack8.h 12 | 13 | Abstract: 14 | 15 | This file turns 8 byte packing of structures on. (That is, it disables 16 | automatic alignment of structure fields.) An include file is needed 17 | because various compilers do this in different ways. For Microsoft 18 | compatible compilers, this files uses the push option to the pack pragma 19 | so that the poppack.h include file can restore the previous packing 20 | reliably. 21 | 22 | The file poppack.h is the complement to this file. 23 | 24 | --*/ 25 | 26 | #if ! (defined(lint) || defined(RC_INVOKED)) 27 | #if ( _MSC_VER >= 800 && !defined(_M_I86)) || defined(_PUSHPOP_SUPPORTED) 28 | #pragma warning(disable:4103) 29 | #if !(defined( MIDL_PASS )) || defined( __midl ) 30 | #pragma pack(push,8) 31 | #else 32 | #pragma pack(8) 33 | #endif 34 | #else 35 | #pragma pack(8) 36 | #endif 37 | #endif // ! (defined(lint) || defined(RC_INVOKED)) 38 | 39 | -------------------------------------------------------------------------------- /public/sdk/inc/pshpck16.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | pshpack8.h 12 | 13 | Abstract: 14 | 15 | This file turns 8 byte packing of structures on. (That is, it disables 16 | automatic alignment of structure fields.) An include file is needed 17 | because various compilers do this in different ways. For Microsoft 18 | compatible compilers, this files uses the push option to the pack pragma 19 | so that the poppack.h include file can restore the previous packing 20 | reliably. 21 | 22 | The file poppack.h is the complement to this file. 23 | 24 | --*/ 25 | 26 | #if ! (defined(lint) || defined(RC_INVOKED)) 27 | #if ( _MSC_VER >= 800 ) || defined(_PUSHPOP_SUPPORTED) 28 | #pragma warning(disable:4103) 29 | #if !(defined( MIDL_PASS )) || defined( __midl ) 30 | #pragma pack(push,16) 31 | #else 32 | #pragma pack(16) 33 | #endif 34 | #else 35 | #pragma pack(16) 36 | #endif 37 | #endif // ! (defined(lint) || defined(RC_INVOKED)) 38 | 39 | -------------------------------------------------------------------------------- /public/sdk/inc/safeboot.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt). 6 | If you do not agree to the terms, do not use the code. 7 | 8 | 9 | Module Name: 10 | 11 | safeboot.h 12 | 13 | Abstract: 14 | 15 | This module contains all safe boot code. 16 | 17 | --*/ 18 | 19 | #ifndef _SAFEBOOT_ 20 | #define _SAFEBOOT_ 21 | 22 | #if _MSC_VER > 1000 23 | #pragma once 24 | #endif 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | // 31 | // define the safeboot options 32 | // 33 | 34 | #define SAFEBOOT_MINIMAL 1 35 | #define SAFEBOOT_NETWORK 2 36 | #define SAFEBOOT_DSREPAIR 3 37 | 38 | #define SAFEBOOT_LOAD_OPTION_W L"SAFEBOOT:" 39 | #define SAFEBOOT_MINIMAL_STR_W L"MINIMAL" 40 | #define SAFEBOOT_NETWORK_STR_W L"NETWORK" 41 | #define SAFEBOOT_DSREPAIR_STR_W L"DSREPAIR" 42 | #define SAFEBOOT_ALTERNATESHELL_STR_W L"(ALTERNATESHELL)" 43 | 44 | #define SAFEBOOT_LOAD_OPTION_A "SAFEBOOT:" 45 | #define SAFEBOOT_MINIMAL_STR_A "MINIMAL" 46 | #define SAFEBOOT_NETWORK_STR_A "NETWORK" 47 | #define SAFEBOOT_DSREPAIR_STR_A "DSREPAIR" 48 | #define SAFEBOOT_ALTERNATESHELL_STR_A "(ALTERNATESHELL)" 49 | 50 | #define BOOTLOG_STRSIZE 256 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif // _NTPNPAPI_ 57 | 58 | -------------------------------------------------------------------------------- /tools/amd64/1033/clui.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/1033/clui.dll -------------------------------------------------------------------------------- /tools/amd64/c1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/c1.dll -------------------------------------------------------------------------------- /tools/amd64/c2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/c2.dll -------------------------------------------------------------------------------- /tools/amd64/checktoolarch.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set toolarch=amd64 4 | 5 | if /I x%1 == x%toolarch% ( 6 | exit /B 0 7 | ) else ( 8 | echo must have WRK\tools\%toolarch% in path 9 | exit /B 1 10 | ) 11 | 12 | -------------------------------------------------------------------------------- /tools/amd64/cl.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/cl.exe -------------------------------------------------------------------------------- /tools/amd64/cvtres.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/cvtres.exe -------------------------------------------------------------------------------- /tools/amd64/lib.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/lib.exe -------------------------------------------------------------------------------- /tools/amd64/link.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/link.exe -------------------------------------------------------------------------------- /tools/amd64/mc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/mc.exe -------------------------------------------------------------------------------- /tools/amd64/ml64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/ml64.exe -------------------------------------------------------------------------------- /tools/amd64/msobj80.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/msobj80.dll -------------------------------------------------------------------------------- /tools/amd64/mspdb80.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/mspdb80.dll -------------------------------------------------------------------------------- /tools/amd64/msvcp80.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/msvcp80.dll -------------------------------------------------------------------------------- /tools/amd64/msvcr80.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/msvcr80.dll -------------------------------------------------------------------------------- /tools/amd64/nmake.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/nmake.exe -------------------------------------------------------------------------------- /tools/amd64/rc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/rc.exe -------------------------------------------------------------------------------- /tools/amd64/rcdll.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/amd64/rcdll.dll -------------------------------------------------------------------------------- /tools/x86/c1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/c1.dll -------------------------------------------------------------------------------- /tools/x86/c1p.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/c1p.dll -------------------------------------------------------------------------------- /tools/x86/c2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/c2.dll -------------------------------------------------------------------------------- /tools/x86/checktoolarch.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set toolarch=x86 4 | 5 | if /I x%1 == x%toolarch% ( 6 | exit /B 0 7 | ) else ( 8 | echo must have WRK\tools\%toolarch% in path 9 | exit /B 1 10 | ) 11 | 12 | -------------------------------------------------------------------------------- /tools/x86/cl.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/cl.exe -------------------------------------------------------------------------------- /tools/x86/cvtres.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/cvtres.exe -------------------------------------------------------------------------------- /tools/x86/lib.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/lib.exe -------------------------------------------------------------------------------- /tools/x86/link.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/link.exe -------------------------------------------------------------------------------- /tools/x86/mc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/mc.exe -------------------------------------------------------------------------------- /tools/x86/ml.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/ml.exe -------------------------------------------------------------------------------- /tools/x86/msobj71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/msobj71.dll -------------------------------------------------------------------------------- /tools/x86/mspdb70.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/mspdb70.dll -------------------------------------------------------------------------------- /tools/x86/mspdb71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/mspdb71.dll -------------------------------------------------------------------------------- /tools/x86/msvcr70.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/msvcr70.dll -------------------------------------------------------------------------------- /tools/x86/nmake.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/nmake.exe -------------------------------------------------------------------------------- /tools/x86/rc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/rc.exe -------------------------------------------------------------------------------- /tools/x86/rcdll.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/9176324/WRK/a339aed187c17c027f0ecaa3d6551a0bc8612d0f/tools/x86/rcdll.dll --------------------------------------------------------------------------------