mscoree: Load settings (for now only reported version) from Registry on initialization (2/4)

Paul Chitescu paulc at voip.null.ro
Mon Nov 13 20:30:42 CST 2006


On Mon, 13 Nov 2006, James Hawkins wrote:
> On 11/13/06, Paul Chitescu <paulc at voip.null.ro> wrote:
>> Changelog: mscoree: Load settings (for now only reported version) from
>> Registry on initialization (2/4)
>> 
>
> +    /* @@ Wine registry key: HKCU\Software\Wine\CLR */
> +    if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Wine\\CLR", 0,
> KEY_READ, &key) == ERROR_SUCCESS) {
> +	char buffer[BUFFER_MAX];
> +	DWORD type = 0;
> +	DWORD length = sizeof(buffer);
> +	if (RegQueryValueExA(key, "RuntimeVersion", 0, &type,
> (LPBYTE)buffer, &length) == ERROR_SUCCESS)
> +	    wine_utf8_mbstowcs(0, buffer, length, currentCORversion, 
> BUFFER_MAX);
> +	else
> +	    lstrcpyW(currentCORversion,defaultCORversion);
> +	RegCloseKey(key);
> +    }
> +    else {
> +	lstrcpyW(currentCORversion,defaultCORversion);
> +    }
> +}
>
> This isn't how Windows stores the COR version, why are we doing it this way?

Windows doesn't store the version anywhere, it's hardcoded in each of the 
installed runtimes and the mscoree.dll returns one of them - for 
GetCORVersion it returns the highest available, for other functions 
depends on what the executable requires.

But remember, we are just _emulating_ windows and sometimes we need to 
pretend we have a different version.

Paul Chitescu



More information about the wine-devel mailing list