Fix decoding of IOCTLs with padding at the end

This commit is contained in:
Billy Laws 2022-08-31 15:14:30 +01:00
parent 82444f3b0a
commit 5841799420

View File

@ -55,7 +55,11 @@ namespace skyline::service::nvdrv::deserialisation {
return make_ref_tuple(buffer.subspan(offset).template cast<RemoveAutoSizeSpan<ArgType>, std::dynamic_extent, true>()); return make_ref_tuple(buffer.subspan(offset).template cast<RemoveAutoSizeSpan<ArgType>, std::dynamic_extent, true>());
} else if constexpr (IsPad<ArgType>::value) { } else if constexpr (IsPad<ArgType>::value) {
offset += ArgType::Bytes; offset += ArgType::Bytes;
return DecodeArgumentsImpl<Desc, ArgTypes...>(buffer, offset, saveSlots); if constexpr(sizeof...(ArgTypes) == 0) {
return std::tuple{};
} else {
return DecodeArgumentsImpl<Desc, ArgTypes...>(buffer, offset, saveSlots);
}
} else if constexpr (IsSave<ArgType>::value) { } else if constexpr (IsSave<ArgType>::value) {
saveSlots[ArgType::SaveSlot] = buffer.subspan(offset).template as<RemoveSave<ArgType>, true>(); saveSlots[ArgType::SaveSlot] = buffer.subspan(offset).template as<RemoveSave<ArgType>, true>();
offset += sizeof(RemoveSave<ArgType>); offset += sizeof(RemoveSave<ArgType>);