Following code produces the error:
error C2296: '*' : illegal, left operand has type '__int64 *'|
Error line (<——)
DWORD increasefactor = 1;
__int64 initialtime64 = 0;
__int64 initialoffset64 = 0;
...
BOOL WINAPI QueryPerformanceCounter_Detour(__int64 *lp)
{
BOOL ret = QueryPerformanceCounter_Trampoline(lp);
lp = ((lp-initialtime64)*increasefactor)+initialoffset64; // <------
return ret;
}
Where is my fault?
Thanks a lot in advance.
lpis a pointer to an__int64, not an actual__int64. The expressionattempts to assign an integer to a pointer to an integer, not to mention the fact that you are subtracting from that same pointer later in the same line.
You need to dereference the pointer with the
*operator to get at the value pointed to bylp.You should probably also read up on pointers in C++/C.