mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +02:00
Fixed broken object sending in ipcPrepareHeaderForDomain(), and added serviceSendObject().
This commit is contained in:
parent
f61e9237e6
commit
3dce07d78c
@ -652,7 +652,7 @@ static inline void ipcSendObjectId(IpcCommand* cmd, u32 object_id) {
|
|||||||
* @return Pointer to the raw embedded data structure in the request, ready to be filled out.
|
* @return Pointer to the raw embedded data structure in the request, ready to be filled out.
|
||||||
*/
|
*/
|
||||||
static inline void* ipcPrepareHeaderForDomain(IpcCommand* cmd, size_t sizeof_raw, u32 object_id) {
|
static inline void* ipcPrepareHeaderForDomain(IpcCommand* cmd, size_t sizeof_raw, u32 object_id) {
|
||||||
void* raw = ipcPrepareHeader(cmd, sizeof_raw + sizeof(DomainMessageHeader));
|
void* raw = ipcPrepareHeader(cmd, sizeof_raw + sizeof(DomainMessageHeader) + cmd->NumObjectIds*sizeof(u32));
|
||||||
DomainMessageHeader* hdr = (DomainMessageHeader*) raw;
|
DomainMessageHeader* hdr = (DomainMessageHeader*) raw;
|
||||||
u32 *object_ids = (u32*)(((uintptr_t) raw) + sizeof(DomainMessageHeader) + sizeof_raw);
|
u32 *object_ids = (u32*)(((uintptr_t) raw) + sizeof(DomainMessageHeader) + sizeof_raw);
|
||||||
|
|
||||||
|
@ -128,6 +128,17 @@ static inline void serviceCreateSubservice(Service* s, Service* parent, IpcParse
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sends a service object with the specified cmd. This only supports domains.
|
||||||
|
* @param[in] s Service object to send.
|
||||||
|
* @param[in] cmd IPC command structure.
|
||||||
|
*/
|
||||||
|
static inline void serviceSendObject(Service* s, IpcCommand* cmd) {
|
||||||
|
if (serviceIsDomain(s) || serviceIsDomainSubservice(s)) {
|
||||||
|
ipcSendObjectId(cmd, s->object_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Converts a regular service to a domain.
|
* @brief Converts a regular service to a domain.
|
||||||
* @param[in] s Service object.
|
* @param[in] s Service object.
|
||||||
|
Loading…
Reference in New Issue
Block a user