From efc869873c9f2c053b099ef93fcaa0d58e197b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Sat, 14 Sep 2024 01:38:27 +0200 Subject: [PATCH] add SetTextAlign stub --- win32/dll/gdi32.dll | Bin 3072 -> 3584 bytes win32/src/winapi/builtin.rs | 13 ++++++++++++- win32/src/winapi/gdi32/text.rs | 5 +++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/win32/dll/gdi32.dll b/win32/dll/gdi32.dll index b425d5f207b9c2131cd2dbe4b339af006cd056c6..90c8d87987b28b62e72b4c86ff69fef53d87a0d2 100755 GIT binary patch delta 708 zcma*lze_?<6bJBgUjBL}p<&=NiC$(F2^9quG$gb{SUduuXbFM{B8es!b!Z6^vO5IP zP;Ch<`UeC-5N$z3gGhsfV@m`r^-a8Y$fXM(_`ZA3x%YA3%LQ_wqg=3hxR9decqPqj z=MEwb6RyJPs-ABnx(X8wiZKoegD1HnERJ$gq&e!=ZK&%7hbZzed&lWGI(UL$qy?E@f>GFGd3ud=5hs$T&|3K3sp5GuN;*N`K!bkLA54>f3G0x8H0(nj&Y%SM@B(#shfg5<7*6m(4-COL#9=v1L0UuDfL+MI z0i3|O*mEX0QoeCsvOT`NwYei!^y$tgEXnbOTnQIUL$5VwYvN9yDQR^U?6!ERY`L%b E2T~2SssI20 delta 675 zcma*lJxIeq6bJD4YClXZ8cK!K7Bt3E#SRw4ItU^NB3Q95LU(ag9E#PU0Vg-xb8@RV zh=T}OMMMgM6en?0q=QRw=;G$b-;%q*E*|{gpS$<&!X<1x#N{QW)Jrg zc`)HGALq3~7g5C`8Wm}dizsKfCUTtQtSE9a*up9efmfXKI0v04PI*c-i}c$O`tEOs zhzubayfPRvOv}(&ql#7Nmc=TlrFMJi_xR3@blIkY>Q_O%kZM=OolC0gPgub5s%_#Q zr>11hqzvsl6Dz(;vE|b$ey=7!l3q4r(RtiB25O4c1{3c3~eXa0b`#059+c@9+Vi5WpW1fk7C93@pN`MPbS#Y``|ya3J;q lS?4}bWwE2B!&jJ+qk&wr%BG>!-PyW$)@B5Ua!!jc_y=tat;GNU diff --git a/win32/src/winapi/builtin.rs b/win32/src/winapi/builtin.rs index 4bb15e1e..bcddff9c 100644 --- a/win32/src/winapi/builtin.rs +++ b/win32/src/winapi/builtin.rs @@ -1535,6 +1535,12 @@ pub mod gdi32 { let rop2 = >::from_stack(mem, esp + 8u32); winapi::gdi32::SetROP2(machine, hdc, rop2).to_raw() } + pub unsafe fn SetTextAlign(machine: &mut Machine, esp: u32) -> u32 { + let mem = machine.mem().detach(); + let hdc = ::from_stack(mem, esp + 4u32); + let fMode = ::from_stack(mem, esp + 8u32); + winapi::gdi32::SetTextAlign(machine, hdc, fMode).to_raw() + } pub unsafe fn SetTextColor(machine: &mut Machine, esp: u32) -> u32 { let mem = machine.mem().detach(); let hdc = ::from_stack(mem, esp + 4u32); @@ -1728,6 +1734,10 @@ pub mod gdi32 { name: "SetROP2", func: crate::shims::Handler::Sync(impls::SetROP2), }; + pub const SetTextAlign: Shim = Shim { + name: "SetTextAlign", + func: crate::shims::Handler::Sync(impls::SetTextAlign), + }; pub const SetTextColor: Shim = Shim { name: "SetTextColor", func: crate::shims::Handler::Sync(impls::SetTextColor), @@ -1749,7 +1759,7 @@ pub mod gdi32 { func: crate::shims::Handler::Sync(impls::TextOutW), }; } - const SHIMS: [Shim; 37usize] = [ + const SHIMS: [Shim; 38usize] = [ shims::BitBlt, shims::CreateBitmap, shims::CreateCompatibleBitmap, @@ -1782,6 +1792,7 @@ pub mod gdi32 { shims::SetDIBitsToDevice, shims::SetPixel, shims::SetROP2, + shims::SetTextAlign, shims::SetTextColor, shims::StretchBlt, shims::StretchDIBits, diff --git a/win32/src/winapi/gdi32/text.rs b/win32/src/winapi/gdi32/text.rs index cf1f2c72..cd494e6e 100644 --- a/win32/src/winapi/gdi32/text.rs +++ b/win32/src/winapi/gdi32/text.rs @@ -31,6 +31,11 @@ pub fn CreateFontA( HFONT::null() } +#[win32_derive::dllexport] +pub fn SetTextAlign(_machine: &mut Machine, hdc: HDC, fMode: u32) -> u32 { + 0 // TA_LEFT | TA_TOP | TA_NOUPDATECP +} + #[win32_derive::dllexport] pub fn SetTextColor(_machine: &mut Machine, hdc: HDC, color: COLORREF) -> COLORREF { CLR_INVALID // fail