Earlier quoted context omitted.
Dude worked at RAD, so I'm willing to bet he's got some experience. In your LPSTR example, that could've been to silence compiler warnings about doing pointer arithmetic. EDIT: From bio: The most significant project I’ve created to date has been The Granny Animation SDK, a complete animation pipeline system that I first shipped in 1999 and which, 15 years later, still is in active use at many top-tier game studios. "…
You don't ever need to cast from char * to char * . Period. In 16 bit land the "L" meant something but that hasn't meant anything since long before the API he is calling existed.
(LPSTR)((char*)pSessionProperties + pSessionProperties->LoggerNameOffset)
He's casting pSessionProperties to a char* so that he can do the arithmetic on it--otherwise, the compiler would assume "Oh, golly, I should increment the pSessionProperties pointer by LoggerNameOffset times sizeof(SessionProperties)".He has to make that conversion in order to do byte offsetting correctly. He then casts that back to what it wants (an LPSTR), to match the required argument type on the function.
It's completely reasonable code, so stop complaining about it as though it weren't.