I need restriction for time changes coming from different sources. The best way, as i think, is to hook WINAPI function SetSystemTime (and maybe SetLocalTime). I tried to hook this by using EasyHook library with injection in all running processes, owned by current system user. But it had no effect. How can I do that?
Asked
Active
Viewed 1,437 times
2 Answers
0
Any reason you cannot just P/Invoke SetSystemTime
as shown here?
Note that you need an elevated privilege to do this:
An application must have system-time privilege (the SE_SYSTEMTIME_NAME privilege) for this function to succeed.

Steve Townsend
- 53,498
- 9
- 91
- 140
-
I dont want to call SetSystemTime, i want to hook it. – Ivan Oct 28 '10 at 02:46
0
The problem was on my own system. I use Windows 7 and when i changing time via standard clock setting dialog rundll.exe process runs and it starts dllhost.exe process which calls SetLocalTime. I have tested it on another 2 PCs (WinXP & Win7) but there rundll.exe calls SetLocalTime itself.

Ivan
- 33
- 1
- 6