Remove useless code for Win32 diversions.

This commit is contained in:
Sam Hocevar 2010-10-04 21:37:41 +00:00 committed by sam
parent 8ad42b6b1c
commit bfcb7051fb
4 changed files with 6 additions and 22 deletions

View File

@ -50,14 +50,8 @@ typedef struct
}
zzuf_table_t;
# define DIVERT(x) { "kernel32.dll", #x, \
(void **)&x##_orig, (void *)x##_new }
# define DIVERT_END { NULL, NULL, NULL, NULL }
extern zzuf_table_t table_stream[],
table_win32[];
extern zzuf_table_t table_win32[];
#else
# error no function diversion system for this platform
#endif

View File

@ -1145,15 +1145,3 @@ int NEW(__uflow)(FILE *fp)
int ret; ZZ_REFILL(__uflow, 1); return ret;
}
#endif
/* Win32 function table */
#if defined _WIN32
zzuf_table_t table_stream[] =
{
DIVERT(fopen),
DIVERT(fread),
DIVERT(fclose),
DIVERT_END
};
#endif

View File

@ -113,6 +113,10 @@ BOOL __stdcall NEW(CloseHandle)(HANDLE hObject)
/* Win32 function table */
#if defined _WIN32
# define DIVERT(x) { "kernel32.dll", #x, \
(void **)&x##_orig, (void *)x##_new }
# define DIVERT_END { NULL, NULL, NULL, NULL }
zzuf_table_t table_win32[] =
{
#if defined HAVE_CLOSEHANDLE

View File

@ -93,7 +93,6 @@ static void insert_funcs(void *module)
{
static zzuf_table_t *list[] =
{
table_stream,
table_win32,
};
@ -139,7 +138,7 @@ static void insert_funcs(void *module)
continue;
/* FIXME: The StarCraft 2 hack uses two methods for function
* diversion. See HookSsdt() and HookHotPatch(). */
* diversion. See HookSsdt() and HookHotPatch(). */
VirtualProtect(func, sizeof(func), PAGE_EXECUTE_READWRITE, &dummy);
WriteProcessMemory(GetCurrentProcess(), func, &diversion->new,
sizeof(diversion->new), NULL);
@ -150,4 +149,3 @@ static void insert_funcs(void *module)
}
}
#endif