This call is needed to open up a branch of the Registry and returns a handle which can be used in subsequent opcodes.
xcall MIAMEX, MX'REGISTRY, 1, hkey, subkey, rights, hkeynew, status
hkey (b,4)
can be a key returned in the hkeynew parameter from a previous open, or more likely, one of the following symbols (from ashell.bsi) for the main hives in the Registry:
|
|
---|---|
HKEY'CLASSES'ROOT |
2147483648 |
HKEY'CURRENT'USER |
2147483649 |
HKEY'LOCAL'MACHINE |
2147483650 |
KEY'USERS |
2147483651 |
subkey
is a string combining one or more levels beneath the level referenced by the key hkey, for example:
SUBKEY = "SOFTWARE\MicroSabio\JBCT\ATE"
Note that subkey is not case sensitive on lookup, but when creating keys, the case specified will be retained. (Same idea as with Windows filenames.)
rights
is a numeric variable combining one or more of the following bits relating to the kind of rights you want to request for this key:
|
Value |
Description |
---|---|---|
RGKEY'QUERY'VALUE |
1 |
Ability to query a value |
RGKEY'SET'VALUE |
2 |
Ability to change or set a value |
RGKEY'CREATE'SUB'KEY |
4 |
Ability to create a new sub key |
RGKEY'ENUM'SUB'KEYS |
8 |
Ability to enumerate sub keys |
hkeynew (b,4)
will return the handle to the opened key, and will be needed for subsequent operations.
status (f,6)
returns 0 for success, or else an error code. You can convert the error code to a message using (MX'ERRNOMSG=86):
xcall MIAMEX,MX'ERRNOMSG,status,msg