converting LPBYTE to LPSTR (whats happening and is it efficient!?)
Posted on 2005-03-17
I'm writing a wildcard ISAPI extension.
I want to point to the EXTEnSION_CONTROL_BLOCK data structure element lpbData. To make it easy for me, as a C++ idiot, I am hoping to store it in a local LPSTR variable (this will mean I can use 'inbuilt' functions I am already comfortable with and local functions that I already have.
Basically this means I am using the line
pDataBody = (LPSTR) pecb->lpbData; // pecb->lpbData is a LPBYTE.
I realised as I was doing it that I don't know what this is really doing. As pecb->lpbData can potentially be very large I was hoping someone could and would tell me whether this is a reasonable (not necessarily perfect!) and efficient thing to do. And if possible what is going on in the background. i.e. As they are both pointer types is the same memory just being interpreted in a different way, or is the memory being copied to different locations for the 2 different types?
I hope this makes some sense ...