[Bug 32673] Rainbow Six fails to start for the first time with windows version > ME

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Sep 1 11:21:20 CDT 2013


http://bugs.winehq.org/show_bug.cgi?id=32673

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |focht at gmx.net

--- Comment #6 from Anastasius Focht <focht at gmx.net> 2013-09-01 11:21:20 CDT ---
Hello folks,

well the game relies on Windows 9X behaviour where the access rights for
registry key objects are ignored.

Wine mimics Win9X behaviour by adjusting access rights to MAXIMUM_ALLOWED when
RegCreateKeyExA/W is called hence all subsequent registry operations succeed
even if incorrect access rights were are supplied in first place.

The game code calls RegSetValueEx() on a key that was opened with
KEY_QUERY_VALUE access.
This will obviously not work for Windows NT based systems.

--- snip ---
...
0025:Call advapi32.RegCreateKeyExA(80000002,00856cf0 "Software\\Red Storm
Entertainment\\Tom Clancy's Rainbow Six
Demo",00000000,0085bba8,00000000,00000001,00000000,0033f960,0033f968)
ret=0045674d
0025:trace:reg:NtCreateKey (0x1c,L"Software\\Red Storm Entertainment\\Tom
Clancy's Rainbow Six Demo",L"Sherman Values",0,1,0x33f960)
0025:trace:reg:NtCreateKey <- 0x6c
0025:Ret  advapi32.RegCreateKeyExA() retval=00000000 ret=0045674d

0025:Call advapi32.RegQueryValueExA(0000006c,00856a5c "Movie
On",00000000,0033f96c,0033f970,0033f964) ret=00456783
0025:trace:reg:RegQueryValueExA (0x6c,"Movie
On",(nil),0x33f96c,0x33f970,0x33f964=256)
0025:trace:reg:NtQueryValueKey (0x6c,L"Movie On",2,0x33f798,256)
0025:Ret  advapi32.RegQueryValueExA() retval=00000002 ret=00456783

0025:Call advapi32.RegSetValueExA(0000006c,00856a5c "Movie
On",00000000,00000001,011ec4a0,00000004) ret=004567bd
0025:trace:reg:NtSetValueKey (0x6c,L"Movie On",1,0x134b88,10)
0025:Ret  advapi32.RegSetValueExA() retval=00000005 ret=004567bd
0025:Call advapi32.RegCloseKey(0000006c) ret=004567cc
0025:Ret  advapi32.RegCloseKey() retval=00000000 ret=004567cc 
...
--- snip ---

Annotated:

--- snip ---
RegCreateKeyExA:

0033F930  80000002  ; hKey = HKEY_LOCAL_MACHINE
0033F934  00856CF0  ; Subkey = "Software\Red Storm Entertainment\Tom Clancy's
Rainbow Six Demo"
0033F938  00000000  ; Reserved = 0
0033F93C  0085BBA8  ; Class = "Sherman Values"
0033F940  00000000  ; Options = REG_OPTION_NON_VOLATILE
0033F944  00000001  ; DesiredAccess = KEY_QUERY_VALUE
0033F948  00000000  ; pSecurity = NULL
0033F94C  0033F960  ; pResult = 0033F960 -> 006228C1
0033F950  0033F968  ; pDisposition = 0033F968 -> 11EB000

RegQueryValueExA:

0033F93C  0000006C  ; hKey = 0000006C
0033F940  00856A5C  ; Name = "Movie On"
0033F944  00000000  ; Reserved = 0
0033F948  0033F96C  ; pType = 0033F96C -> 18788515.
0033F94C  0033F970  ; pData = 0033F970 -> AC
0033F950  0033F964  ; pDataLen = 0033F964 -> 256.

ret = 0x2

RegSetValueExA:

0033F93C  0000006C  ; hKey = 0000006C
0033F940  00856A5C  ; SubKey = "Movie On"
0033F944  00000000  ; Reserved = 0
0033F948  00000001  ; Type = REG_SZ
0033F94C  011EC4A0  ; Data = 011EC4A0 -> 54
0033F950  00000004  ; DataSize = 4

ret = 0x5
--- snip ---

MSDN:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724923%28v=vs.85%29.aspx

--- quote ---
hKey [in]

    A handle to an open registry key. The key must have been opened with the
KEY_SET_VALUE access right. For more information, see Registry Key Security and
Access Rights.

...
--- quote ---

The reason why this game still works on NT-based systems is called
appcompat/application shims.

Unless Wine supports this feature (there was some talk on wine dev list, search
for "apphelp") use the simple workarounds as described in this bug.

It might be useful to introduce a special keyword to flag bugs targeting broken
apps/games ("appcompat" or "appshim" ...).

Regards

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list