| 117 | } |
| 118 | |
| 119 | std::unique_ptr<uint8_t[]> IniFile::ReadBinary(PCWSTR section, PCWSTR name, unsigned& size) { |
| 120 | size = (unsigned)ReadInt(section, name + CString(L"_size")); |
| 121 | if (size == 0) |
| 122 | return nullptr; |
| 123 | auto buffer = std::make_unique<uint8_t[]>(size); |
| 124 | if (buffer == nullptr) |
| 125 | return nullptr; |
| 126 | ::GetPrivateProfileStruct(section, name, buffer.get(), size, _path); |
| 127 | return buffer; |
| 128 | } |