mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-16 16:14:29 -04:00
[mingw] use delay loading for DLLs that are subject to side loading
* This reverts much of commitsf6ac559f4d
and1947266837
so that we call the Windows APIs directly again, while ensuring that, by the time we load the DLLs, sideloading mitigation has already been applied by the application. * This is a continuation of #1877, and should help prevent re-introducing side-loading issues when we link against new libraries, as well as allow us to drop some of the manual DLL hooking we've been doing to prevent it, to clean up the code. * Note that this is a bit more complex than what the stackoverflow post suggests, because we need to create delayloaded libs for both 32-bit and 64-bit, which use a different calling convention and therefore need to use different .def files. So there's a lot of gymkhana involved, with Makefiles and whatnot, to get us there. * Also simplify the use of CM_Get_DevNode_Registry_PropertyA() in dev.c since recent versions of MinGW now have support for it. * Also fix 2 small issues in net.c (potential overflow) and format.c (memory leak).
This commit is contained in:
parent
3528ca773d
commit
e7b66e7e4c
27 changed files with 597 additions and 68 deletions
|
@ -607,11 +607,11 @@ HANDLE DownloadSignedFileThreaded(const char* url, const char* file, HWND hProgr
|
|||
return CreateThread(NULL, 0, DownloadSignedFileThread, &args, 0, NULL);
|
||||
}
|
||||
|
||||
static __inline uint64_t to_uint64_t(uint16_t x[4]) {
|
||||
static __inline uint64_t to_uint64_t(uint16_t x[3]) {
|
||||
int i;
|
||||
uint64_t ret = 0;
|
||||
for (i=0; i<3; i++)
|
||||
ret = (ret<<16) + x[i];
|
||||
for (i = 0; i < 3; i++)
|
||||
ret = (ret << 16) + x[i];
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue