Trait winsafe::prelude::kernel_Hprocess

source ·
pub trait kernel_Hprocess: Handle {
Show 21 methods // Provided methods fn CheckRemoteDebuggerPresent(&self) -> SysResult<bool> { ... } fn CreateProcess( application_name: Option<&str>, command_line: Option<&str>, process_attrs: Option<&mut SECURITY_ATTRIBUTES<'_>>, thread_attrs: Option<&mut SECURITY_ATTRIBUTES<'_>>, inherit_handles: bool, creation_flags: CREATE, environment: Option<Vec<(&str, &str)>>, current_dir: Option<&str>, si: &mut STARTUPINFO<'_, '_> ) -> SysResult<CloseHandlePiGuard> { ... } fn FlushInstructionCache( &self, base_address: *mut c_void, size: usize ) -> SysResult<()> { ... } fn GetCurrentProcess() -> HPROCESS { ... } fn GetExitCodeProcess(&self) -> SysResult<u32> { ... } fn GetGuiResources(&self, flags: GR) -> SysResult<u32> { ... } fn GetPriorityClass(&self) -> SysResult<PRIORITY_CLASS> { ... } fn GetProcessHandleCount(&self) -> SysResult<u32> { ... } fn GetProcessId(&self) -> SysResult<u32> { ... } fn GetProcessTimes( &self, creation: &mut FILETIME, exit: &mut FILETIME, kernel: &mut FILETIME, user: &mut FILETIME ) -> SysResult<()> { ... } fn IsProcessCritical(&self) -> SysResult<bool> { ... } fn IsWow64Process(&self) -> SysResult<bool> { ... } fn OpenProcess( desired_access: PROCESS, inherit_handle: bool, process_id: u32 ) -> SysResult<CloseHandleGuard<HPROCESS>> { ... } fn OpenProcessToken( &self, desired_access: TOKEN ) -> SysResult<CloseHandleGuard<HACCESSTOKEN>> { ... } fn QueryFullProcessImageName( &self, flags: PROCESS_NAME ) -> SysResult<String> { ... } fn QueryProcessAffinityUpdateMode(&self) -> SysResult<PROCESS_AFFINITY> { ... } fn SetPriorityClass(&self, prority_class: PRIORITY_CLASS) -> SysResult<()> { ... } fn SetProcessAffinityUpdateMode( &self, flags: PROCESS_AFFINITY ) -> SysResult<()> { ... } fn SetProcessPriorityBoost( &self, disable_priority_boost: bool ) -> SysResult<()> { ... } fn TerminateProcess(&self, exit_code: u32) -> SysResult<()> { ... } fn WaitForSingleObject(&self, milliseconds: Option<u32>) -> SysResult<WAIT> { ... }
}
Available on crate feature kernel only.
Expand description

This trait is enabled with the kernel feature, and provides methods for HPROCESS.

Prefer importing this trait through the prelude:

use winsafe::prelude::*;

Provided Methods§

source

fn CheckRemoteDebuggerPresent(&self) -> SysResult<bool>

source

fn CreateProcess( application_name: Option<&str>, command_line: Option<&str>, process_attrs: Option<&mut SECURITY_ATTRIBUTES<'_>>, thread_attrs: Option<&mut SECURITY_ATTRIBUTES<'_>>, inherit_handles: bool, creation_flags: CREATE, environment: Option<Vec<(&str, &str)>>, current_dir: Option<&str>, si: &mut STARTUPINFO<'_, '_> ) -> SysResult<CloseHandlePiGuard>

CreateProcess function.

source

fn FlushInstructionCache( &self, base_address: *mut c_void, size: usize ) -> SysResult<()>

source

fn GetCurrentProcess() -> HPROCESS

source

fn GetExitCodeProcess(&self) -> SysResult<u32>

source

fn GetGuiResources(&self, flags: GR) -> SysResult<u32>

GetGuiResources function.

source

fn GetPriorityClass(&self) -> SysResult<PRIORITY_CLASS>

GetPriorityClass function.

source

fn GetProcessHandleCount(&self) -> SysResult<u32>

source

fn GetProcessId(&self) -> SysResult<u32>

GetProcessId function.

source

fn GetProcessTimes( &self, creation: &mut FILETIME, exit: &mut FILETIME, kernel: &mut FILETIME, user: &mut FILETIME ) -> SysResult<()>

GetProcessTimes function.

source

fn IsProcessCritical(&self) -> SysResult<bool>

source

fn IsWow64Process(&self) -> SysResult<bool>

IsWow64Process function.

source

fn OpenProcess( desired_access: PROCESS, inherit_handle: bool, process_id: u32 ) -> SysResult<CloseHandleGuard<HPROCESS>>

OpenProcess function.

This method will return ERROR::INVALID_PARAMETER if you try to open a system process.

source

fn OpenProcessToken( &self, desired_access: TOKEN ) -> SysResult<CloseHandleGuard<HACCESSTOKEN>>

OpenProcessToken function.

§Examples
use winsafe::{self as w, prelude::*, co};

let htoken = w::HPROCESS::GetCurrentProcess()
    .OpenProcessToken(co::TOKEN::ADJUST_PRIVILEGES | co::TOKEN::QUERY)?;
source

fn QueryFullProcessImageName(&self, flags: PROCESS_NAME) -> SysResult<String>

source

fn QueryProcessAffinityUpdateMode(&self) -> SysResult<PROCESS_AFFINITY>

source

fn SetPriorityClass(&self, prority_class: PRIORITY_CLASS) -> SysResult<()>

SetPriorityClass function.

source

fn SetProcessAffinityUpdateMode(&self, flags: PROCESS_AFFINITY) -> SysResult<()>

source

fn SetProcessPriorityBoost(&self, disable_priority_boost: bool) -> SysResult<()>

source

fn TerminateProcess(&self, exit_code: u32) -> SysResult<()>

TerminateProcess function.

source

fn WaitForSingleObject(&self, milliseconds: Option<u32>) -> SysResult<WAIT>

Object Safety§

This trait is not object safe.

Implementors§