hiddbg: fix IsHdlsVirtualDeviceAttached for 13.0.0

This commit is contained in:
p-sam 2021-09-22 12:44:04 +00:00 committed by fincs
parent 0cc2da720c
commit b35d42faaa
2 changed files with 8 additions and 3 deletions

View File

@ -415,10 +415,11 @@ Result hiddbgReleaseHdlsWorkBuffer(HiddbgHdlsSessionId session_id);
/** /**
* @brief Checks if the given device is still attached. * @brief Checks if the given device is still attached.
* @note Only available with [7.0.0+]. * @note Only available with [7.0.0+].
* @param[in] session_id [13.0.0+] \ref HiddbgHdlsSessionId
* @param[in] handle \ref HiddbgHdlsHandle * @param[in] handle \ref HiddbgHdlsHandle
* @param[out] out Whether the device is attached. * @param[out] out Whether the device is attached.
*/ */
Result hiddbgIsHdlsVirtualDeviceAttached(HiddbgHdlsHandle handle, bool *out); Result hiddbgIsHdlsVirtualDeviceAttached(HiddbgHdlsSessionId session_id, HiddbgHdlsHandle handle, bool *out);
/** /**
* @brief Gets state for \ref HiddbgHdlsNpadAssignment. * @brief Gets state for \ref HiddbgHdlsNpadAssignment.

View File

@ -508,7 +508,7 @@ Result hiddbgReleaseHdlsWorkBuffer(HiddbgHdlsSessionId session_id) {
return rc; return rc;
} }
Result hiddbgIsHdlsVirtualDeviceAttached(HiddbgHdlsHandle handle, bool *out) { Result hiddbgIsHdlsVirtualDeviceAttached(HiddbgHdlsSessionId session_id, HiddbgHdlsHandle handle, bool *out) {
Result rc = 0; Result rc = 0;
if (hosversionBefore(7,0,0)) if (hosversionBefore(7,0,0))
@ -517,7 +517,11 @@ Result hiddbgIsHdlsVirtualDeviceAttached(HiddbgHdlsHandle handle, bool *out) {
if (!g_hiddbgHdlsInitialized) if (!g_hiddbgHdlsInitialized)
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized); return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
rc = _hiddbgCmdNoIO(327); if (hosversionBefore(13,0,0))
rc = _hiddbgCmdNoIO(327);
else
rc = _hiddbgCmdInU64NoOut(session_id.id, 327);
if (R_FAILED(rc)) return rc; if (R_FAILED(rc)) return rc;
if (out) { if (out) {
*out = false; *out = false;