Hello,
I have two questions.They both are concerning a void in C++,which I am trying to translate in C#.
C++ code
void Func_X_2(LPBYTE stream, DWORD key, BYTE keyByte)
{
stream[0] ^= (stream[0] + LOBYTE(LOWORD(key)) + keyByte);
stream[1] ^= (stream[1] + HIBYTE(LOWORD(key)) + keyByte);
stream[2] ^= (stream[2] + LOBYTE(HIWORD(key)) + keyByte);
stream[3] ^= (stream[3] + HIBYTE(HIWORD(key)) + keyByte);
stream[4] ^= (stream[4] + LOBYTE(LOWORD(key)) + keyByte);
stream[5] ^= (stream[5] + HIBYTE(LOWORD(key)) + keyByte);
stream[6] ^= (stream[6] + LOBYTE(HIWORD(key)) + keyByte);
stream[7] ^= (stream[7] + HIBYTE(HIWORD(key)) + keyByte);
}
First question:
DWORD is UInt32,BYTE is byte,but what is LPBYTE? How to use it as an array?
Second question:
How to use LOBYTE,HIBYTE,LOWORD,HIWORD in C#?
EDIT
This is how the function is being called: C++ code
Func_X_2((LPBYTE)keyArray, dwArgs[14], keyByte);
keyArray is a DWORD(UInt32),dwArgs is an array of dword.KeyByte is a byte.
Thanks in advance.