From 4244c6e523cdd66ae77934d92409531c8ffb611b Mon Sep 17 00:00:00 2001 From: HookedBehemoth Date: Fri, 24 Apr 2020 14:12:55 +0200 Subject: [PATCH] add version checks --- nx/source/services/capssc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nx/source/services/capssc.c b/nx/source/services/capssc.c index ea1644b1..4e3cfbfb 100644 --- a/nx/source/services/capssc.c +++ b/nx/source/services/capssc.c @@ -44,6 +44,9 @@ Result capsscCaptureRawImageWithTimeout(void* buf, size_t size, ViLayerStack lay } Result capsscOpenRawScreenShotReadStream(u64 *out_size, u64 *out_width, u64 *out_height, ViLayerStack layer_stack, s64 timeout) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + const struct { ViLayerStack layer_stack; u64 timeout; @@ -66,10 +69,16 @@ Result capsscOpenRawScreenShotReadStream(u64 *out_size, u64 *out_width, u64 *out } Result capsscCloseRawScreenShotReadStream() { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + return serviceDispatch(&g_capsscSrv, 1202); } Result capsscReadRawScreenShotReadStream(u64 *bytes_read, void *buf, size_t size, u64 offset) { + if (hosversionBefore(3,0,0)) + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + return serviceDispatchInOut(&g_capsscSrv, 1203, offset, *bytes_read, .buffer_attrs = { SfBufferAttr_Out | SfBufferAttr_HipcMapAlias }, .buffers = { { buf, size } },