failed to install hook in client

General Injection issues

Moderators: Murderator+, Murderator

Post Reply
vale
Posts: 1
Joined: 2004-09-26 15:38:19

failed to install hook in client

Post by vale »

i have this problem...


how can resolve it?


in english plz :(
Lord Ruslan Nightmare
Expert!
Posts: 359
Joined: 2004-04-25 11:11:07
Contact:

Post by Lord Ruslan Nightmare »

Try to dig up hook installing.

Code: Select all

    g_patch_hhook = SetWindowsHookEx(WH_GETMESSAGE, patch_GetMsgProc,
        g_hinstance, client_thread_id);

    if(g_patch_hhook == 0)
    {
        api_error("Failed to install hook in client");
        return false;
    }


WinAPI SDK says:

Code: Select all


HHOOK SetWindowsHookEx(

    int idHook,   // type of hook to install
    HOOKPROC lpfn,   // address of hook procedure
    HINSTANCE hMod,   // handle of application instance
    DWORD dwThreadId    // identity of thread to install hook for
   );
An error may occur if the hMod parameter is NULL and the dwThreadId parameter is zero or specifies the identifier of a thread created by another process.

So, try to vary thease things, and call SetLastError(0) before SetWindowsHookEx() call, and call GetLastError() and FormatMessage() after.
Без труда не выловишь и рыбку из пруда,
А без пруда не выловишь её и с трудом...
Post Reply