[Bug 9685] Punkbuster removes me from game for UNKNOWN WINDOWS API FUNCTION [131124]

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Sep 30 17:04:44 CDT 2007


--- Comment #53 from Anastasius Focht <focht at gmx.net>  2007-09-30 17:04:43 ---
Created an attachment (id=8322)
 --> (http://bugs.winehq.org/attachment.cgi?id=8322)
patch to implement device object access mapping


after hours of placing traces into wineserver and looking at the code I finally
found the cause.
Seems the access rights mapping was wrong due to fallback mapper if no handler
is present for the object.

--- snip (additional trace code by me) ---
0027: open_file_object( access=c0000000, attributes=00000040, rootdir=(nil),
sharing=00000001, options=00000050, filename=L"\\??\\pnkbstrk_link" )
alloc_handle(1): ptr=0x924a740, acc=c0000000, attr=40
alloc_handle(2): ptr=0x924a740, acc=20000, attr=40
alloc_entry(): handle=0x64, access=0x20000
0027: open_file_object() = 0 { handle=0x64 }
0027: ioctl( handle=0x64, code=002261c0,
in_data={67,c4,3c,81,00,00,00,00} )
get_handle_obj(): access problem: handle=0x64, req_acc=1, now=0x20000
0027: ioctl() = ACCESS_DENIED { wait=(nil), options=00000000, out_data={} } 
--- snip ---

When a handle for an object is created in wineserver (alloc_handle), object
access rights are remapped which is usually something like this (example from
file object):

--- snip ---
static unsigned int generic_file_map_access( unsigned int access )
    if (access & GENERIC_READ)    access |= FILE_GENERIC_READ;
    if (access & GENERIC_WRITE)   access |= FILE_GENERIC_WRITE;
    if (access & GENERIC_EXECUTE) access |= FILE_GENERIC_EXECUTE;
    if (access & GENERIC_ALL)     access |= FILE_ALL_ACCESS;
--- snip ---

If no mapping handler is present, a default handler is called.
Well this default (fallback) handler mapping was not suited for device object
case and resulted in wrong access right bitmasks which later led to access

The patch resembles file objects mapper for device objects.
Now the kernel mode driver gets its device io control requests.


Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the wine-bugs mailing list