Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add stub SetEnvironmentVariableA #44

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -2903,6 +2903,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 @@ -3920,6 +3926,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 @@ -4137,7 +4149,7 @@ pub mod kernel32 {
is_async: true,
};
}
const SHIMS: [Shim; 149usize] = [
const SHIMS: [Shim; 150usize] = [
shims::AcquireSRWLockExclusive,
shims::AcquireSRWLockShared,
shims::AddVectoredExceptionHandler,
Expand Down Expand Up @@ -4251,6 +4263,7 @@ pub mod kernel32 {
shims::RemoveDirectoryA,
shims::SetConsoleCtrlHandler,
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