[Wine] Re: Assign a different date for software execution

hellork wineforum-user at winehq.org
Wed Mar 31 14:37:14 CDT 2010


eiem wrote:
> I would like to start a software (which has expiration date!!) giving a differetn date from the one of the system. Is it possible to do it with envoirment variables or any other way? i dont wanna change the true date in my OS !
> 
> Thanks
> 
> Alex

Wine implements the normal Windows time functions, which get their time from unix (Time Functions, n.d.), so there is no time/date override you can set directly.

However... Wine is open-source, so you could do some hacking.

To get you started, wine's (GetSystemTime, n.d.). is in kernel32. Using grep GetSystemTime within Downloads/src/wine/dlls/kernel32 reveals the function is located in, guess what, time.c

Looking at time.c and using similar detective work (let me know if there is an easier way to navigate this) reveals that wine's implementation is just a wrapper for ntdll time.c NtQuerySystemTime(), which gets the time from unix gettimeofday().

Anywhere along the chain you could, for example, perform some subtraction magic, or even go so far as to get the value to subtract by using the registry. (Registry Functions, n.d.)

Ref.

GetSystemTime Function (Windows). (n.d.). . Retrieved March 31, 2010, from http://msdn.microsoft.com/en-us/library/ms724390(v=VS.85).aspx

Registry Functions (Windows). (n.d.). . Retrieved March 31, 2010, from http://msdn.microsoft.com/en-us/library/ms724875(VS.85).aspx

Time Functions (Windows). (n.d.). . Retrieved March 31, 2010, from http://msdn.microsoft.com/en-us/library/ms725473(VS.85).aspx







More information about the wine-users mailing list