mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-04 10:32:15 +02:00
replace hiddbgGetWorkBufferTransferMemoryAddress() with hiddbgIsHdlsVirtualDeviceAttached()
This commit is contained in:
parent
8e34244089
commit
9362e2be4d
@ -182,8 +182,8 @@ Result hiddbgAttachHdlsWorkBuffer(void);
|
|||||||
/// Exit Hdls, must be called at some point prior to hiddbgExit. Only available with [7.0.0+].
|
/// Exit Hdls, must be called at some point prior to hiddbgExit. Only available with [7.0.0+].
|
||||||
Result hiddbgReleaseHdlsWorkBuffer(void);
|
Result hiddbgReleaseHdlsWorkBuffer(void);
|
||||||
|
|
||||||
/// Gets the Tmem pointer. Use only after calling hiddbgAttachHdlsWorkBuffer()
|
/// Checks if the given HdlsHandle is still attached, where the result is written to isAttached. Only available with [7.0.0+].
|
||||||
TransferMemory *hiddbgGetWorkBufferTransferMemoryAddress();
|
Result hiddbgIsHdlsVirtualDeviceAttached(u64 HdlsHandle, bool *isAttached);
|
||||||
|
|
||||||
/// Gets state for \ref HiddbgHdlsNpadAssignment. Only available with [7.0.0+].
|
/// Gets state for \ref HiddbgHdlsNpadAssignment. Only available with [7.0.0+].
|
||||||
Result hiddbgDumpHdlsNpadAssignmentState(HiddbgHdlsNpadAssignment *state);
|
Result hiddbgDumpHdlsNpadAssignmentState(HiddbgHdlsNpadAssignment *state);
|
||||||
|
@ -392,9 +392,48 @@ Result hiddbgReleaseHdlsWorkBuffer(void) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
TransferMemory *hiddbgGetWorkBufferTransferMemoryAddress()
|
Result hiddbgIsHdlsVirtualDeviceAttached(u64 HdlsHandle, bool *isAttached)
|
||||||
{
|
{
|
||||||
return &g_hiddbgHdlsTmem;
|
Result rc = 0;
|
||||||
|
|
||||||
|
if (hosversionBefore(7, 0, 0))
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
|
||||||
|
if (!g_hiddbgHdlsInitialized)
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||||
|
|
||||||
|
rc = _hiddbgCmdNoIO(327);
|
||||||
|
if (R_FAILED(rc))
|
||||||
|
return rc;
|
||||||
|
if (isAttached)
|
||||||
|
{
|
||||||
|
*isAttached = false;
|
||||||
|
if (hosversionBefore(9, 0, 0))
|
||||||
|
{
|
||||||
|
HiddbgHdlsStateListV7 *stateList = (HiddbgHdlsStateListV7 *)(g_hiddbgHdlsTmem.src_addr);
|
||||||
|
for (s32 i = 0; i < stateList->total_entries; i++)
|
||||||
|
{
|
||||||
|
if (stateList->entries[i].HdlsHandle == HdlsHandle)
|
||||||
|
{
|
||||||
|
*isAttached = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
HiddbgHdlsStateList *stateList = (HiddbgHdlsStateList *)(g_hiddbgHdlsTmem.src_addr);
|
||||||
|
for (s32 i = 0; i < stateList->total_entries; i++)
|
||||||
|
{
|
||||||
|
if (stateList->entries[i].HdlsHandle == HdlsHandle)
|
||||||
|
{
|
||||||
|
*isAttached = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result hiddbgDumpHdlsNpadAssignmentState(HiddbgHdlsNpadAssignment *state) {
|
Result hiddbgDumpHdlsNpadAssignmentState(HiddbgHdlsNpadAssignment *state) {
|
||||||
|
Loading…
Reference in New Issue
Block a user