When I saw this those lines :
BYTE MessageToProcess[MAX_MESSAGE_LENGTH];
TcpIpPacketHdr *pHdr = (TcpIpPacketHdr*)&MessageToProcess;
I said to myself the second line must be like this :
TcpIpPacketHdr *pHdr = (TcpIpPacketHdr*)MessageToProcess;
But when I checked in debug mode "pHdr" points to the same thing as "MessageToProcess" in both example, whereas, there is a "&" before MessageToProcess in the first code, so normally pHdr should contain the address of the MessageToProcess and not the address of the byte it is pointing to, for instance, the first element in the messageToProcess.
So the question What's happening ? we are dealing with pointers to bytes and not functions so adding & must change the equation.
Later in the code we are using pHdr like this :
pHdr->size+2
But initially, in the first code, it does contain the address of the pointer holding the address to the first byte of the array.