You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
. I used qemu.exe because there was some chatter on the qemu-devel mailing list about moving (eventually) to a single-executable based approach, at which point much of this machinery would be unnecessary.
qemu-system-arm.exe loads plugin.dll, then plugin.dll loads qemu.exe. The win_link_hook module intercepts the failure to load qemu.exe, and returns a reference to the top-level executable (regardless of how it is named).
So, a few comments:
There is an unfinished safety justification on line 46:
// nul-byte dependent `strcpy`. In this instance, it is safe because
let name = unsafe{ pdli.TargetDllName.to_string()}.unwrap_or_default();
Because you're hooking failure rather than notification now, if there happens to be a "qemu.exe" on the DLL load path, then the plugin will load that instead of getting a reference to the calling binary. It's a weird situation, and I'm not sure which behaviour is preferable.
as above, the check on line 51 is OK as is, but also it was fine before, too. Now, if the plugin happens to also link to other qemu* DLLs and they fail to load, then we will reroute to the calling executable. This might surprise the user.
unfinished comment on line 43.
The text was updated successfully, but these errors were encountered:
Understood, thanks for explaining that! In that case I'll revert the check back to explicitly qemu.exe, although maybe we can call it something like qemu-delay-link.exe or something if there's no reason to only have it named qemu.exe. I think that would repair the behavior to be how you intended it as well as remove some confusion (at least for me, a windows noob).
qemu-rs/qemu-plugin/src/win_link_hook/mod.rs
Line 51 in 2d1c40d
Note that the "qemu.exe" here is not the name of the calling executable, but rather the name of the delay-linked DLL that is created in
qemu-rs/qemu-plugin-sys/build.rs
Lines 22 to 32 in 2d1c40d
qemu.exe
because there was some chatter on the qemu-devel mailing list about moving (eventually) to a single-executable based approach, at which point much of this machinery would be unnecessary.qemu-system-arm.exe
loadsplugin.dll
, thenplugin.dll
loadsqemu.exe
. The win_link_hook module intercepts the failure to loadqemu.exe
, and returns a reference to the top-level executable (regardless of how it is named).So, a few comments:
qemu-rs/qemu-plugin/src/win_link_hook/mod.rs
Lines 46 to 47 in 2d1c40d
qemu*
DLLs and they fail to load, then we will reroute to the calling executable. This might surprise the user.The text was updated successfully, but these errors were encountered: