Yoko
http://forum.yoko.com.ua/

failed to install hook in client
http://forum.yoko.com.ua/viewtopic.php?f=1&t=1469
Page 1 of 1

Author:  vale [ 2004-09-26 15:39:48 ]
Post subject:  failed to install hook in client

i have this problem...


how can resolve it?


in english plz :(

Author:  Lord Ruslan Nightmare [ 2004-10-02 09:37:02 ]
Post subject: 

Try to dig up hook installing.
Code:
    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:

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.

Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/