Skip to content

Commit

Permalink
add SetMenuItemInfoA stub
Browse files Browse the repository at this point in the history
  • Loading branch information
LinusU authored and evmar committed Sep 15, 2024
1 parent 1a9423a commit b998e57
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Binary file modified win32/dll/user32.dll
Binary file not shown.
17 changes: 16 additions & 1 deletion win32/src/winapi/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5825,6 +5825,14 @@ pub mod user32 {
let hMenu = <HMENU>::from_stack(mem, esp + 8u32);
winapi::user32::SetMenu(machine, hWnd, hMenu).to_raw()
}
pub unsafe fn SetMenuItemInfoA(machine: &mut Machine, esp: u32) -> u32 {
let mem = machine.mem().detach();
let hMenu = <HMENU>::from_stack(mem, esp + 4u32);
let item = <u32>::from_stack(mem, esp + 8u32);
let fByPosition = <bool>::from_stack(mem, esp + 12u32);
let lpmii = <u32>::from_stack(mem, esp + 16u32);
winapi::user32::SetMenuItemInfoA(machine, hMenu, item, fByPosition, lpmii).to_raw()
}
pub unsafe fn SetRect(machine: &mut Machine, esp: u32) -> u32 {
let mem = machine.mem().detach();
let lprc = <Option<&mut RECT>>::from_stack(mem, esp + 4u32);
Expand Down Expand Up @@ -6457,6 +6465,12 @@ pub mod user32 {
stack_consumed: 8u32,
is_async: false,
};
pub const SetMenuItemInfoA: Shim = Shim {
name: "SetMenuItemInfoA",
func: impls::SetMenuItemInfoA,
stack_consumed: 16u32,
is_async: false,
};
pub const SetRect: Shim = Shim {
name: "SetRect",
func: impls::SetRect,
Expand Down Expand Up @@ -6536,7 +6550,7 @@ pub mod user32 {
is_async: false,
};
}
const SHIMS: [Shim; 89usize] = [
const SHIMS: [Shim; 90usize] = [
shims::AdjustWindowRect,
shims::AdjustWindowRectEx,
shims::AppendMenuA,
Expand Down Expand Up @@ -6613,6 +6627,7 @@ pub mod user32 {
shims::SetFocus,
shims::SetForegroundWindow,
shims::SetMenu,
shims::SetMenuItemInfoA,
shims::SetRect,
shims::SetRectEmpty,
shims::SetTimer,
Expand Down
5 changes: 5 additions & 0 deletions win32/src/winapi/user32/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ pub fn SetMenu(_machine: &mut Machine, hWnd: HWND, hMenu: HMENU) -> bool {
true // success
}

#[win32_derive::dllexport]
pub fn SetMenuItemInfoA(_machine: &mut Machine, hMenu: HMENU, item: u32, fByPosition: bool, lpmii: u32) -> bool {
false // fail
}

#[win32_derive::dllexport]
pub fn GetSystemMenu(_machine: &mut Machine, hWnd: HWND, bRevert: bool) -> HMENU {
0 // null
Expand Down

0 comments on commit b998e57

Please sign in to comment.