| 166 | } |
| 167 | |
| 168 | bool BNSharedCacheControllerApplyImage( |
| 169 | BNSharedCacheController* controller, BNBinaryView* data, BNSharedCacheImage* image) |
| 170 | { |
| 171 | Ref<BinaryView> view = new BinaryView(BNNewViewReference(data)); |
| 172 | // LoadImage will use the header, lets do everyone a favor and use the existing image! |
| 173 | if (const auto realImage = controller->object->GetCache().GetImageAt(image->headerAddress)) |
| 174 | return controller->object->ApplyImage(*view, *realImage); |
| 175 | // They gave us an unknown image, we will not have header information. |
| 176 | return controller->object->ApplyImage(*view, ImageFromApi(*image)); |
| 177 | } |
| 178 | |
| 179 | bool BNSharedCacheControllerApplyRegion( |
| 180 | BNSharedCacheController* controller, BNBinaryView* data, BNSharedCacheRegion* region) |
no test coverage detected