Skip to content

Commit

Permalink
more user32
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonros committed Dec 30, 2024
1 parent ded0ef4 commit 798ec10
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libmwemu/src/winapi64/user32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub fn gateway(addr: u64, emu: &mut emu::Emu) -> String {
"MessageBoxA" => MessageBoxA(emu),
"GetDesktopWindow" => GetDesktopWindow(emu),
"GetSystemMetrics" => GetSystemMetrics(emu),
"SystemParametersInfoA" => SystemParametersInfoA(emu),
_ => {
if emu.cfg.skip_unimplemented == false {
if emu.cfg.dump_on_exit && emu.cfg.dump_filename.is_some() {
Expand Down Expand Up @@ -70,4 +71,17 @@ fn GetSystemMetrics(emu: &mut emu::Emu) {
emu.regs.rax = 0;
}

/*
BOOL SystemParametersInfoA(
[in] UINT uiAction,
[in] UINT uiParam,
[in, out] PVOID pvParam,
[in] UINT fWinIni
);
*/
fn SystemParametersInfoA(emu: &mut emu::Emu) {
log_red!(emu, "** {} user32!SystemParametersInfoA", emu.pos);
// TODO: write pvParam
emu.regs.rax = 1;
}

14 changes: 14 additions & 0 deletions libmwemu/src/winapi64/uxtheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ pub fn gateway(addr: u64, emu: &mut emu::Emu) -> String {
let api = winapi64::kernel32::guess_api_name(emu, addr);
match api.as_str() {
"IsAppThemed" => IsAppThemed(emu),
"IsThemeActive" => IsThemeActive(emu),
"GetThemeAppProperties" => GetThemeAppProperties(emu),
_ => {
if emu.cfg.skip_unimplemented == false {
if emu.cfg.dump_on_exit && emu.cfg.dump_filename.is_some() {
Expand All @@ -22,6 +24,18 @@ pub fn gateway(addr: u64, emu: &mut emu::Emu) -> String {
}

fn IsAppThemed(emu: &mut emu::Emu) {
log_red!(emu, "** {} uxtheme!IsAppThemed", emu.pos);
emu.regs.rax = 1;
}

fn IsThemeActive(emu: &mut emu::Emu) {
log_red!(emu, "** {} uxtheme!IsThemeActive", emu.pos);
emu.regs.rax = 1;
}

fn GetThemeAppProperties(emu: &mut emu::Emu) {
log_red!(emu, "** {} uxtheme!GetThemeAppProperties", emu.pos);
emu.regs.rax = 1;
}


0 comments on commit 798ec10

Please sign in to comment.