Skip to content

Commit

Permalink
add stub SetEnvironmentVariableA
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusU committed Sep 13, 2024
1 parent 1fe6e44 commit 5ca61fa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
Binary file modified win32/dll/kernel32.dll
Binary file not shown.
15 changes: 14 additions & 1 deletion win32/src/winapi/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2908,6 +2908,12 @@ pub mod kernel32 {
let hFile = <HFILE>::from_stack(mem, esp + 4u32);
winapi::kernel32::SetEndOfFile(machine, hFile).to_raw()
}
pub unsafe fn SetEnvironmentVariableA(machine: &mut Machine, esp: u32) -> u32 {
let mem = machine.mem().detach();
let name = <Option<&str>>::from_stack(mem, esp + 4u32);
let value = <Option<&str>>::from_stack(mem, esp + 8u32);
winapi::kernel32::SetEnvironmentVariableA(machine, name, value).to_raw()
}
pub unsafe fn SetEvent(machine: &mut Machine, esp: u32) -> u32 {
let mem = machine.mem().detach();
let hEvent = <HANDLE<()>>::from_stack(mem, esp + 4u32);
Expand Down Expand Up @@ -3931,6 +3937,12 @@ pub mod kernel32 {
stack_consumed: 4u32,
is_async: false,
};
pub const SetEnvironmentVariableA: Shim = Shim {
name: "SetEnvironmentVariableA",
func: impls::SetEnvironmentVariableA,
stack_consumed: 8u32,
is_async: false,
};
pub const SetEvent: Shim = Shim {
name: "SetEvent",
func: impls::SetEvent,
Expand Down Expand Up @@ -4148,7 +4160,7 @@ pub mod kernel32 {
is_async: true,
};
}
const SHIMS: [Shim; 150usize] = [
const SHIMS: [Shim; 151usize] = [
shims::AcquireSRWLockExclusive,
shims::AcquireSRWLockShared,
shims::AddVectoredExceptionHandler,
Expand Down Expand Up @@ -4263,6 +4275,7 @@ pub mod kernel32 {
shims::SetConsoleCtrlHandler,
shims::SetCurrentDirectoryA,
shims::SetEndOfFile,
shims::SetEnvironmentVariableA,
shims::SetEvent,
shims::SetFileAttributesA,
shims::SetFilePointer,
Expand Down
9 changes: 9 additions & 0 deletions win32/src/winapi/kernel32/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ pub fn GetEnvironmentVariableW(
false
}

#[win32_derive::dllexport]
pub fn SetEnvironmentVariableA(
_machine: &mut Machine,
name: Option<&str>,
value: Option<&str>,
) -> bool {
true
}

#[derive(Debug, win32_derive::TryFromEnum)]
pub enum ProcessorFeature {
FLOATING_POINT_PRECISION_ERRATA = 0,
Expand Down

0 comments on commit 5ca61fa

Please sign in to comment.