0
我聲明瞭一個結構,其中一個結構成員是一個存儲IPC緩衝區地址的指針。 ipc_buffer是本地的一種方法,當我將同一緩衝區的地址傳遞給另一個函數並通過IPCWrite()觀察IPC_recevie方面的數據損壞時發送? 任何人都可以有指針爲什麼數據被損壞?將本地ipc緩衝區的地址存儲在下面的結構成員中,並傳入ipcwrite導致數據損壞
typedef struct ev_entry_s
{
event_t ev_id;
uint8_t *ipc_local_async_buff;
uint32_t ev_data_size;
uint8_t ev_data[0];
}ev_entry_t;
fun_1()
{
uint8_t ipc_buffer[IPC_MAX_SEND_LEN];
fun_2(&ipc_buffer); /*sending as a parameter */
}
fun_2(uin8_t *catch_pointer)
{
ev_entry_t event_p;
//Storing ipc_buffer addres in ipc_local_async_buff
event_p.ipc_local_async_buff = catch_pointer;
fun_3(&event_p);
}
fun_3(ev_entry *event_p)
{
/*sending the address of ipc_buffer over IPCWrite*/
}
非常感謝很多目前我正在嘗試相同。 –