| 159 | |
| 160 | |
| 161 | void INF_blob_info(const blb* blob, |
| 162 | const ULONG item_length, |
| 163 | const UCHAR* items, |
| 164 | const ULONG output_length, |
| 165 | UCHAR* info) |
| 166 | { |
| 167 | /************************************** |
| 168 | * |
| 169 | * I N F _ b l o b _ i n f o |
| 170 | * |
| 171 | ************************************** |
| 172 | * |
| 173 | * Functional description |
| 174 | * Process requests for blob info. |
| 175 | * |
| 176 | **************************************/ |
| 177 | CHECK_INPUT("INF_blob_info"); |
| 178 | |
| 179 | UCHAR buffer[BUFFER_TINY]; |
| 180 | USHORT length; |
| 181 | |
| 182 | const UCHAR* const end_items = items + item_length; |
| 183 | const UCHAR* const end = info + output_length; |
| 184 | UCHAR* start_info; |
| 185 | |
| 186 | if (items[0] == isc_info_length) |
| 187 | { |
| 188 | start_info = info; |
| 189 | items++; |
| 190 | } |
| 191 | else |
| 192 | start_info = 0; |
| 193 | |
| 194 | while (items < end_items && *items != isc_info_end && info < end) |
| 195 | { |
| 196 | UCHAR item = *items++; |
| 197 | |
| 198 | switch (item) |
| 199 | { |
| 200 | case isc_info_end: |
| 201 | break; |
| 202 | |
| 203 | case isc_info_blob_num_segments: |
| 204 | length = INF_convert(blob->getSegmentCount(), buffer); |
| 205 | break; |
| 206 | |
| 207 | case isc_info_blob_max_segment: |
| 208 | length = INF_convert(static_cast<ULONG>(blob->getMaxSegment()), buffer); |
| 209 | break; |
| 210 | |
| 211 | case isc_info_blob_total_length: |
| 212 | length = INF_convert(blob->blb_length, buffer); |
| 213 | break; |
| 214 | |
| 215 | case isc_info_blob_type: |
| 216 | buffer[0] = (blob->blb_flags & BLB_stream) ? 1 : 0; |
| 217 | length = 1; |
| 218 | break; |
no test coverage detected