| 789 | |
| 790 | template< typename Params > |
| 791 | static NTSTATUS steamclient_get_unix_buffer( Params *params, bool wow64 ) |
| 792 | { |
| 793 | struct cache_entry *entry; |
| 794 | struct rb_entry *ptr; |
| 795 | |
| 796 | pthread_mutex_lock( &buffer_cache_lock ); |
| 797 | auto iter = buffer_cache.find( params->buf ); |
| 798 | if (iter != buffer_cache.end()) params->ptr = iter->second; |
| 799 | else |
| 800 | { |
| 801 | memcpy( params->ptr, (char *)params->buf, params->buf.len ); |
| 802 | buffer_cache[params->buf] = params->ptr; |
| 803 | } |
| 804 | pthread_mutex_unlock( &buffer_cache_lock ); |
| 805 | |
| 806 | return 0; |
| 807 | } |
| 808 | |
| 809 | template< typename Params > |
| 810 | static NTSTATUS steamclient_CreateInterface( Params *params, bool wow64 ) |