mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-24 02:51:20 -08:00
Lint
This commit is contained in:
1 parent
02ca403e24
commit
2fc64b3e8b
7 files changed
+81
-67
No files matched your search
@@ -25,6 +25,7 @@ private interface RegistryNotify : Library {
|
||||
const val REG_NOTIFY_CHANGE_LAST_SET = 0x00000004
|
||||
}
|
||||
|
||||
@Suppress("FunctionName")
|
||||
fun RegNotifyChangeKeyValue(
|
||||
hKey: WinReg.HKEY,
|
||||
bWatchSubtree: Boolean,
|
||||
@@ -86,15 +87,25 @@ internal fun windowsVRCConfigFlow(): Flow<VRCConfigValues?> = flow {
|
||||
try {
|
||||
if (hEvent != null) {
|
||||
RegistryNotify.INSTANCE.RegNotifyChangeKeyValue(
|
||||
phkResult.value, false, RegistryNotify.REG_NOTIFY_CHANGE_LAST_SET, hEvent, true,
|
||||
phkResult.value,
|
||||
false,
|
||||
RegistryNotify.REG_NOTIFY_CHANGE_LAST_SET,
|
||||
hEvent,
|
||||
true,
|
||||
)
|
||||
}
|
||||
|
||||
val keys = windowsGetVRChatKeys(VRC_REG_PATH)
|
||||
emit(if (keys.isEmpty()) null else buildVRCConfigValues(
|
||||
intValue = { key -> keys[key]?.let { windowsGetDwordValue(VRC_REG_PATH, it) } },
|
||||
doubleValue = { key -> keys[key]?.let { windowsGetQwordValue(VRC_REG_PATH, it) } },
|
||||
))
|
||||
emit(
|
||||
if (keys.isEmpty()) {
|
||||
null
|
||||
} else {
|
||||
buildVRCConfigValues(
|
||||
intValue = { key -> keys[key]?.let { windowsGetDwordValue(VRC_REG_PATH, it) } },
|
||||
doubleValue = { key -> keys[key]?.let { windowsGetQwordValue(VRC_REG_PATH, it) } },
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
if (hEvent != null) {
|
||||
withContext(Dispatchers.IO) { Kernel32.INSTANCE.WaitForSingleObject(hEvent, WinBase.INFINITE) }
|
||||
|
||||
Reference in new issue
Block a user