Skip to content

Commit

Permalink
修复1.24e下退出游戏时的崩溃问题
Browse files Browse the repository at this point in the history
  • Loading branch information
LoveBeforT committed Dec 6, 2021
1 parent 36152f7 commit 248e8e9
Show file tree
Hide file tree
Showing 40 changed files with 105 additions and 22,911 deletions.
2,368 changes: 0 additions & 2,368 deletions ThirdParty/Detours/detours.cpp

This file was deleted.

55 changes: 52 additions & 3 deletions ThirdParty/Detours/detours.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Core Detours Functionality (detours.h of detours.lib)
//
// Microsoft Research Detours Package, Version 3.0 Build_343.
// Microsoft Research Detours Package, Version 4.0.1
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
Expand All @@ -11,7 +11,35 @@
#ifndef _DETOURS_H_
#define _DETOURS_H_

#define DETOURS_VERSION 30001 // 3.00.01
#define DETOURS_VERSION 0x4c0c1 // 0xMAJORcMINORcPATCH

//////////////////////////////////////////////////////////////////////////////
//

#ifdef DETOURS_INTERNAL

#define _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS 1
#define _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE 1

#pragma warning(disable:4068) // unknown pragma (suppress)

#if _MSC_VER >= 1900
#pragma warning(push)
#pragma warning(disable:4091) // empty typedef
#endif

#include <windows.h>
#if (_MSC_VER < 1310)
#else
#pragma warning(push)
#if _MSC_VER > 1400
#pragma warning(disable:6102 6103) // /analyze warnings
#endif
#include <strsafe.h>
#pragma warning(pop)
#endif

#endif // DETOURS_INTERNAL

//////////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -377,16 +405,35 @@ typedef struct _DETOUR_EXE_RESTORE

IMAGE_DOS_HEADER idh;
union {
IMAGE_NT_HEADERS inh;
IMAGE_NT_HEADERS inh; // all environments have this
#ifdef IMAGE_NT_OPTIONAL_HDR32_MAGIC // some environments do not have this
IMAGE_NT_HEADERS32 inh32;
#endif
#ifdef IMAGE_NT_OPTIONAL_HDR64_MAGIC // some environments do not have this
IMAGE_NT_HEADERS64 inh64;
#endif
#ifdef IMAGE_NT_OPTIONAL_HDR64_MAGIC // some environments do not have this
BYTE raw[sizeof(IMAGE_NT_HEADERS64) +
sizeof(IMAGE_SECTION_HEADER) * 32];
#else
BYTE raw[0x108 + sizeof(IMAGE_SECTION_HEADER) * 32];
#endif
};
DETOUR_CLR_HEADER clr;

} DETOUR_EXE_RESTORE, *PDETOUR_EXE_RESTORE;

#ifdef IMAGE_NT_OPTIONAL_HDR64_MAGIC
C_ASSERT(sizeof(IMAGE_NT_HEADERS64) == 0x108);
#endif

// The size can change, but assert for clarity due to the muddying #ifdefs.
#ifdef _WIN64
C_ASSERT(sizeof(DETOUR_EXE_RESTORE) == 0x688);
#else
C_ASSERT(sizeof(DETOUR_EXE_RESTORE) == 0x678);
#endif

typedef struct _DETOUR_EXE_HELPER
{
DWORD cb;
Expand Down Expand Up @@ -507,6 +554,8 @@ PVOID WINAPI DetourCopyInstruction(_In_opt_ PVOID pDst,
_Out_opt_ LONG *plExtra);
BOOL WINAPI DetourSetCodeModule(_In_ HMODULE hModule,
_In_ BOOL fLimitReferencesToModule);
PVOID WINAPI DetourAllocateRegionWithinJumpBounds(_In_ LPCVOID pbTarget,
_Out_ PDWORD pcbAllocatedSize);

///////////////////////////////////////////////////// Loaded Binary Functions.
//
Expand Down
2 changes: 1 addition & 1 deletion ThirdParty/Detours/detver.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Common version parameters.
//
// Microsoft Research Detours Package, Version 3.0 Build_343.
// Microsoft Research Detours Package, Version 4.0.1
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
Expand Down
Loading

0 comments on commit 248e8e9

Please sign in to comment.