- if interface.name in self.bufferInterfaceNames and method.name == 'Lock':
- getDescMethod = interface.getMethodByName('GetDesc')
- descArg = getDescMethod.args[0]
- assert descArg.output
- descType = getDescMethod.args[0].type.type
-
- print ' if (!SizeToLock) {'
- print ' %s Desc;' % descType
- print ' _this->GetDesc(&Desc);'
- print ' SizeToLock = Desc.Size;'
- print ' }'
+ if method.name in ('Lock', 'LockRect', 'LockBox'):
+ print ' VOID *_pbData = NULL;'
+ print ' size_t _LockedSize = 0;'
+ print ' _getLockInfo(_this, %s, _pbData, _LockedSize);' % ', '.join(method.argNames()[:-1])
+ print ' _this->SetPrivateData(GUID_APITRACE, &_pbData, sizeof _pbData, 0);'
+
+ if method.name in ('Unlock', 'UnlockRect', 'UnlockBox'):
+ print ' VOID *_pbData = 0;'
+ print ' DWORD dwSizeOfData = sizeof _pbData;'
+ print ' _this->GetPrivateData(GUID_APITRACE, &_pbData, &dwSizeOfData);'
+ print ' if (_pbData) {'
+ print ' retrace::delRegionByPointer(_pbData);'
+ print ' }'