pub struct WindowsKernelProcessorBlock<'a, Driver>{ /* private fields */ }Expand description
A Windows kernel processor control block (KPRCB).
The KPRCB is an opaque, per-processor structure embedded within
the KPCR. While the KPCR (_KPCR) is the top-level per-processor
region (anchored at gs:[0]), the KPRCB is its main body, holding
the current/next/idle thread pointers, saved processor context,
and scheduling state.
§Implementation Details
Corresponds to _KPRCB.
Implementations§
Source§impl<'a, Driver> WindowsKernelProcessorBlock<'a, Driver>
impl<'a, Driver> WindowsKernelProcessorBlock<'a, Driver>
Sourcepub fn new(vmi: VmiState<'a, WindowsOs<Driver>>, va: Va) -> Self
pub fn new(vmi: VmiState<'a, WindowsOs<Driver>>, va: Va) -> Self
Creates a new kernel processor control block.
Sourcepub fn current_thread(&self) -> Result<WindowsThread<'a, Driver>, VmiError>
pub fn current_thread(&self) -> Result<WindowsThread<'a, Driver>, VmiError>
Returns the thread currently executing on this processor.
§Implementation Details
Corresponds to _KPRCB.CurrentThread.
Sourcepub fn next_thread(&self) -> Result<Option<WindowsThread<'a, Driver>>, VmiError>
pub fn next_thread(&self) -> Result<Option<WindowsThread<'a, Driver>>, VmiError>
Returns the next thread scheduled to execute on this processor, if any.
§Implementation Details
Corresponds to _KPRCB.NextThread.
Sourcepub fn idle_thread(&self) -> Result<WindowsThread<'a, Driver>, VmiError>
pub fn idle_thread(&self) -> Result<WindowsThread<'a, Driver>, VmiError>
Returns the idle thread for this processor.
§Implementation Details
Corresponds to _KPRCB.IdleThread.
Sourcepub fn processor_special_registers(
&self,
) -> Result<impl WindowsSpecialRegisters, VmiError>
pub fn processor_special_registers( &self, ) -> Result<impl WindowsSpecialRegisters, VmiError>
Returns the processor’s special registers.
§Implementation Details
Corresponds to _KPRCB.ProcessorState.SpecialRegisters.
Sourcepub fn processor_context(&self) -> Result<impl WindowsContext, VmiError>
pub fn processor_context(&self) -> Result<impl WindowsContext, VmiError>
Returns the processor’s saved thread context.
On Windows 7 and later, reads the context via _KPRCB.Context pointer,
which may reference a dynamically-allocated buffer for extended state
(XSAVE/AVX). Falls back to the embedded ProcessorState.ContextFrame
when the pointer is NULL (pre-Win7 or early boot).
§Implementation Details
Corresponds to _KPRCB.Context if non-NULL,
otherwise _KPRCB.ProcessorState.ContextFrame.
Sourcepub fn processor_context_frame(&self) -> Result<impl WindowsContext, VmiError>
pub fn processor_context_frame(&self) -> Result<impl WindowsContext, VmiError>
Returns the processor’s saved thread context, read directly from the
embedded ProcessorState.ContextFrame.
Useful when the _KPRCB.Context is unpopulated. Crash dumps from older
Windows builds (Windows 7) leave _KPRCB.Context zero on the crashing
CPU and write the registers into the embedded frame instead.
§Implementation Details
Corresponds to _KPRCB.ProcessorState.ContextFrame.
Trait Implementations§
Source§impl<Driver> VmiVa for WindowsKernelProcessorBlock<'_, Driver>
impl<Driver> VmiVa for WindowsKernelProcessorBlock<'_, Driver>
Auto Trait Implementations§
impl<'a, Driver> !RefUnwindSafe for WindowsKernelProcessorBlock<'a, Driver>
impl<'a, Driver> !Send for WindowsKernelProcessorBlock<'a, Driver>
impl<'a, Driver> !Sync for WindowsKernelProcessorBlock<'a, Driver>
impl<'a, Driver> !UnwindSafe for WindowsKernelProcessorBlock<'a, Driver>
impl<'a, Driver> Freeze for WindowsKernelProcessorBlock<'a, Driver>
impl<'a, Driver> Unpin for WindowsKernelProcessorBlock<'a, Driver>
impl<'a, Driver> UnsafeUnpin for WindowsKernelProcessorBlock<'a, Driver>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.