Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/TsudaKageyu/minhook.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZLOFENIX <admin@zlofenix.org>2015-05-19 14:55:58 +0300
committerZLOFENIX <admin@zlofenix.org>2015-05-19 14:55:58 +0300
commitaccb1ee2a979e8bfc4aff0ac213ada0efc09a88e (patch)
treeefa02cdc2ff4980e56ab531d80628c2cf6e71255
parent58e62a90eaa4d5c6af16774cc9db7e334e647d51 (diff)
parentcbd6254467b0f4b20f3fc2b47ceea44e26330a34 (diff)
Merge remote-tracking branch 'upstream/master'
Conflicts: src/hook.c src/trampoline.c
-rw-r--r--src/hook.c10
-rw-r--r--src/trampoline.c6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/hook.c b/src/hook.c
index 6470c3b..1070937 100644
--- a/src/hook.c
+++ b/src/hook.c
@@ -26,13 +26,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef MINGW
+#ifndef _MSC_VER
#define _WIN32_WINNT 0x0501
#define WIN32_LEAN_AND_MEAN
#endif
#include <Windows.h>
#include <TlHelp32.h>
-#ifdef MINGW
+#ifndef _MSC_VER
#include <x86intrin.h>
#include <limits.h>
#ifndef ARRAYSIZE
@@ -448,7 +448,7 @@ static VOID EnterSpinLock(VOID)
SIZE_T spinCount = 0;
// Wait until the flag is FALSE.
-#ifdef MINGW
+#ifndef _MSC_VER
while (InterlockedCompareExchange(&g_isLocked, TRUE, FALSE) != FALSE)
{
#else
@@ -457,7 +457,7 @@ static VOID EnterSpinLock(VOID)
_ReadWriteBarrier();
#endif
// Prevent the loop from being too busy.
-#ifdef MINGW
+#ifndef _MSC_VER
if (spinCount < 16)
usleep(250);
else if (spinCount < 32)
@@ -478,7 +478,7 @@ static VOID EnterSpinLock(VOID)
//-------------------------------------------------------------------------
static VOID LeaveSpinLock(VOID)
{
-#ifdef MINGW
+#ifndef _MSC_VER
InterlockedExchange(&g_isLocked, FALSE);
#else
_ReadWriteBarrier();
diff --git a/src/trampoline.c b/src/trampoline.c
index bad6cf1..fc70f5c 100644
--- a/src/trampoline.c
+++ b/src/trampoline.c
@@ -27,7 +27,7 @@
*/
#include <Windows.h>
-#ifdef MINGW
+#ifndef _MSC_VER
#ifndef ARRAYSIZE
#define ARRAYSIZE sizeof
#endif
@@ -149,7 +149,7 @@ BOOL CreateTrampolineFunction(PTRAMPOLINE ct)
PUINT32 pRelAddr;
// Avoid using memcpy to reduce the footprint.
-#ifdef MINGW
+#ifndef _MSC_VER
memcpy(instBuf, (LPBYTE)pOldInst, copySize);
#else
__movsb(instBuf, (LPBYTE)pOldInst, copySize);
@@ -274,7 +274,7 @@ BOOL CreateTrampolineFunction(PTRAMPOLINE ct)
ct->nIP++;
// Avoid using memcpy to reduce the footprint.
-#ifdef MINGW
+#ifndef _MSC_VER
memcpy((LPBYTE)ct->pTrampoline + newPos, pCopySrc, copySize);
#else
__movsb((LPBYTE)ct->pTrampoline + newPos, pCopySrc, copySize);