diff options
author | Andrzej Janik <[email protected]> | 2021-01-03 17:54:01 +0100 |
---|---|---|
committer | Andrzej Janik <[email protected]> | 2021-01-03 17:54:01 +0100 |
commit | 659b2c6ec431c3f1103e700a20da4c66467aa35d (patch) | |
tree | 93966e595443fe7b571aef6af95b782788af31e8 | |
parent | 77523940b39d522adc26b18f00c3373407523c55 (diff) | |
parent | 4b96dbc8f49c5ae00c96935e0b576df88a5d8af9 (diff) | |
download | ZLUDA-659b2c6ec431c3f1103e700a20da4c66467aa35d.tar.gz ZLUDA-659b2c6ec431c3f1103e700a20da4c66467aa35d.zip |
Merge commit '4b96dbc8f49c5ae00c96935e0b576df88a5d8af9'
-rw-r--r-- | ext/detours/src/creatwth.cpp | 1 | ||||
-rw-r--r-- | ext/detours/src/detours.h | 19 | ||||
-rw-r--r-- | ext/detours/src/image.cpp | 4 | ||||
-rw-r--r-- | ext/detours/src/modules.cpp | 4 |
4 files changed, 7 insertions, 21 deletions
diff --git a/ext/detours/src/creatwth.cpp b/ext/detours/src/creatwth.cpp index f7b51f4..abcba4f 100644 --- a/ext/detours/src/creatwth.cpp +++ b/ext/detours/src/creatwth.cpp @@ -11,6 +11,7 @@ #define DETOURS_INTERNAL #include "detours.h" #include <stddef.h> +#include <strsafe.h> #if DETOURS_VERSION != 0x4c0c1 // 0xMAJORcMINORcPATCH #error detours.h version mismatch diff --git a/ext/detours/src/detours.h b/ext/detours/src/detours.h index c08b6f1..4ebc644 100644 --- a/ext/detours/src/detours.h +++ b/ext/detours/src/detours.h @@ -118,11 +118,6 @@ ////////////////////////////////////////////////////////////////////////////// // -#if (_MSC_VER < 1299) -typedef LONG LONG_PTR; -typedef ULONG ULONG_PTR; -#endif - ///////////////////////////////////////////////// SAL 2.0 Annotations w/o SAL. // // These definitions are include so that Detours will build even if the @@ -846,24 +841,10 @@ VOID CALLBACK DetourFinishHelperProcess(_In_ HWND, ////////////////////////////////////////////////////////////////////////////// // -#if (_MSC_VER < 1299) -#include <imagehlp.h> -typedef IMAGEHLP_MODULE IMAGEHLP_MODULE64; -typedef PIMAGEHLP_MODULE PIMAGEHLP_MODULE64; -typedef IMAGEHLP_SYMBOL SYMBOL_INFO; -typedef PIMAGEHLP_SYMBOL PSYMBOL_INFO; - -static inline -LONG InterlockedCompareExchange(_Inout_ LONG *ptr, _In_ LONG nval, _In_ LONG oval) -{ - return (LONG)::InterlockedCompareExchange((PVOID*)ptr, (PVOID)nval, (PVOID)oval); -} -#else #pragma warning(push) #pragma warning(disable:4091) // empty typedef #include <dbghelp.h> #pragma warning(pop) -#endif #ifdef IMAGEAPI // defined by DBGHELP.H typedef LPAPI_VERSION (NTAPI *PF_ImagehlpApiVersionEx)(_In_ LPAPI_VERSION AppVersion); diff --git a/ext/detours/src/image.cpp b/ext/detours/src/image.cpp index 96282d2..1599d2e 100644 --- a/ext/detours/src/image.cpp +++ b/ext/detours/src/image.cpp @@ -146,6 +146,8 @@ protected: DWORD m_cbAlloc; }; +class CImageImportName; + class CImageImportFile { friend class CImage; @@ -1693,7 +1695,7 @@ BOOL CImage::Write(HANDLE hFile) m_nNextFileAddr = Max(m_SectionHeaders[n].PointerToRawData + m_SectionHeaders[n].SizeOfRawData, m_nNextFileAddr); - // Old images have VirtualSize == 0 as a matter of course, e.g. NT 3.1.
+ // Old images have VirtualSize == 0 as a matter of course, e.g. NT 3.1. // In which case, use SizeOfRawData instead. m_nNextVirtAddr = Max(m_SectionHeaders[n].VirtualAddress + (m_SectionHeaders[n].Misc.VirtualSize diff --git a/ext/detours/src/modules.cpp b/ext/detours/src/modules.cpp index a797121..8b2b25e 100644 --- a/ext/detours/src/modules.cpp +++ b/ext/detours/src/modules.cpp @@ -12,6 +12,8 @@ // #define DETOUR_DEBUG 1 #define DETOURS_INTERNAL #include "detours.h" +#include <strsafe.h> +#include <libloaderapi.h> #if DETOURS_VERSION != 0x4c0c1 // 0xMAJORcMINORcPATCH #error detours.h version mismatch @@ -340,7 +342,7 @@ PVOID WINAPI DetourGetEntryPoint(_In_opt_ HMODULE hModule) } SetLastError(NO_ERROR); - return GetProcAddress(hClr, "_CorExeMain"); + return (PVOID)GetProcAddress(hClr, "_CorExeMain"); } SetLastError(NO_ERROR); |