#define _RGB16BIT(r,g,b) ((r>>3)<<10) | ((g>>3)<<5) | (b>>3)
But, you should replace the pointer as such:
typedef unsigned short USHORT
USHORT *bitmap_buffer = NULL;
bitmap_buffer = (*USHORT)ddsd.lpSurface;
bitmap_buffer[x+ddsd.lpPitch*y] = _RGB16BIT(255,255,255);
I don't remember offhand if you have to divide lpPitch by two beforehand. Try both ways.
BTW - RGB(0,0,255) should make a bright blue (unless you mean it's adding some green for a teal color).
Remember - when writing 16 bit colors, you should use a 16-bit pointer (USHORT), not a byte pointer (CHAR).
Jim