PROC bHook(LPSTR BaseLibraryName, LPSTR BaseFunctionName, PROC NewFunctionPointer, bool UnHook, PROC Custom)
{
PROC hBaseProc;
    return hBaseProc;

}

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
        case DLL_PROCESS_ATTACH:
            OutputDebugString("--------Detour dll Load!");

        bHook("KERNEL32.DLL", "CopyFileW", (PROC)MyCopyFileW, false, 0);

            break;
        case DLL_THREAD_ATTACH:
            break;
        case DLL_THREAD_DETACH:
            break;
        case DLL_PROCESS_DETACH:
            OutputDebugString("---------Detour dll exit");

            break;
    }
    return TRUE;
}

error C2440: 'type cast' : cannot convert from '' to 'int (__stdcall *)(void)'
None of the functions with this name in scope match the target type

I have encounter this error message from visual c++ 6.0.

Please help

Have you defined MyCopyFileW?

Hi guys,
i am trying to hook a MyCopyFileW function in OS, that is ideally whenever a copy function is performed, another copy function will override it, with the stuffs i want it to do.

I am not sure if this is the correct copy function.

Any idea how to do it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.