@@ -1466,7 +1466,7 @@ static BOOL detour_is_region_empty(PDETOUR_REGION pRegion)
1466
1466
1467
1467
// Stop if any of the trampolines aren't free.
1468
1468
PDETOUR_TRAMPOLINE pTrampoline = ((PDETOUR_TRAMPOLINE)pRegion) + 1 ;
1469
- for (int i = 0 ; i < DETOUR_TRAMPOLINES_PER_REGION; i++) {
1469
+ for (ULONG i = 0 ; i < DETOUR_TRAMPOLINES_PER_REGION; i++) {
1470
1470
if (pTrampoline[i].pbRemain != NULL &&
1471
1471
(pTrampoline[i].pbRemain < pbRegionBeg ||
1472
1472
pTrampoline[i].pbRemain >= pbRegionLim)) {
@@ -1637,7 +1637,7 @@ LONG WINAPI DetourTransactionCommit()
1637
1637
1638
1638
static BYTE detour_align_from_trampoline (PDETOUR_TRAMPOLINE pTrampoline, BYTE obTrampoline)
1639
1639
{
1640
- for (LONG n = 0 ; n < ARRAYSIZE (pTrampoline->rAlign ); n++) {
1640
+ for (ULONG n = 0 ; n < ARRAYSIZE (pTrampoline->rAlign ); n++) {
1641
1641
if (pTrampoline->rAlign [n].obTrampoline == obTrampoline) {
1642
1642
return pTrampoline->rAlign [n].obTarget ;
1643
1643
}
@@ -1647,7 +1647,7 @@ static BYTE detour_align_from_trampoline(PDETOUR_TRAMPOLINE pTrampoline, BYTE ob
1647
1647
1648
1648
static LONG detour_align_from_target (PDETOUR_TRAMPOLINE pTrampoline, LONG obTarget)
1649
1649
{
1650
- for (LONG n = 0 ; n < ARRAYSIZE (pTrampoline->rAlign ); n++) {
1650
+ for (ULONG n = 0 ; n < ARRAYSIZE (pTrampoline->rAlign ); n++) {
1651
1651
if (pTrampoline->rAlign [n].obTarget == obTarget) {
1652
1652
return pTrampoline->rAlign [n].obTrampoline ;
1653
1653
}
@@ -2425,7 +2425,7 @@ LONG WINAPI DetourDetach(_Inout_ PVOID *ppPointer,
2425
2425
//
2426
2426
LONG cbTarget = pTrampoline->cbRestore ;
2427
2427
PBYTE pbTarget = pTrampoline->pbRemain - cbTarget;
2428
- if (cbTarget == 0 || cbTarget > sizeof (pTrampoline->rbCode )) {
2428
+ if (cbTarget == 0 || pTrampoline-> cbRestore > sizeof (pTrampoline->rbCode )) {
2429
2429
error = ERROR_INVALID_BLOCK;
2430
2430
if (s_fIgnoreTooSmall) {
2431
2431
goto stop;
0 commit comments