Fixed more critical hit crashes when compiled on msvc8.
authorMatt Woodrow <pred@alliedmods.net>
Sat Jul 05 22:28:02 2008 +0000 (2008-07-05)
changeset 2159bab2e26c7178
parent 2158 5a3abe640d41
child 2160 b37c444b0a84
Fixed more critical hit crashes when compiled on msvc8.
extensions/tf2/CDetour/detourhelpers.h
extensions/tf2/CDetour/detours.cpp
extensions/tf2/CDetour/detours.h
extensions/tf2/msvc9/tf2.vcproj
     1.1 --- a/extensions/tf2/CDetour/detourhelpers.h	Sat Jul 05 09:23:55 2008 +0000
     1.2 +++ b/extensions/tf2/CDetour/detourhelpers.h	Sat Jul 05 22:28:02 2008 +0000
     1.3 @@ -1,7 +1,7 @@
     1.4  /**
     1.5   * vim: set ts=4 :
     1.6   * =============================================================================
     1.7 - * SourceMod SDKTools Extension
     1.8 + * SourceMod
     1.9   * Copyright (C) 2004-2007 AlliedModders LLC.  All rights reserved.
    1.10   * =============================================================================
    1.11   *
     2.1 --- a/extensions/tf2/CDetour/detours.cpp	Sat Jul 05 09:23:55 2008 +0000
     2.2 +++ b/extensions/tf2/CDetour/detours.cpp	Sat Jul 05 22:28:02 2008 +0000
     2.3 @@ -1,3 +1,34 @@
     2.4 +/**
     2.5 +* vim: set ts=4 :
     2.6 +* =============================================================================
     2.7 +* SourceMod
     2.8 +* Copyright (C) 2004-2008 AlliedModders LLC.  All rights reserved.
     2.9 +* =============================================================================
    2.10 +*
    2.11 +* This program is free software; you can redistribute it and/or modify it under
    2.12 +* the terms of the GNU General Public License, version 3.0, as published by the
    2.13 +* Free Software Foundation.
    2.14 +* 
    2.15 +* This program is distributed in the hope that it will be useful, but WITHOUT
    2.16 +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    2.17 +* FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
    2.18 +* details.
    2.19 +*
    2.20 +* You should have received a copy of the GNU General Public License along with
    2.21 +* this program.  If not, see <http://www.gnu.org/licenses/>.
    2.22 +*
    2.23 +* As a special exception, AlliedModders LLC gives you permission to link the
    2.24 +* code of this program (as well as its derivative works) to "Half-Life 2," the
    2.25 +* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
    2.26 +* by the Valve Corporation.  You must obey the GNU General Public License in
    2.27 +* all respects for all other code used.  Additionally, AlliedModders LLC grants
    2.28 +* this exception to all derivative works.  AlliedModders LLC defines further
    2.29 +* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
    2.30 +* or <http://www.sourcemod.net/license.php>.
    2.31 +*
    2.32 +* Version: $Id$
    2.33 +*/
    2.34 +
    2.35  #include "detours.h"
    2.36  #include <asm/asm.h>
    2.37  
    2.38 @@ -105,11 +136,11 @@
    2.39  
    2.40  	if (!detour_address)
    2.41  	{
    2.42 -		g_pSM->LogError(myself, "Sigscan for %s failed - Disabling detour", signame);
    2.43 +		g_pSM->LogError(myself, "Sigscan for %s failed - Disabling detour to prevent crashes", signame);
    2.44  		return false;
    2.45  	}
    2.46  
    2.47 -	detour_restore.bytes = copy_bytes((unsigned char *)detour_address, NULL, OP_JMP_SIZE);
    2.48 +	detour_restore.bytes = copy_bytes((unsigned char *)detour_address, NULL, OP_JMP_SIZE+1);
    2.49  
    2.50  	/* First, save restore bits */
    2.51  	for (size_t i=0; i<detour_restore.bytes; i++)
     3.1 --- a/extensions/tf2/CDetour/detours.h	Sat Jul 05 09:23:55 2008 +0000
     3.2 +++ b/extensions/tf2/CDetour/detours.h	Sat Jul 05 22:28:02 2008 +0000
     3.3 @@ -1,3 +1,33 @@
     3.4 +/**
     3.5 +* vim: set ts=4 :
     3.6 +* =============================================================================
     3.7 +* SourceMod
     3.8 +* Copyright (C) 2004-2008 AlliedModders LLC.  All rights reserved.
     3.9 +* =============================================================================
    3.10 +*
    3.11 +* This program is free software; you can redistribute it and/or modify it under
    3.12 +* the terms of the GNU General Public License, version 3.0, as published by the
    3.13 +* Free Software Foundation.
    3.14 +* 
    3.15 +* This program is distributed in the hope that it will be useful, but WITHOUT
    3.16 +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    3.17 +* FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
    3.18 +* details.
    3.19 +*
    3.20 +* You should have received a copy of the GNU General Public License along with
    3.21 +* this program.  If not, see <http://www.gnu.org/licenses/>.
    3.22 +*
    3.23 +* As a special exception, AlliedModders LLC gives you permission to link the
    3.24 +* code of this program (as well as its derivative works) to "Half-Life 2," the
    3.25 +* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
    3.26 +* by the Valve Corporation.  You must obey the GNU General Public License in
    3.27 +* all respects for all other code used.  Additionally, AlliedModders LLC grants
    3.28 +* this exception to all derivative works.  AlliedModders LLC defines further
    3.29 +* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
    3.30 +* or <http://www.sourcemod.net/license.php>.
    3.31 +*
    3.32 +* Version: $Id$
    3.33 +*/
    3.34  
    3.35  #ifndef _INCLUDE_SOURCEMOD_DETOURS_H_
    3.36  #define _INCLUDE_SOURCEMOD_DETOURS_H_
     4.1 --- a/extensions/tf2/msvc9/tf2.vcproj	Sat Jul 05 09:23:55 2008 +0000
     4.2 +++ b/extensions/tf2/msvc9/tf2.vcproj	Sat Jul 05 22:28:02 2008 +0000
     4.3 @@ -258,15 +258,15 @@
     4.4  			Name="CDetour"
     4.5  			>
     4.6  			<File
     4.7 -				RelativePath="..\..\..\public\CBaseServer and friends\CDetour\detourhelpers.h"
     4.8 +				RelativePath="..\CDetour\detourhelpers.h"
     4.9  				>
    4.10  			</File>
    4.11  			<File
    4.12 -				RelativePath="..\..\..\public\CBaseServer and friends\CDetour\detours.cpp"
    4.13 +				RelativePath="..\CDetour\detours.cpp"
    4.14  				>
    4.15  			</File>
    4.16  			<File
    4.17 -				RelativePath="..\..\..\public\CBaseServer and friends\CDetour\detours.h"
    4.18 +				RelativePath="..\CDetour\detours.h"
    4.19  				>
    4.20  			</File>
    4.21  		</Filter>