mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Implement IFSDeviceOperator "ChallengeCardExistence" and "GetGameCardDeviceCertificate"
This commit is contained in:
parent
ce1f87050d
commit
827c6b6ddf
@ -650,7 +650,9 @@ 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 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);
|
||||||
|
Result fsDeviceOperatorChallengeCardExistence(FsDeviceOperator* d, const FsGameCardHandle* handle, void* dst, size_t dst_size, void* seed, size_t seed_size, void* value, size_t value_size);
|
||||||
void fsDeviceOperatorClose(FsDeviceOperator* d);
|
void fsDeviceOperatorClose(FsDeviceOperator* d);
|
||||||
|
@ -1226,6 +1226,17 @@ 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) {
|
||||||
|
const struct {
|
||||||
|
FsGameCardHandle handle;
|
||||||
|
s64 buffer_size;
|
||||||
|
} in = { *handle, size };
|
||||||
|
|
||||||
|
return _fsObjectDispatchIn(&d->s, 206, in,
|
||||||
|
.buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out },
|
||||||
|
.buffers = { { dst, dst_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) {
|
||||||
return _fsCmdInSizeOutBuffer(&d->s, dst, dst_size, size, 208);
|
return _fsCmdInSizeOutBuffer(&d->s, dst, dst_size, size, 208);
|
||||||
}
|
}
|
||||||
@ -1242,6 +1253,24 @@ Result fsDeviceOperatorGetGameCardDeviceId(FsDeviceOperator* d, void* dst, size_
|
|||||||
return _fsCmdInSizeOutBuffer(&d->s, dst, dst_size, size, 218);
|
return _fsCmdInSizeOutBuffer(&d->s, dst, dst_size, size, 218);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result fsDeviceOperatorChallengeCardExistence(FsDeviceOperator* d, const FsGameCardHandle* handle, void* dst, size_t dst_size, void* seed, size_t seed_size, void* value, size_t value_size) {
|
||||||
|
if (hosversionBefore(8,0,0))
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
|
||||||
|
return _fsObjectDispatchIn(&d->s, 219, *handle,
|
||||||
|
.buffer_attrs = {
|
||||||
|
SfBufferAttr_HipcMapAlias | SfBufferAttr_Out,
|
||||||
|
SfBufferAttr_HipcMapAlias | SfBufferAttr_In,
|
||||||
|
SfBufferAttr_HipcMapAlias | SfBufferAttr_In,
|
||||||
|
},
|
||||||
|
.buffers = {
|
||||||
|
{ dst, dst_size },
|
||||||
|
{ seed, seed_size },
|
||||||
|
{ value, value_size },
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
void fsDeviceOperatorClose(FsDeviceOperator* d) {
|
void fsDeviceOperatorClose(FsDeviceOperator* d) {
|
||||||
_fsObjectClose(&d->s);
|
_fsObjectClose(&d->s);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user