Skip to content

Commit

Permalink
[SLIMDETOURS] Code improvements, no functional changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RatinCN committed Jul 29, 2024
1 parent 0939099 commit d0d8313
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Source/Demo/Main.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Hooked_EqualRect(
BOOL Ret;

InterlockedIncrement(&g_lEqualRectCount);
UnitTest_FormatMessage("Hooked EqualRect enter: lprc1 = (%d, %d, %d, %d), lprc2 = (%d, %d, %d, %d)\n",
UnitTest_FormatMessage("Hooked EqualRect enter: lprc1 = (%ld, %ld, %ld, %ld), lprc2 = (%ld, %ld, %ld, %ld)\n",
lprc1->top,
lprc1->right,
lprc1->bottom,
Expand Down
4 changes: 2 additions & 2 deletions Source/SlimDetours/SlimDetours.inl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

/* Use ReactOS NDK with addendum on ReactOS */

#include "SlimDetours.NDK.Addendum.inl"

#define WIN32_NO_STATUS
#include <windef.h>
#include <winbase.h>
Expand All @@ -25,6 +23,8 @@

#include <suppress.h>

#include "SlimDetours.NDK.Addendum.inl"

#endif

#include "SlimDetours.h"
Expand Down
14 changes: 5 additions & 9 deletions Source/SlimDetours/Transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ struct _DETOUR_DELAY_ATTACH
PVOID Context;
};

#endif /* (NTDDI_VERSION >= NTDDI_WIN6) */

static HANDLE s_nPendingThreadId = 0; // Thread owning pending transaction.
static PHANDLE s_phSuspendedThreads = NULL;
static ULONG s_ulSuspendedThreadCount = 0;
static PDETOUR_OPERATION s_pPendingOperations = NULL;

#if (NTDDI_VERSION >= NTDDI_WIN6)

static const ANSI_STRING g_asLdrRegisterDllNotification = RTL_CONSTANT_STRING("LdrRegisterDllNotification");
static FN_LdrRegisterDllNotification* g_pfnLdrRegisterDllNotification = NULL;
static NTSTATUS g_lDelayAttachStatus = STATUS_UNSUCCESSFUL;
Expand All @@ -55,6 +46,11 @@ static PDETOUR_DELAY_ATTACH g_DelayedAttaches = NULL;

#endif /* (NTDDI_VERSION >= NTDDI_WIN6) */

static HANDLE s_nPendingThreadId = 0; // Thread owning pending transaction.
static PHANDLE s_phSuspendedThreads = NULL;
static ULONG s_ulSuspendedThreadCount = 0;
static PDETOUR_OPERATION s_pPendingOperations = NULL;

HRESULT
NTAPI
SlimDetoursTransactionBegin(VOID)
Expand Down

0 comments on commit d0d8313

Please sign in to comment.