On Mon Sep 18 17:52:49 2023 +0000, Zebediah Figura wrote:
> Why are we adding one here? That doesn't look right.
I think I see what the intent is, but it is unnecessarily 'clever'. It would be clearer to use something like a `BOOL modified`, and ultimately `return modified ? NORMALIZE_RESULT_SUCCESS_MODIFIED : NORMALIZE_RESULT_SUCCESS;`
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3870#note_45774
Make functions ntlea needs to patch hotpatchable. And add a asm wrapper for `GetWindowLongA` to workaround an assumption ntlea made.
--
v3: user32: add hotpatchable wrapper for GetWindowLongA
https://gitlab.winehq.org/wine/wine/-/merge_requests/3855
Zebediah Figura (@zfigura) commented about dlls/mspatcha/pa19.c:
> + }
> +
> + nt_headers->OptionalHeader.ImageBase = (DWORD)new_image_base;
> + result = TRUE;
> +
> + reloc_dir_remaining = (LONG)reloc_dir_size;
> + while (reloc_dir_remaining > 0) {
> +
> + if (reloc_block->SizeOfBlock <= (ULONG)reloc_dir_remaining
> + && reloc_block->SizeOfBlock > sizeof(IMAGE_BASE_RELOCATION))
> + {
> + reloc_block_base = (IMAGE_BASE_RELOCATION UNALIGNED *)(mapped_image_base +
> + image_rva_to_file_offset(nt_headers, reloc_block->VirtualAddress, mapped_image_base, mapped_image_size));
> + if (reloc_block_base)
> + {
> + reloc = (USHORT UNALIGNED *)((PUCHAR)reloc_block + sizeof(IMAGE_BASE_RELOCATION));
I don't think we want UNALIGNED, not least because it doesn't do anything on non-MSVC compilers. If any of these actually can be unaligned (can they?) then I think we should just use memcpy.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/3870#note_45759