Skip to content

Commit b35d42f

Browse files
p-samfincs
authored andcommitted
hiddbg: fix IsHdlsVirtualDeviceAttached for 13.0.0
1 parent 0cc2da7 commit b35d42f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

nx/include/switch/services/hiddbg.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,11 @@ Result hiddbgReleaseHdlsWorkBuffer(HiddbgHdlsSessionId session_id);
415415
/**
416416
* @brief Checks if the given device is still attached.
417417
* @note Only available with [7.0.0+].
418+
* @param[in] session_id [13.0.0+] \ref HiddbgHdlsSessionId
418419
* @param[in] handle \ref HiddbgHdlsHandle
419420
* @param[out] out Whether the device is attached.
420421
*/
421-
Result hiddbgIsHdlsVirtualDeviceAttached(HiddbgHdlsHandle handle, bool *out);
422+
Result hiddbgIsHdlsVirtualDeviceAttached(HiddbgHdlsSessionId session_id, HiddbgHdlsHandle handle, bool *out);
422423

423424
/**
424425
* @brief Gets state for \ref HiddbgHdlsNpadAssignment.

nx/source/services/hiddbg.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ Result hiddbgReleaseHdlsWorkBuffer(HiddbgHdlsSessionId session_id) {
508508
return rc;
509509
}
510510

511-
Result hiddbgIsHdlsVirtualDeviceAttached(HiddbgHdlsHandle handle, bool *out) {
511+
Result hiddbgIsHdlsVirtualDeviceAttached(HiddbgHdlsSessionId session_id, HiddbgHdlsHandle handle, bool *out) {
512512
Result rc = 0;
513513

514514
if (hosversionBefore(7,0,0))
@@ -517,7 +517,11 @@ Result hiddbgIsHdlsVirtualDeviceAttached(HiddbgHdlsHandle handle, bool *out) {
517517
if (!g_hiddbgHdlsInitialized)
518518
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
519519

520-
rc = _hiddbgCmdNoIO(327);
520+
if (hosversionBefore(13,0,0))
521+
rc = _hiddbgCmdNoIO(327);
522+
else
523+
rc = _hiddbgCmdInU64NoOut(session_id.id, 327);
524+
521525
if (R_FAILED(rc)) return rc;
522526
if (out) {
523527
*out = false;

0 commit comments

Comments
 (0)