I was reading a man page about CreateTimerQueueTimer.
BOOL CreateTimerQueueTimer( PHANDLE phNewTimer, HANDLE TimerQueue, WAITORTIMERCALLBACK Callback, PVOID DueTime, DWORD Period, DWORD Flags, ULONG Parameter );
The doc states:
The period of the timer, in milliseconds. If this parameter is zero, the timer is signaled once.
So I needed to set this to 0 to avoid the callback to be executed periodically.
The problem was that modifying the
period value has no effect on periodicity. Once loaded in OllyDBG, Olly reconstructed the arguments and the call giving me this function signature :
BOOL CreateTimerQueueTimer( PHANDLE phNewTimer, HANDLE TimerQueue, WAITORTIMERCALLBACK Callback, ULONG Parameter, PVOID DueTime, DWORD Period, DWORD Flags );
Notice that the
parameter argument changed position, and thus all my patches was useless. I guess this error might be due to an old version of the API where the
Parameter argument was in 4th position, but I can be wrong. Also, I can't find old WinAPIs to confirm my sayings.
Am I guessing right or am I missing something?