mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
fs: add new outsize parameter to fsDeviceOperatorGetGameCardDeviceCertificate
This commit is contained in:
parent
a6924f2740
commit
9323db31d1
@ -683,7 +683,7 @@ Result fsDeviceOperatorIsGameCardInserted(FsDeviceOperator* d, bool* out);
|
|||||||
Result fsDeviceOperatorGetGameCardHandle(FsDeviceOperator* d, FsGameCardHandle* out);
|
Result fsDeviceOperatorGetGameCardHandle(FsDeviceOperator* d, FsGameCardHandle* out);
|
||||||
Result fsDeviceOperatorGetGameCardUpdatePartitionInfo(FsDeviceOperator* d, const FsGameCardHandle* handle, FsGameCardUpdatePartitionInfo* out);
|
Result fsDeviceOperatorGetGameCardUpdatePartitionInfo(FsDeviceOperator* d, const FsGameCardHandle* handle, FsGameCardUpdatePartitionInfo* out);
|
||||||
Result fsDeviceOperatorGetGameCardAttribute(FsDeviceOperator* d, const FsGameCardHandle* handle, u8 *out);
|
Result fsDeviceOperatorGetGameCardAttribute(FsDeviceOperator* d, const FsGameCardHandle* handle, u8 *out);
|
||||||
Result fsDeviceOperatorGetGameCardDeviceCertificate(FsDeviceOperator* d, const FsGameCardHandle* handle, void* dst, size_t dst_size, s64 size);
|
Result fsDeviceOperatorGetGameCardDeviceCertificate(FsDeviceOperator* d, const FsGameCardHandle* handle, void* dst, size_t dst_size, s64* out_size, s64 size);
|
||||||
Result fsDeviceOperatorGetGameCardIdSet(FsDeviceOperator* d, void* dst, size_t dst_size, s64 size);
|
Result fsDeviceOperatorGetGameCardIdSet(FsDeviceOperator* d, void* dst, size_t dst_size, s64 size);
|
||||||
Result fsDeviceOperatorGetGameCardErrorReportInfo(FsDeviceOperator* d, FsGameCardErrorReportInfo* out);
|
Result fsDeviceOperatorGetGameCardErrorReportInfo(FsDeviceOperator* d, FsGameCardErrorReportInfo* out);
|
||||||
Result fsDeviceOperatorGetGameCardDeviceId(FsDeviceOperator* d, void* dst, size_t dst_size, s64 size);
|
Result fsDeviceOperatorGetGameCardDeviceId(FsDeviceOperator* d, void* dst, size_t dst_size, s64 size);
|
||||||
|
@ -1233,15 +1233,32 @@ Result fsDeviceOperatorGetGameCardAttribute(FsDeviceOperator* d, const FsGameCar
|
|||||||
return _fsObjectDispatchInOut(&d->s, 205, *handle, *out);
|
return _fsObjectDispatchInOut(&d->s, 205, *handle, *out);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result fsDeviceOperatorGetGameCardDeviceCertificate(FsDeviceOperator* d, const FsGameCardHandle* handle, void* dst, size_t dst_size, s64 size) {
|
Result fsDeviceOperatorGetGameCardDeviceCertificate(FsDeviceOperator* d, const FsGameCardHandle* handle, void* dst, size_t dst_size, s64* out_size, s64 size) {
|
||||||
const struct {
|
const struct {
|
||||||
FsGameCardHandle handle;
|
FsGameCardHandle handle;
|
||||||
s64 buffer_size;
|
s64 buffer_size;
|
||||||
} in = { *handle, size };
|
} in = { *handle, size };
|
||||||
|
|
||||||
return _fsObjectDispatchIn(&d->s, 206, in,
|
s64 os;
|
||||||
|
Result rc;
|
||||||
|
|
||||||
|
if (hosversionAtLeast(19,0,0)) {
|
||||||
|
rc = _fsObjectDispatchInOut(&d->s, 206, in, os,
|
||||||
.buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out },
|
.buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out },
|
||||||
.buffers = { { dst, dst_size } });
|
.buffers = { { dst, dst_size } });
|
||||||
|
} else {
|
||||||
|
rc = _fsObjectDispatchIn(&d->s, 206, in,
|
||||||
|
.buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out },
|
||||||
|
.buffers = { { dst, dst_size } });
|
||||||
|
|
||||||
|
// Assume old gamecard certificate size on pre-19.0.0
|
||||||
|
os = 0x200;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc))
|
||||||
|
*out_size = os;
|
||||||
|
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result fsDeviceOperatorGetGameCardIdSet(FsDeviceOperator* d, void* dst, size_t dst_size, s64 size) {
|
Result fsDeviceOperatorGetGameCardIdSet(FsDeviceOperator* d, void* dst, size_t dst_size, s64 size) {
|
||||||
|
Loading…
Reference in New Issue
Block a user