why i get a screensnap with OpenGL is black?

glReadBuffer(GL_FRONT);
glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
glPixelStorei(GL_PACK_ALIGNMENT,4);
glPixelStorei(GL_PACK_ROW_LENGTH,0);
glPixelStorei(GL_PACK_SKIP_ROWS,0);
glPixelStorei(GL_PACK_SKIP_PIXELS,0);

int width = 1280;
int height = 1024;
int bytewidth = (width*4 +3 ) &~3;

char* raw_data = (char*)malloc( bytewidth* height);

glReadPixels(0,0,width,height,GL_BGRA_EXT,GL_UNSIGNED_INT,raw_data);

glPopClientAttrib();

wxImage image (width,height,raw_data );
image.SaveFile(“C:\ est.bmp”,wxBITMAP_TYPE_BMP);

this code from a mac sample screenshot,and it works ok under mac.
But why can’t the windows work?