struct SENDMSG {
char* lpSendData;
unsigned long ulSendDataSize;
};
SENDMSG smsg;
ZeroMemory( &smsg, sizeof( SENDMSG ) );
lpSendData = new char[MAX_BUFFER_OUT_SIZE];
std::string buffer( "anything" );
lpSendData = (char*) buffer.c_str() // or buffer.data() – does the same.
ulSendDataSize = buffer.size();
function( lpSendData, ulSendDataSize ); // function works fine standalone
"Access violation reading location 0xcccccccc." – Makes me think uninitialized variables somewhere.
Also:
"mov eax,dword ptr [ecx] ; read 4 bytes" – pointed to strlen.asm
Prior to passing
Post passing to the msg_handler_ which just takes void* lpvMsg as a parameter.