...
This commit is contained in:
parent
1af73daa68
commit
1efac80154
1 changed files with 14 additions and 6 deletions
|
@ -262,7 +262,9 @@ __inline uint8_t mmnif_read_rx_queue(uint32_t dest_ip)
|
|||
while(!ReadProcessMemory(hProc,(char*)mpb_start_address + ( dest_ip -1 ) * mpb_size,&hdr,sizeof(hdr),NULL));
|
||||
return hdr.queued;
|
||||
#else
|
||||
return *(uint8_t*)(mpb_start_address + (dest_ip -1 ) * mpb_size );
|
||||
mm_rx_buffer_t hdr;
|
||||
memcpy(&hdr,(char*)mpb_start_address + ( dest_ip -1 ) * mpb_size,&hdr,sizeof(hdr));
|
||||
return hdr.queued;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -279,7 +281,9 @@ __inline uint8_t mmnif_read_rx_pos(uint32_t dest_ip)
|
|||
while(!ReadProcessMemory(hProc,(char*)mpb_start_address + ( dest_ip -1 ) * mpb_size,&hdr,sizeof(hdr),NULL));
|
||||
return hdr.pos;
|
||||
#else
|
||||
return *(uint8_t*)(mpb_start_address + (dest_ip -1 ) * mpb_size +1);
|
||||
mm_rx_buffer_t hdr;
|
||||
memcpy(&hdr,(char*)mpb_start_address + ( dest_ip -1 ) * mpb_size,&hdr,sizeof(hdr));
|
||||
return hdr.pos;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -296,7 +300,9 @@ __inline uint8_t mmnif_read_rx_inv_intr(uint32_t dest_ip)
|
|||
while(!ReadProcessMemory(hProc,(char*)mpb_start_address + ( dest_ip -1 ) * mpb_size,&hdr,sizeof(hdr),NULL));
|
||||
return hdr.iv_intr;
|
||||
#else
|
||||
return *(uint8_t*)(mpb_start_address + (dest_ip -1 ) * mpb_size +2);
|
||||
mm_rx_buffer_t hdr;
|
||||
memcpy(&hdr,(char*)mpb_start_address + ( dest_ip -1 ) * mpb_size,&hdr,sizeof(hdr));
|
||||
return hdr.iv_intr;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -313,7 +319,9 @@ __inline uint8_t mmnif_read_rx_pending(uint32_t dest_ip)
|
|||
while(!ReadProcessMemory(hProc,(char*)mpb_start_address + ( dest_ip -1 ) * mpb_size,&hdr,sizeof(hdr),NULL));
|
||||
return hdr.pending;
|
||||
#else
|
||||
return *(uint8_t*)(mpb_start_address + (dest_ip -1 ) * mpb_size +2);
|
||||
mm_rx_buffer_t hdr;
|
||||
memcpy(&hdr,(char*)mpb_start_address + ( dest_ip -1 ) * mpb_size,&hdr,sizeof(hdr));
|
||||
return hdr.pending;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -332,7 +340,7 @@ __inline int mmnif_write_rx_buff(uint32_t dest_ip, uint32_t pos,void* data)
|
|||
return nr_of_bytes_written;
|
||||
#else
|
||||
uint16_t length = *((uint16_t*)data);
|
||||
memcpy(mpb_start_address + (dest_ip -1 ) * mpb_size +2,data,length+2);
|
||||
memcpy((char*)mpb_start_address +(dest_ip -1 ) * mpb_size + sizeof(mm_rx_buffer_t)+ pos * MMNIF_RX_BUFFERLEN,data,length+2);
|
||||
return 1;
|
||||
#endif
|
||||
};
|
||||
|
@ -389,7 +397,7 @@ __inline int mmnif_write_rx_pending(uint32_t dest_ip,uint8_t pending)
|
|||
return nr_of_bytes_written;
|
||||
#else
|
||||
|
||||
memcpy((char*)mpb_start_address + ( dest_ip -1 ) * mpb_size, &pending,1);
|
||||
memcpy((char*)mpb_start_address + ( dest_ip -1 ) * mpb_size + 2 , &pending,1);
|
||||
|
||||
return 1;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue