I wasn't even aware that registry key names could have embedded backslashes in them. I assumed that would be a reserved character, so I didn't design VALUE() to handle them.
You have two options. You can wait for me to issue a Reginald update to alter the VALUE function to accomodate this. Or, you can use the generic call interface (ie, FUNCDEF) to register and call the OS function RegQueryValueEx() on your own, which is actually fairly easy:
OPTIONS "WINFUNC"
err = FUNCDEF("RegOpenKeyEx", "32, void, str, 32u, 32u, void stor", 'advapi32')
IF err == 0 THEN DO
SAY "Failed to register RegOpenKeyEx:" err
RETURN
END
err = FUNCDEF("RegCloseKey", "32, void", 'advapi32')
IF err == 0 THEN DO
SAY "Failed to register RegCloseKey:" err
RETURN
END
err = FUNCDEF("RegQueryBinary", "32, void, str, void, 32 *, char[260] stor, 32 * dual", 'advapi32', 'RegQueryValueEx')
IF err == 0 THEN DO
SAY "Failed to register RegQueryBinary:" err
RETURN
END
err = regopenkeyex("2147483650", "SYSTEMMountedDevices", , "131097", handle)
IF err == 0 THEN DO
valuetype = 3
myvaluesize = 260
err = regquerybinary(handle, "DosDevicesC:", , valuetype, myvalue, myvaluesize)
IF err == 0 THEN SAY "Error reading binary value:" err
ELSE DO
SAY "Length of binary data is" myvaluesize "bytes"
myvalue = LEFT(myvalue, myvaluesize)
END
CALL regclosekey(handle)
END ELSE SAY "Can't open the key:" err |