| 70 | } |
| 71 | |
| 72 | Data PhysicalDevice::getData(const std::string& name) const |
| 73 | { |
| 74 | if (name == "uuid") |
| 75 | { |
| 76 | if (!uuidSupported) |
| 77 | throw Exception(Error::InvalidArgument, "physical device UUID unavailable, check uuidSupported first"); |
| 78 | return {uuid.bytes, sizeof(uuid.bytes)}; |
| 79 | } |
| 80 | else if (name == "luid") |
| 81 | { |
| 82 | if (!luidSupported) |
| 83 | throw Exception(Error::InvalidArgument, "physical device LUID unavailable, check luidSupported first"); |
| 84 | return {luid.bytes, sizeof(luid.bytes)}; |
| 85 | } |
| 86 | else |
| 87 | throw Exception(Error::InvalidArgument, "unknown physical device parameter or type mismatch: '" + name + "'"); |
| 88 | } |
| 89 | |
| 90 | Device::Device() |
| 91 | { |