This API is defined in the header file sysroot-*-kos/include/coresrv/blob/blob_api.h from the KasperskyOS SDK.
The API is designed to gain access to named blobs (Binary Large Objects). You can gain access to the following blobs:
Blob name: romsf.0.
Blob name: romsf.1.
Information about API functions is provided in the table below.
Getting the handle of a blob
To get the handle of a blob based on the name of this blob, call the KnBlobGet() function.
The BLOB handle can be transferred to another process via IPC.
The handle of the blob containing the ROMFS image is used not only by the blob_api.h API functions but is also used as input data for the KosRomFsMountByHandle() function from the romfs.h API.
Mapping a blob to a virtual memory region
To reserve a virtual memory region and map the BLOB to it, call the KnBlobMap() function.
The same blob can be mapped simultaneously to multiple virtual memory regions in one or more processes.
To free a virtual memory region that was reserved by calling the KnBlobMap() function, you must close the handle of this region.
Getting the size of a blob
To get the size of a blob, call the KnBlobGetSize() function. The size of a blob is also passed through the size output parameter of the KnBlobGet() function.
Deleting a blob
To initiate the deletion of a blob, call the KnBlobRemove() function. The blob will be deleted only after all of the following conditions are fulfilled:
When using the romfs.h API, you should keep in mind that when a ROMFS image is mounted, a call of the KosRomFsMount() or KosRomFsMountByHandle() function will reserve the virtual memory region and map a blob to it. When you unmount a ROMFS image, a call of the KosRomFsUnmount() or KosRomFsUnmountAll() function frees the virtual memory region to which the blob is mapped.
When using the romfs.h API, you should keep in mind that the KosRomFsMount() function closes the blob handle while the KosRomFsMountByHandle() function does not close it. Therefore, after calling the KosRomFsMountByHandle() function, you must manually close the handle.
Blob deletion may be prohibited by the KasperskyOS kernel. In this case, the KnBlobRemove() function returns rcInvalidOperation.
Information about API functions
Blob_api.h functions
Function |
Information about the function |
|---|---|
|
Purpose Gets the handle of a blob based on the name of this blob. Parameters
Returned values If successful, the function returns |
|
Purpose Initiates deletion of a blob. Parameters
Returned values If successful, the function returns |
|
Purpose Reserves a virtual memory region and maps the BLOB to it. Parameters
Returned values If successful, the function returns Additional information In the
In the
|
|
Purpose Gets the size of the BLOB. Parameters
Returned values If successful, the function returns |