forked from Dniel97/segatools
hooklib/path.c: add function to hook apply path hooks to another module
This commit is contained in:
parent
00819a2721
commit
533683e595
@ -252,8 +252,13 @@ static void path_hook_init(void)
|
|||||||
path_hook_initted = true;
|
path_hook_initted = true;
|
||||||
InitializeCriticalSection(&path_hook_lock);
|
InitializeCriticalSection(&path_hook_lock);
|
||||||
|
|
||||||
|
path_hook_insert_hooks(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void path_hook_insert_hooks(HMODULE target)
|
||||||
|
{
|
||||||
hook_table_apply(
|
hook_table_apply(
|
||||||
NULL,
|
target,
|
||||||
"kernel32.dll",
|
"kernel32.dll",
|
||||||
path_hook_syms,
|
path_hook_syms,
|
||||||
_countof(path_hook_syms));
|
_countof(path_hook_syms));
|
||||||
@ -668,6 +673,7 @@ static DWORD WINAPI hook_GetFileAttributesW(const wchar_t *lpFileName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
result = next_GetFileAttributesW(trans ? trans : lpFileName);
|
result = next_GetFileAttributesW(trans ? trans : lpFileName);
|
||||||
|
|
||||||
free(trans);
|
free(trans);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -11,6 +11,7 @@ typedef HRESULT (*path_hook_t)(
|
|||||||
size_t *count);
|
size_t *count);
|
||||||
|
|
||||||
HRESULT path_hook_push(path_hook_t hook);
|
HRESULT path_hook_push(path_hook_t hook);
|
||||||
|
void path_hook_insert_hooks(HMODULE target);
|
||||||
int path_compare_w(const wchar_t *string1, const wchar_t *string2, size_t count);
|
int path_compare_w(const wchar_t *string1, const wchar_t *string2, size_t count);
|
||||||
|
|
||||||
static inline bool path_is_separator_w(wchar_t c)
|
static inline bool path_is_separator_w(wchar_t c)
|
||||||
|
Loading…
Reference in New Issue
Block a user