http://bugs.winehq.org/show_bug.cgi?id=14122
--- Comment #5 from Juan Lang juan_lang@yahoo.com 2008-06-26 11:11:17 --- It looks as though you're using a slightly not up-to-date version of Wine, as the current version checks that ctx is not NULL before making that call:
if (ctx) ExtEscape(ctx->hdc, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code, 0, NULL );
See: http://source.winehq.org/source/dlls/winex11.drv/opengl.c#L2145
Try updating to latest git and try again.