diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2016-04-27 11:58:18 +0100 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2016-04-27 12:07:31 +0100 |
commit | ef26cb8eb5b983513a9276ee7c3aabff3f8baea5 (patch) | |
tree | 44736f07e579a7bb61e224138166fbd7cb6f384c /wrappers | |
parent | 732b066c7040b6e5b718cdb3516f82affc76c834 (diff) |
d3d9trace: Track volume/cube lock mappings per level too.
That is, generalise commit e540b63da038aacc51664451491791d627aef1de to
other resource types.
Diffstat (limited to 'wrappers')
-rw-r--r-- | wrappers/d3d9trace.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/wrappers/d3d9trace.py b/wrappers/d3d9trace.py index 0850ba3e..7e7072fc 100644 --- a/wrappers/d3d9trace.py +++ b/wrappers/d3d9trace.py @@ -57,7 +57,7 @@ class D3D9Tracer(DllTracer): if interface.getMethodByName('Lock') is not None or \ interface.getMethodByName('LockRect') is not None or \ interface.getMethodByName('LockBox') is not None: - if interface.name in ['IDirect3DTexture9']: + if interface.base.name == 'IDirect3DBaseTexture9': variables += [ ('std::map<UINT, std::pair<size_t, VOID *> >', '_MappedData', 'std::map<UINT, std::pair<size_t, VOID *> >()'), ] @@ -71,13 +71,15 @@ class D3D9Tracer(DllTracer): def implementWrapperInterfaceMethodBody(self, interface, base, method): if method.name in ('Unlock', 'UnlockRect', 'UnlockBox'): - if interface.name in ['IDirect3DTexture9']: + if interface.base.name == 'IDirect3DBaseTexture9': + assert method.getArgByName('Level') is not None print ' std::map<UINT, std::pair<size_t, VOID *> >::iterator it = _MappedData.find(Level);' print ' if (it != _MappedData.end()) {' self.emit_memcpy('(LPBYTE)it->second.second', 'it->second.first') print ' _MappedData.erase(it);' print ' }' else: + assert method.getArgByName('Level') is None print ' if (_MappedSize && m_pbData) {' self.emit_memcpy('(LPBYTE)m_pbData', '_MappedSize') print ' }' @@ -85,7 +87,8 @@ class D3D9Tracer(DllTracer): DllTracer.implementWrapperInterfaceMethodBody(self, interface, base, method) if method.name in ('Lock', 'LockRect', 'LockBox'): - if interface.name in ['IDirect3DTexture9']: + if interface.base.name == 'IDirect3DBaseTexture9': + assert method.getArgByName('Level') is not None print ' if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {' print ' size_t mappedSize;' print ' VOID * pbData;' @@ -96,6 +99,7 @@ class D3D9Tracer(DllTracer): print ' }' else: # FIXME: handle recursive locks + assert method.getArgByName('Level') is None print ' if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {' print ' _getMapInfo(_this, %s, m_pbData, _MappedSize);' % ', '.join(method.argNames()[:-1]) print ' } else {' |