Skip to main content

Discovery and permissions

Query​

ROCK.dll exports one function, ROCKAPI_QueryInterfaceV1 (rock::api::kQueryExportName):

Status ROCKAPI_QueryInterfaceV1(InterfaceId id, std::uint32_t exactMajor,
std::uint32_t minimumMinor, std::uint32_t minimumTableBytes,
const InterfaceDescriptorV1** outDescriptor);

On Ok, the descriptor gives interfaceId, major, minor, tableByteSize, requiredCoreMajor/requiredCoreMinor and table, valid for the process lifetime. Pass your header's kMajor, kMinor and sizeof(Api): a later ROCK may add slots at the end of a table and raise the minor, never reorder or change existing ones.

ResultMeaning
OkThe interface exists at that major with at least that minor and table size.
UnknownInterfaceNo such interface, including the retired ids 10 and 12.
UnsupportedMajorThe interface exists at another major. Mods built for provider API 1 get this from ROCK 1.0.
UnsupportedMinorROCK's minor is below minimumMinor.
TableTooSmallROCK's table is smaller than minimumTableBytes.
InvalidArgumentNull output, or a zero major or table size.

After UnknownInterface, UnsupportedMajor, UnsupportedMinor or TableTooSmall, ROCK logs the calling DLL once in ROCK.log and the game keeps running. Request exactly the major, minimum minor and table size your headers declare, and read optional additions from the descriptor's minor; never probe for versions with trial queries. When ROCK.dll is not loaded, or a loaded ROCK refuses your request, turn your ROCK features off, log why and keep running.

rock::api::Client (ROCK/Client.h) wraps this: connect queries Core and registers your owner, acquire queries an interface by its table type, checks the descriptor and binds it. It compiles into your plugin.

Owners​

Every consumer registers one owner with Core registerConsumer (or Client::connect). The mod name is the owner's identity: a second registration with the same name returns OwnerConflict, and at most 64 owners exist. Every call takes the owner token first. Leases, targets, callbacks, claims and displays belong to the owner that set them; unregisterConsumer (Client::close) releases all of them.

Permissions​

Discovery grants nothing. Bind each interface to your owner with the permission bits you need: bindInterface(owner, id, major, permissions) or Client::acquire(permissions, table). Bits are local to each interface:

BitGrants
Read 1Reads, copies and queries.
Write 2Requests, leases, targets and other changes.
Callbacks 4Callback registration (Core, Animation, Storage).

A call without its permission returns PermissionDenied. Binding again with more bits adds them; a binding that would drop bits, or bind another major, returns Busy. Every owner holds Core Read from registration. NativeInteraction needs Read | Write to register an extension.

A table is not readiness​

A bound table means the interface exists, not that ROCK can act now. Check Core getSnapshot (providerReady, menuBlocking, lifecycle flags) or each call's status: NotReady, WorldNotReady and GenerationMismatch are normal during loads, menus and power armor changes. Retry on a later frame.