| 280 | |
| 281 | |
| 282 | void MonitoringData::read(const char* userName, TempSpace& temp) |
| 283 | { |
| 284 | offset_t position = temp.getSize(); |
| 285 | |
| 286 | // Copy data of all permitted sessions |
| 287 | |
| 288 | for (ULONG offset = HEADER_SIZE; offset < m_sharedMemory->getHeader()->used;) |
| 289 | { |
| 290 | const auto ptr = (UCHAR*) m_sharedMemory->getHeader() + offset; |
| 291 | const auto element = (Element*) ptr; |
| 292 | const ULONG length = element->getBlockLength(); |
| 293 | |
| 294 | if (!userName || !strcmp(element->userName, userName)) // permitted |
| 295 | { |
| 296 | temp.write(position, ptr + sizeof(Element), element->length); |
| 297 | position += element->length; |
| 298 | } |
| 299 | |
| 300 | offset += length; |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | |
| 305 | ULONG MonitoringData::setup(AttNumber att_id, const char* userName, ULONG generation) |
no test coverage detected