WiseMo Guest Component API
Registry

Back to Index

This page describes param to InvokeRmOperation call and returned value from OnRmOperationResult for snapinId = 15004.

Note

When operation fails, OnRmOperationResult comes with non-zero status and Error object in value:

{
"Error" : {
"code" : 4101,
"message" : "Failed to send RM command"
}
}


When status is zero, value is as provided in following documentation.

Paged output

RM requests may yield lots of data so responses are restricted in size.
That's where StartAt, UpTo and Total are used.


StartAt


UpTo says which StartAt use next to continue data retrieval


Total says how many data at all. When UpTo equals to Total, then all data has been retrieved.

Registry constants

Key values:

Note
Other predefined keys mentioned in MSDN cannot be used and will produce Invalid handle error.

Type values:

See Registry Value Types in MSDN documentation.

Operation: Check if supported

snapinId=15004 opId=0

Check if host supports Registry subsystem (Snap-In) for RM calls.

Parameters

{}

Returns

{
"Supported" : 1
}


Supported 1 if supports, 0 if not

Operation: Get registry item

snapinId=15004 opId=501

Parameters

{ "StartAt":-1, "Key":2147483649, "SubKey":"Control Panel\\Appearance"}


Key see Key values
StartAt see Paged output

Returns

{
"Keys" : [
{
"HasChildren" : 1,
"Name" : "New Schemes"
},
{
"HasChildren" : 0,
"Name" : "Schemes"
}
],
"StartAt" : 0,
"Total" : 6,
"UpTo" : 6,
"Values" : [
{
"Name" : "",
"Value" : "",
"Type" : 1,
"ValSize" : 0
},
{
"Name" : "Current",
"Value" : "",
"Type" : 1,
"ValSize" : 2
},
{
"Value" : [
255,
255,
255,
0,
...
0
],
"Name" : "CustomColors",
"Type" : 3,
"ValSize" : 64
},
{
"Name" : "NewCurrent",
"Value" : "",
"Type" : 1,
"ValSize" : 2
}
]
}


Type see Type values

May return Error with code

Operation: Rename registry item

snapinId=15004 opId=502

Parameters

{
"IsValue" : 0,
"Key" : 2147483649,
"Name" : "__Test__",
"NewName" : "__Test2__",
"Subkey" : ""
}


Key see Key values
Subkey f.e. "Software\\Acme Corp"
IsValue whether Name refers to named value or key

May return Error with code

Returns

null

Operation: Delete registry item

snapinId=15004 opId=503

Parameters

{
"IsValue" : 0,
"Key" : 2147483649,
"Name" : "__Test2__",
"Subkey" : ""
}


Key see Key values
Subkey f.e. "Software\\Acme Corp"
IsValue whether or not Subkey refers to named value

Returns

null

Operation: Add registry key

snapinId=15004 opId=504

Parameters

{
"Key" : 2147483649,
"Subkey" : "Software"
}


Key see Key values
Subkey f.e. "Software\\Acme Corp"

Returns

{
"Name" : "New Key #3"
}

Operation: Add registry value

snapinId=15004 opId=505

Parameters

{
"Value" : 33,
"Key" : 2147483649,
"Subkey" : "Software\\Acme Co",
"Type" : 4
}


Key see Key values
Type see Type values

Returns

{
"Name" : "New Value #12"
}

Operation: Set registry value

snapinId=15004 opId=506

Parameters

{
"Value" : 33,
"Key" : 2147483649,
"Name" : "",
"Subkey" : "__Test__",
"Type" : 4
}


Key see Key values
Subkey f.e. "Software\\Acme Corp"

Returns

null

Operation: Find registry item

snapinId=15004 opId=507

Parameters

{
"Key" : 2147483649,
"Subkey" : "",
"IsValue" : 0,
"Value" : "Acme Co",
"Name": "",
"Flags" : 7
}

Returns

{
"Key" : 2147483649,
"Subkey" : "Software\\Acme Co",
"IsValue" : 0,
"Value" : "Acme Co",
"Name": "",
"Flags" : 7
}


Key see Key values
Subkey f.e. "Software\\Acme Corp"
Flags


Value text to search
Name name of the named value
IsValue whether or not there is named value

When search yields no result in the current hive SubKey will be empty, otherwise SubKey points to the key where data is found.

To resume search

Operation: Import registry key

snapinId=15004 opId=508

Parameters

Command has two forms:
1)

{
"Data" : "REGEDIT4\r\n\r\n[HKEY_CURRENT_USER\\Software\\Acme Co]\r\n\"SomeData\"=\"SomeValue\"\r\n",
"StartAt" : 0
}

2)

{
"FileName" : "c:\\sample.reg",
"StartAt" : 0
}


Key see Key values
FileName is the name of the file on Guest side that will be imported to Host registry
".reg" extension is appended, if not present already

Returns

{
"StartAt" : 0,
"Total" : 104,
"UpTo" : 104
}

Client should continue to call this operation with StartAt set to UpTo from the previous call. When UpTo=Total then all data is transmitted.

Operation: Export registry key

snapinId=15004 opId=509

Parameters

Command has two forms:
1)

{
"Key" : 2147483649,
"StartAt" : 0,
"Subkey" : "Software\\Acme Co"
}

2)

{
"FileName" : "C:\\HKCU_Software_Microsoft_Windows.reg",
"Key" : 2147483649,
"StartAt" : 0,
"Subkey" : "Software\\Microsoft\\Windows" // Lots of data, give it time to finish
}


Key see Key values
FileName is the name of the file that will be created on Guest side
".reg" extension is appended, if not present already

Returns when in request FileName is omitted:

{
"Data" : "REGEDIT4\r\n\r\n[HKEY_CURRENT_USER\\Software\\Acme Co]\r\n\"SomeData\"=\"SomeValue\"\r\n\r\n",
"StartAt" : 0,
"Total" : 76,
"UpTo" : 76
}

when in request FileName is present:

{
"FileName" : "C:\\HKCU_Software_Microsoft_Windows.reg",
"StartAt" : 0,
"Total" : 875206,
"UpTo" : 4096
}

Client should continue to call this operation with StartAt set to UpTo from the previous call. When UpTo=Total then all data is retrieved.