Hi!
I'm very frustrated. I have to access the same data as DWORD values and at the same time as BYTE values. I did this (simplified):
1: DWORD dwBuffer[16];
2: PBYTE bBuffer = (BYTE *)dwBuffer;
3: dwBuffer[2]= dwFileSizeHi;
4: bBuffer[0] = (BYTE)0x80;
This doesn't work. I get an access violation at runtime at line 4.
If I change this to this:
1: BYTE bBuffer[64];
2: PDWORD dwBuffer = (DWORD *)bBuffer;
3: dwBuffer[2]= dwFileSizeHi;
4: bBuffer[0] = (BYTE)0x80;
then everything behaves as I want and I get correct values everywhere.
Why does the second version work and the first did not? Excuse me, if this is a newbie question.
Thank you in advance...
I'm very frustrated. I have to access the same data as DWORD values and at the same time as BYTE values. I did this (simplified):
1: DWORD dwBuffer[16];
2: PBYTE bBuffer = (BYTE *)dwBuffer;
3: dwBuffer[2]= dwFileSizeHi;
4: bBuffer[0] = (BYTE)0x80;
This doesn't work. I get an access violation at runtime at line 4.
If I change this to this:
1: BYTE bBuffer[64];
2: PDWORD dwBuffer = (DWORD *)bBuffer;
3: dwBuffer[2]= dwFileSizeHi;
4: bBuffer[0] = (BYTE)0x80;
then everything behaves as I want and I get correct values everywhere.
Why does the second version work and the first did not? Excuse me, if this is a newbie question.
Thank you in advance...