Commit 99acd7df authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Use the DUMMYUNIONNAME macros so that the headers can be used in

Winelib.
parent e4d09327
......@@ -429,7 +429,7 @@ HRESULT WINAPI MESA_IDirect3DDevice2Impl_EndScene(LPDIRECT3DDEVICE2 iface) {
I am currently working on a set of patches for Mesa to have OSMesa support
16 bpp surfaces => we will able to render directly onto the surface, no
need to do a bpp conversion */
dest = (unsigned short *) sdesc.y.lpSurface;
dest = (unsigned short *) sdesc.u2.lpSurface;
src = ((unsigned char *) odev->buffer) + 4 * (sdesc.dwWidth * (sdesc.dwHeight - 1));
for (y = 0; y < sdesc.dwHeight; y++) {
unsigned char *lsrc = src;
......@@ -448,7 +448,7 @@ HRESULT WINAPI MESA_IDirect3DDevice2Impl_EndScene(LPDIRECT3DDEVICE2 iface) {
}
/* Unlock the surface */
IDirectDrawSurface3_Unlock(surf,sdesc.y.lpSurface);
IDirectDrawSurface3_Unlock(surf,sdesc.u2.lpSurface);
#else
/* No need to do anything here... */
#endif
......@@ -698,45 +698,45 @@ static HRESULT WINAPI MESA_IDirect3DDevice2Impl_SetTransform(
case D3DVT_VERTEX: { \
D3DVERTEX *vx = ((D3DVERTEX *) lpvertex) + INDEX; \
\
glNormal3f(vx->nx.nx, vx->ny.ny, vx->nz.nz); \
glVertex3f(vx->x.x, vx->y.y, vx->z.z); \
TRACE(" V: %f %f %f\n", vx->x.x, vx->y.y, vx->z.z); \
glNormal3f(vx->u4.nx, vx->u5.ny, vx->u6.nz); \
glVertex3f(vx->u1.x, vx->u2.y, vx->u3.z); \
TRACE(" V: %f %f %f\n", vx->u1.x, vx->u2.y, vx->u3.z); \
} break; \
\
case D3DVT_LVERTEX: { \
D3DLVERTEX *vx = ((D3DLVERTEX *) lpvertex) + INDEX; \
DWORD col = vx->c.color; \
DWORD col = vx->u4.color; \
\
glColor3f(((col >> 16) & 0xFF) / 255.0, \
((col >> 8) & 0xFF) / 255.0, \
((col >> 0) & 0xFF) / 255.0); \
glVertex3f(vx->x.x, vx->y.y, vx->z.z); \
glVertex3f(vx->u1.x, vx->u2.y, vx->u3.z); \
TRACE(" LV: %f %f %f (%02lx %02lx %02lx)\n", \
vx->x.x, vx->y.y, vx->z.z, \
vx->u1.x, vx->u2.y, vx->u3.z, \
((col >> 16) & 0xFF), ((col >> 8) & 0xFF), ((col >> 0) & 0xFF));\
} break; \
\
case D3DVT_TLVERTEX: { \
D3DTLVERTEX *vx = ((D3DTLVERTEX *) lpvertex) + INDEX; \
DWORD col = vx->c.color; \
DWORD col = vx->u5.color; \
\
glColor3f(((col >> 16) & 0xFF) / 255.0, \
((col >> 8) & 0xFF) / 255.0, \
((col >> 0) & 0xFF) / 255.0); \
glTexCoord2f(vx->u.tu, vx->v.tv); \
if (vx->r.rhw < 0.01) \
glVertex3f(vx->x.sx, \
vx->y.sy, \
vx->z.sz); \
glTexCoord2f(vx->u7.tu, vx->u8.tv); \
if (vx->u4.rhw < 0.01) \
glVertex3f(vx->u1.sx, \
vx->u2.sy, \
vx->u3.sz); \
else \
glVertex4f(vx->x.sx / vx->r.rhw, \
vx->y.sy / vx->r.rhw, \
vx->z.sz / vx->r.rhw, \
1.0 / vx->r.rhw); \
glVertex4f(vx->u1.sx / vx->u4.rhw, \
vx->u2.sy / vx->u4.rhw, \
vx->u3.sz / vx->u4.rhw, \
1.0 / vx->u4.rhw); \
TRACE(" TLV: %f %f %f (%02lx %02lx %02lx) (%f %f) (%f)\n", \
vx->x.sx, vx->y.sy, vx->z.sz, \
vx->u1.sx, vx->u2.sy, vx->u3.sz, \
((col >> 16) & 0xFF), ((col >> 8) & 0xFF), ((col >> 0) & 0xFF),\
vx->u.tu, vx->v.tv, vx->r.rhw); \
vx->u7.tu, vx->u8.tv, vx->u4.rhw); \
} break; \
\
default: \
......@@ -985,7 +985,7 @@ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_BeginScene(LPDIRECT3DDEVICE iface
FIXME("(%p)->(): stub\n", This);
/* We get the pointer to the surface (should be done on flip) */
/* odev->zb->pbuf = This->surface->s.surface_desc.y.lpSurface; */
/* odev->zb->pbuf = This->surface->s.surface_desc.u2.lpSurface; */
return DD_OK;
}
......@@ -1018,7 +1018,7 @@ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_EndScene(LPDIRECT3DDEVICE iface)
I am currently working on a set of patches for Mesa to have OSMesa support
16 bpp surfaces => we will able to render directly onto the surface, no
need to do a bpp conversion */
dest = (unsigned short *) sdesc.y.lpSurface;
dest = (unsigned short *) sdesc.u2.lpSurface;
src = ((unsigned char *) odev->buffer) + 4 * (sdesc.dwWidth * (sdesc.dwHeight - 1));
for (y = 0; y < sdesc.dwHeight; y++) {
unsigned char *lsrc = src;
......@@ -1038,7 +1038,7 @@ static HRESULT WINAPI MESA_IDirect3DDeviceImpl_EndScene(LPDIRECT3DDEVICE iface)
}
/* Unlock the surface */
IDirectDrawSurface3_Unlock(surf,sdesc.y.lpSurface);
IDirectDrawSurface3_Unlock(surf,sdesc.u2.lpSurface);
#else
/* No need to do anything here... */
#endif
......
......@@ -106,25 +106,25 @@ void _dump_executedata(LPD3DEXECUTEDATA lpData) {
#define DO_TLVERTEX(index) \
{ \
D3DTLVERTEX *vx = &(tl_vx[index]); \
DWORD col = vx->c.color; \
DWORD col = vx->u5.color; \
\
glColor3f(((col >> 16) & 0xFF) / 255.0, \
((col >> 8) & 0xFF) / 255.0, \
((col >> 0) & 0xFF) / 255.0); \
glTexCoord2f(vx->u.tu, vx->v.tv); \
if (vx->r.rhw < 0.01) \
glVertex3f(vx->x.sx, \
vx->y.sy, \
vx->z.sz); \
glTexCoord2f(vx->u7.tu, vx->u8.tv); \
if (vx->u4.rhw < 0.01) \
glVertex3f(vx->u1.sx, \
vx->u2.sy, \
vx->u3.sz); \
else \
glVertex4f(vx->x.sx / vx->r.rhw, \
vx->y.sy / vx->r.rhw, \
vx->z.sz / vx->r.rhw, \
1.0 / vx->r.rhw); \
glVertex4f(vx->u1.sx / vx->u4.rhw, \
vx->u2.sy / vx->u4.rhw, \
vx->u3.sz / vx->u4.rhw, \
1.0 / vx->u4.rhw); \
TRACE(" TLV: %f %f %f (%02lx %02lx %02lx) (%f %f) (%f)\n", \
vx->x.sx, vx->y.sy, vx->z.sz, \
vx->u1.sx, vx->u2.sy, vx->u3.sz, \
((col >> 16) & 0xFF), ((col >> 8) & 0xFF), ((col >> 0) & 0xFF), \
vx->u.tu, vx->v.tv, vx->r.rhw); \
vx->u7.tu, vx->u8.tv, vx->u4.rhw); \
}
#define TRIANGLE_LOOP(macro) \
......@@ -134,7 +134,7 @@ void _dump_executedata(LPD3DEXECUTEDATA lpData) {
LPD3DTRIANGLE ci = (LPD3DTRIANGLE) instr; \
\
TRACE(" v1: %d v2: %d v3: %d\n", \
ci->v1.v1, ci->v2.v2, ci->v3.v3); \
ci->u1.v1, ci->u2.v2, ci->u3.v3); \
TRACE(" Flags : "); \
if (TRACE_ON(ddraw)) { \
/* Wireframe */ \
......@@ -158,9 +158,9 @@ void _dump_executedata(LPD3DEXECUTEDATA lpData) {
} \
\
/* Draw the triangle */ \
macro(ci->v1.v1); \
macro(ci->v2.v2); \
macro(ci->v3.v3); \
macro(ci->u1.v1); \
macro(ci->u2.v2); \
macro(ci->u3.v3); \
\
instr += size; \
} \
......@@ -367,24 +367,24 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
LPD3DSTATE ci = (LPD3DSTATE) instr;
/* Handle the state transform */
switch (ci->t.dtstTransformStateType) {
switch (ci->u1.dtstTransformStateType) {
case D3DTRANSFORMSTATE_WORLD: {
TRACE(" WORLD (%p)\n", (D3DMATRIX*) ci->v.dwArg[0]);
odev->world_mat = (D3DMATRIX*) ci->v.dwArg[0];
TRACE(" WORLD (%p)\n", (D3DMATRIX*) ci->u2.dwArg[0]);
odev->world_mat = (D3DMATRIX*) ci->u2.dwArg[0];
} break;
case D3DTRANSFORMSTATE_VIEW: {
TRACE(" VIEW (%p)\n", (D3DMATRIX*) ci->v.dwArg[0]);
odev->view_mat = (D3DMATRIX*) ci->v.dwArg[0];
TRACE(" VIEW (%p)\n", (D3DMATRIX*) ci->u2.dwArg[0]);
odev->view_mat = (D3DMATRIX*) ci->u2.dwArg[0];
} break;
case D3DTRANSFORMSTATE_PROJECTION: {
TRACE(" PROJECTION (%p)\n", (D3DMATRIX*) ci->v.dwArg[0]);
odev->proj_mat = (D3DMATRIX*) ci->v.dwArg[0];
TRACE(" PROJECTION (%p)\n", (D3DMATRIX*) ci->u2.dwArg[0]);
odev->proj_mat = (D3DMATRIX*) ci->u2.dwArg[0];
} break;
default:
ERR(" Unhandled state transformation !! (%d)\n", (int) ci->t.dtstTransformStateType);
ERR(" Unhandled state transformation !! (%d)\n", (int) ci->u1.dtstTransformStateType);
break;
}
......@@ -401,9 +401,9 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
LPD3DSTATE ci = (LPD3DSTATE) instr;
/* Handle the state transform */
switch (ci->t.dlstLightStateType) {
switch (ci->u1.dlstLightStateType) {
case D3DLIGHTSTATE_MATERIAL: {
IDirect3DMaterial2Impl* mat = (IDirect3DMaterial2Impl*) ci->v.dwArg[0];
IDirect3DMaterial2Impl* mat = (IDirect3DMaterial2Impl*) ci->u2.dwArg[0];
TRACE(" MATERIAL\n");
if (mat != NULL) {
......@@ -415,7 +415,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
case D3DLIGHTSTATE_AMBIENT: {
float light[4];
DWORD dwLightState = ci->v.dwArg[0];
DWORD dwLightState = ci->u2.dwArg[0];
TRACE(" AMBIENT\n");
light[0] = ((dwLightState >> 16) & 0xFF) / 255.0;
......@@ -452,7 +452,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
} break ;
default:
ERR(" Unhandled light state !! (%d)\n", (int) ci->t.dlstLightStateType);
ERR(" Unhandled light state !! (%d)\n", (int) ci->u1.dlstLightStateType);
break;
}
instr += size;
......@@ -467,7 +467,7 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
LPD3DSTATE ci = (LPD3DSTATE) instr;
/* Handle the state transform */
set_render_state(ci->t.drstRenderStateType, ci->v.dwArg[0], &(odev->rs));
set_render_state(ci->u1.drstRenderStateType, ci->u2.dwArg[0], &(odev->rs));
instr += size;
}
......@@ -539,18 +539,18 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
for (nb = 0; nb < ci->dwCount; nb++) {
/* For the moment, no normal transformation... */
dst->nx = src->nx.nx;
dst->ny = src->ny.ny;
dst->nz = src->nz.nz;
dst->nx = src->u4.nx;
dst->ny = src->u5.ny;
dst->nz = src->u6.nz;
dst->u = src->u.tu;
dst->v = src->v.tv;
dst->u = src->u7.tu;
dst->v = src->u8.tv;
/* Now, the matrix multiplication */
dst->x = (src->x.x * mat->_11) + (src->y.y * mat->_21) + (src->z.z * mat->_31) + (1.0 * mat->_41);
dst->y = (src->x.x * mat->_12) + (src->y.y * mat->_22) + (src->z.z * mat->_32) + (1.0 * mat->_42);
dst->z = (src->x.x * mat->_13) + (src->y.y * mat->_23) + (src->z.z * mat->_33) + (1.0 * mat->_43);
dst->w = (src->x.x * mat->_14) + (src->y.y * mat->_24) + (src->z.z * mat->_34) + (1.0 * mat->_44);
dst->x = (src->u1.x * mat->_11) + (src->u2.y * mat->_21) + (src->u3.z * mat->_31) + (1.0 * mat->_41);
dst->y = (src->u1.x * mat->_12) + (src->u2.y * mat->_22) + (src->u3.z * mat->_32) + (1.0 * mat->_42);
dst->z = (src->u1.x * mat->_13) + (src->u2.y * mat->_23) + (src->u3.z * mat->_33) + (1.0 * mat->_43);
dst->w = (src->u1.x * mat->_14) + (src->u2.y * mat->_24) + (src->u3.z * mat->_34) + (1.0 * mat->_44);
src++;
dst++;
......@@ -567,16 +567,16 @@ static void execute(LPDIRECT3DEXECUTEBUFFER lpBuff,
ilpBuff->vertex_type = D3DVT_LVERTEX;
for (nb = 0; nb < ci->dwCount; nb++) {
dst->c = src->c.color;
dst->sc = src->s.specular;
dst->u = src->u.tu;
dst->v = src->v.tv;
dst->c = src->u4.color;
dst->sc = src->u5.specular;
dst->u = src->u6.tu;
dst->v = src->u7.tv;
/* Now, the matrix multiplication */
dst->x = (src->x.x * mat->_11) + (src->y.y * mat->_21) + (src->z.z * mat->_31) + (1.0 * mat->_41);
dst->y = (src->x.x * mat->_12) + (src->y.y * mat->_22) + (src->z.z * mat->_32) + (1.0 * mat->_42);
dst->z = (src->x.x * mat->_13) + (src->y.y * mat->_23) + (src->z.z * mat->_33) + (1.0 * mat->_43);
dst->w = (src->x.x * mat->_14) + (src->y.y * mat->_24) + (src->z.z * mat->_34) + (1.0 * mat->_44);
dst->x = (src->u1.x * mat->_11) + (src->u2.y * mat->_21) + (src->u3.z * mat->_31) + (1.0 * mat->_41);
dst->y = (src->u1.x * mat->_12) + (src->u2.y * mat->_22) + (src->u3.z * mat->_32) + (1.0 * mat->_42);
dst->z = (src->u1.x * mat->_13) + (src->u2.y * mat->_23) + (src->u3.z * mat->_33) + (1.0 * mat->_43);
dst->w = (src->u1.x * mat->_14) + (src->u2.y * mat->_24) + (src->u3.z * mat->_34) + (1.0 * mat->_44);
src++;
dst++;
......
......@@ -33,25 +33,25 @@ static void activate(IDirect3DMaterial2Impl* This) {
This->device.active_device1->set_context(This->device.active_device1);
/* Set the current Material */
_dump_colorvalue("Diffuse", This->mat.a.diffuse);
_dump_colorvalue("Diffuse", This->mat.u.diffuse);
glMaterialfv(GL_FRONT,
GL_DIFFUSE,
(float *) &(This->mat.a.diffuse));
_dump_colorvalue("Ambient", This->mat.b.ambient);
(float *) &(This->mat.u.diffuse));
_dump_colorvalue("Ambient", This->mat.u1.ambient);
glMaterialfv(GL_FRONT,
GL_AMBIENT,
(float *) &(This->mat.b.ambient));
_dump_colorvalue("Specular", This->mat.c.specular);
(float *) &(This->mat.u1.ambient));
_dump_colorvalue("Specular", This->mat.u2.specular);
glMaterialfv(GL_FRONT,
GL_SPECULAR,
(float *) &(This->mat.c.specular));
_dump_colorvalue("Emissive", This->mat.d.emissive);
(float *) &(This->mat.u2.specular));
_dump_colorvalue("Emissive", This->mat.u3.emissive);
glMaterialfv(GL_FRONT,
GL_EMISSION,
(float *) &(This->mat.d.emissive));
(float *) &(This->mat.u3.emissive));
TRACE("Size : %ld\n", This->mat.dwSize);
TRACE("Power : %f\n", This->mat.e.power);
TRACE("Power : %f\n", This->mat.u4.power);
TRACE("Texture handle : %08lx\n", (DWORD)This->mat.hTexture);
LEAVE_GL();
......
......@@ -647,20 +647,20 @@ void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, LPDPLCONNECTION src )
CopyMemory( dest->lpSessionDesc, src->lpSessionDesc, sizeof( DPSESSIONDESC2 ) );
/* Session names may or may not exist */
if( src->lpSessionDesc->sess.lpszSessionNameA )
if( src->lpSessionDesc->u1.lpszSessionNameA )
{
strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->sess.lpszSessionNameA );
dest->lpSessionDesc->sess.lpszSessionNameA = (LPSTR)lpStartOfFreeSpace;
strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->u1.lpszSessionNameA );
dest->lpSessionDesc->u1.lpszSessionNameA = (LPSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace +=
strlen( (LPSTR)dest->lpSessionDesc->sess.lpszSessionNameA ) + 1;
strlen( (LPSTR)dest->lpSessionDesc->u1.lpszSessionNameA ) + 1;
}
if( src->lpSessionDesc->pass.lpszPasswordA )
if( src->lpSessionDesc->u2.lpszPasswordA )
{
strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->pass.lpszPasswordA );
dest->lpSessionDesc->pass.lpszPasswordA = (LPSTR)lpStartOfFreeSpace;
strcpy( (LPSTR)lpStartOfFreeSpace, src->lpSessionDesc->u2.lpszPasswordA );
dest->lpSessionDesc->u2.lpszPasswordA = (LPSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace +=
strlen( (LPSTR)dest->lpSessionDesc->pass.lpszPasswordA ) + 1;
strlen( (LPSTR)dest->lpSessionDesc->u2.lpszPasswordA ) + 1;
}
}
......@@ -671,20 +671,20 @@ void DPLAYX_CopyConnStructA( LPDPLCONNECTION dest, LPDPLCONNECTION src )
lpStartOfFreeSpace += sizeof( DPNAME );
CopyMemory( dest->lpPlayerName, src->lpPlayerName, sizeof( DPNAME ) );
if( src->lpPlayerName->psn.lpszShortNameA )
if( src->lpPlayerName->u1.lpszShortNameA )
{
strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->psn.lpszShortNameA );
dest->lpPlayerName->psn.lpszShortNameA = (LPSTR)lpStartOfFreeSpace;
strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->u1.lpszShortNameA );
dest->lpPlayerName->u1.lpszShortNameA = (LPSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace +=
strlen( (LPSTR)dest->lpPlayerName->psn.lpszShortNameA ) + 1;
strlen( (LPSTR)dest->lpPlayerName->u1.lpszShortNameA ) + 1;
}
if( src->lpPlayerName->pln.lpszLongNameA )
if( src->lpPlayerName->u2.lpszLongNameA )
{
strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->pln.lpszLongNameA );
dest->lpPlayerName->pln.lpszLongNameA = (LPSTR)lpStartOfFreeSpace;
strcpy( (LPSTR)lpStartOfFreeSpace, src->lpPlayerName->u2.lpszLongNameA );
dest->lpPlayerName->u2.lpszLongNameA = (LPSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace +=
strlen( (LPSTR)dest->lpPlayerName->pln.lpszLongName ) + 1 ;
strlen( (LPSTR)dest->lpPlayerName->u2.lpszLongName ) + 1 ;
}
}
......@@ -769,20 +769,20 @@ void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, LPDPLCONNECTION src )
CopyMemory( dest->lpSessionDesc, src->lpSessionDesc, sizeof( DPSESSIONDESC2 ) );
/* Session names may or may not exist */
if( src->lpSessionDesc->sess.lpszSessionName )
if( src->lpSessionDesc->u1.lpszSessionName )
{
strcpyW( (LPWSTR)lpStartOfFreeSpace, dest->lpSessionDesc->sess.lpszSessionName );
src->lpSessionDesc->sess.lpszSessionName = (LPWSTR)lpStartOfFreeSpace;
strcpyW( (LPWSTR)lpStartOfFreeSpace, dest->lpSessionDesc->u1.lpszSessionName );
src->lpSessionDesc->u1.lpszSessionName = (LPWSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof(WCHAR) *
( strlenW( (LPWSTR)dest->lpSessionDesc->sess.lpszSessionName ) + 1 );
( strlenW( (LPWSTR)dest->lpSessionDesc->u1.lpszSessionName ) + 1 );
}
if( src->lpSessionDesc->pass.lpszPassword )
if( src->lpSessionDesc->u2.lpszPassword )
{
strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpSessionDesc->pass.lpszPassword );
dest->lpSessionDesc->pass.lpszPassword = (LPWSTR)lpStartOfFreeSpace;
strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpSessionDesc->u2.lpszPassword );
dest->lpSessionDesc->u2.lpszPassword = (LPWSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof(WCHAR) *
( strlenW( (LPWSTR)dest->lpSessionDesc->pass.lpszPassword ) + 1 );
( strlenW( (LPWSTR)dest->lpSessionDesc->u2.lpszPassword ) + 1 );
}
}
......@@ -793,20 +793,20 @@ void DPLAYX_CopyConnStructW( LPDPLCONNECTION dest, LPDPLCONNECTION src )
lpStartOfFreeSpace += sizeof( DPNAME );
CopyMemory( dest->lpPlayerName, src->lpPlayerName, sizeof( DPNAME ) );
if( src->lpPlayerName->psn.lpszShortName )
if( src->lpPlayerName->u1.lpszShortName )
{
strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->psn.lpszShortName );
dest->lpPlayerName->psn.lpszShortName = (LPWSTR)lpStartOfFreeSpace;
strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->u1.lpszShortName );
dest->lpPlayerName->u1.lpszShortName = (LPWSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof(WCHAR) *
( strlenW( (LPWSTR)dest->lpPlayerName->psn.lpszShortName ) + 1 );
( strlenW( (LPWSTR)dest->lpPlayerName->u1.lpszShortName ) + 1 );
}
if( src->lpPlayerName->pln.lpszLongName )
if( src->lpPlayerName->u2.lpszLongName )
{
strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->pln.lpszLongName );
dest->lpPlayerName->pln.lpszLongName = (LPWSTR)lpStartOfFreeSpace;
strcpyW( (LPWSTR)lpStartOfFreeSpace, src->lpPlayerName->u2.lpszLongName );
dest->lpPlayerName->u2.lpszLongName = (LPWSTR)lpStartOfFreeSpace;
lpStartOfFreeSpace += sizeof(WCHAR) *
( strlenW( (LPWSTR)dest->lpPlayerName->pln.lpszLongName ) + 1 );
( strlenW( (LPWSTR)dest->lpPlayerName->u2.lpszLongName ) + 1 );
}
}
......@@ -952,14 +952,14 @@ DWORD DPLAYX_SizeOfLobbyDataA( LPDPLCONNECTION lpConn )
{
dwTotalSize += sizeof( DPSESSIONDESC2 );
if( lpConn->lpSessionDesc->sess.lpszSessionNameA )
if( lpConn->lpSessionDesc->u1.lpszSessionNameA )
{
dwTotalSize += strlen( lpConn->lpSessionDesc->sess.lpszSessionNameA ) + 1;
dwTotalSize += strlen( lpConn->lpSessionDesc->u1.lpszSessionNameA ) + 1;
}
if( lpConn->lpSessionDesc->pass.lpszPasswordA )
if( lpConn->lpSessionDesc->u2.lpszPasswordA )
{
dwTotalSize += strlen( lpConn->lpSessionDesc->pass.lpszPasswordA ) + 1;
dwTotalSize += strlen( lpConn->lpSessionDesc->u2.lpszPasswordA ) + 1;
}
}
......@@ -967,14 +967,14 @@ DWORD DPLAYX_SizeOfLobbyDataA( LPDPLCONNECTION lpConn )
{
dwTotalSize += sizeof( DPNAME );
if( lpConn->lpPlayerName->psn.lpszShortNameA )
if( lpConn->lpPlayerName->u1.lpszShortNameA )
{
dwTotalSize += strlen( lpConn->lpPlayerName->psn.lpszShortNameA ) + 1;
dwTotalSize += strlen( lpConn->lpPlayerName->u1.lpszShortNameA ) + 1;
}
if( lpConn->lpPlayerName->pln.lpszLongNameA )
if( lpConn->lpPlayerName->u2.lpszLongNameA )
{
dwTotalSize += strlen( lpConn->lpPlayerName->pln.lpszLongNameA ) + 1;
dwTotalSize += strlen( lpConn->lpPlayerName->u2.lpszLongNameA ) + 1;
}
}
......@@ -999,16 +999,16 @@ DWORD DPLAYX_SizeOfLobbyDataW( LPDPLCONNECTION lpConn )
{
dwTotalSize += sizeof( DPSESSIONDESC2 );
if( lpConn->lpSessionDesc->sess.lpszSessionName )
if( lpConn->lpSessionDesc->u1.lpszSessionName )
{
dwTotalSize += sizeof( WCHAR ) *
( strlenW( lpConn->lpSessionDesc->sess.lpszSessionName ) + 1 );
( strlenW( lpConn->lpSessionDesc->u1.lpszSessionName ) + 1 );
}
if( lpConn->lpSessionDesc->pass.lpszPassword )
if( lpConn->lpSessionDesc->u2.lpszPassword )
{
dwTotalSize += sizeof( WCHAR ) *
( strlenW( lpConn->lpSessionDesc->pass.lpszPassword ) + 1 );
( strlenW( lpConn->lpSessionDesc->u2.lpszPassword ) + 1 );
}
}
......@@ -1016,16 +1016,16 @@ DWORD DPLAYX_SizeOfLobbyDataW( LPDPLCONNECTION lpConn )
{
dwTotalSize += sizeof( DPNAME );
if( lpConn->lpPlayerName->psn.lpszShortName )
if( lpConn->lpPlayerName->u1.lpszShortName )
{
dwTotalSize += sizeof( WCHAR ) *
( strlenW( lpConn->lpPlayerName->psn.lpszShortName ) + 1 );
( strlenW( lpConn->lpPlayerName->u1.lpszShortName ) + 1 );
}
if( lpConn->lpPlayerName->pln.lpszLongName )
if( lpConn->lpPlayerName->u2.lpszLongName )
{
dwTotalSize += sizeof( WCHAR ) *
( strlenW( lpConn->lpPlayerName->pln.lpszLongName ) + 1 );
( strlenW( lpConn->lpPlayerName->u2.lpszLongName ) + 1 );
}
}
......@@ -1053,17 +1053,17 @@ BOOL DPLAYX_CopyIntoSessionDesc2A( LPDPSESSIONDESC2 lpSessionDest,
{
CopyMemory( lpSessionDest, lpSessionSrc, sizeof( *lpSessionSrc ) );
if( lpSessionSrc->sess.lpszSessionNameA )
if( lpSessionSrc->u1.lpszSessionNameA )
{
if ((lpSessionDest->sess.lpszSessionNameA = HeapAlloc( GetProcessHeap(), 0,
strlen(lpSessionSrc->sess.lpszSessionNameA)+1 )))
strcpy( lpSessionDest->sess.lpszSessionNameA, lpSessionSrc->sess.lpszSessionNameA );
if ((lpSessionDest->u1.lpszSessionNameA = HeapAlloc( GetProcessHeap(), 0,
strlen(lpSessionSrc->u1.lpszSessionNameA)+1 )))
strcpy( lpSessionDest->u1.lpszSessionNameA, lpSessionSrc->u1.lpszSessionNameA );
}
if( lpSessionSrc->pass.lpszPasswordA )
if( lpSessionSrc->u2.lpszPasswordA )
{
if ((lpSessionDest->pass.lpszPasswordA = HeapAlloc( GetProcessHeap(), 0,
strlen(lpSessionSrc->pass.lpszPasswordA)+1 )))
strcpy( lpSessionDest->pass.lpszPasswordA, lpSessionSrc->pass.lpszPasswordA );
if ((lpSessionDest->u2.lpszPasswordA = HeapAlloc( GetProcessHeap(), 0,
strlen(lpSessionSrc->u2.lpszPasswordA)+1 )))
strcpy( lpSessionDest->u2.lpszPasswordA, lpSessionSrc->u2.lpszPasswordA );
}
return TRUE;
......
......@@ -932,7 +932,7 @@ static HRESULT WINAPI IDirectPlayLobbyAImpl_EnumLocalApplications
dplAppInfo.dwSize = sizeof( dplAppInfo );
dplAppInfo.guidApplication = serviceProviderGUID;
dplAppInfo.appName.lpszAppNameA = subKeyName;
dplAppInfo.u.lpszAppNameA = subKeyName;
EnterCriticalSection( &This->unk->DPL_lock );
......
......@@ -118,9 +118,9 @@ void NS_SetRemoteComputerAsNameServer( LPVOID lpNSAddrHdr,
CopyMemory( lpCacheNode->data, &lpMsg->sd, sizeof( *lpCacheNode->data ) );
len = WideCharToMultiByte( CP_ACP, 0, (LPWSTR)(lpMsg+1), -1, NULL, 0, NULL, NULL );
if ((lpCacheNode->data->sess.lpszSessionNameA = HeapAlloc( GetProcessHeap(), 0, len )))
if ((lpCacheNode->data->u1.lpszSessionNameA = HeapAlloc( GetProcessHeap(), 0, len )))
WideCharToMultiByte( CP_ACP, 0, (LPWSTR)(lpMsg+1), -1,
lpCacheNode->data->sess.lpszSessionNameA, len, NULL, NULL );
lpCacheNode->data->u1.lpszSessionNameA, len, NULL, NULL );
lpCacheNode->dwTime = timeGetTime();
......@@ -341,10 +341,10 @@ void NS_ReplyToEnumSessionsRequest( LPVOID lpMsg,
if (bAnsi)
dwVariableLen = MultiByteToWideChar( CP_ACP, 0,
lpDP->dp2->lpSessionDesc->sess.lpszSessionNameA,
lpDP->dp2->lpSessionDesc->u1.lpszSessionNameA,
-1, NULL, 0 );
else
dwVariableLen = strlenW( lpDP->dp2->lpSessionDesc->sess.lpszSessionName ) + 1;
dwVariableLen = strlenW( lpDP->dp2->lpSessionDesc->u1.lpszSessionName ) + 1;
dwVariableSize = dwVariableLen * sizeof( WCHAR );
......@@ -364,8 +364,8 @@ void NS_ReplyToEnumSessionsRequest( LPVOID lpMsg,
sizeof( lpDP->dp2->lpSessionDesc->dwSize ) );
rmsg->dwUnknown = 0x0000005c;
if( bAnsi )
MultiByteToWideChar( CP_ACP, 0, lpDP->dp2->lpSessionDesc->sess.lpszSessionNameA, -1,
MultiByteToWideChar( CP_ACP, 0, lpDP->dp2->lpSessionDesc->u1.lpszSessionNameA, -1,
(LPWSTR)(rmsg+1), dwVariableLen );
else
strcpyW( (LPWSTR)(rmsg+1), lpDP->dp2->lpSessionDesc->sess.lpszSessionName );
strcpyW( (LPWSTR)(rmsg+1), lpDP->dp2->lpSessionDesc->u1.lpszSessionName );
}
......@@ -156,15 +156,15 @@ typedef struct _D3DHVERTEX {
union {
D3DVALUE hx;
D3DVALUE dvHX;
} x;
} DUMMYUNIONNAME1;
union {
D3DVALUE hy;
D3DVALUE dvHY;
} y;
} DUMMYUNIONNAME2;
union {
D3DVALUE hz;
D3DVALUE dvHZ;
} z;
} DUMMYUNIONNAME3;
} D3DHVERTEX, *LPD3DHVERTEX;
/*
......@@ -174,35 +174,35 @@ typedef struct {
union {
D3DVALUE sx;
D3DVALUE dvSX;
} x;
} DUMMYUNIONNAME1;
union {
D3DVALUE sy;
D3DVALUE dvSY;
} y;
} DUMMYUNIONNAME2;
union {
D3DVALUE sz;
D3DVALUE dvSZ;
} z;
} DUMMYUNIONNAME3;
union {
D3DVALUE rhw;
D3DVALUE dvRHW;
} r;
} DUMMYUNIONNAME4;
union {
D3DCOLOR color;
D3DCOLOR dcColor;
} c;
} DUMMYUNIONNAME5;
union {
D3DCOLOR specular;
D3DCOLOR dcSpecular;
} s;
} DUMMYUNIONNAME6;
union {
D3DVALUE tu;
D3DVALUE dvTU;
} u;
} DUMMYUNIONNAME7;
union {
D3DVALUE tv;
D3DVALUE dvTV;
} v;
} DUMMYUNIONNAME8;
/* There are C++ members associated with this class */
} D3DTLVERTEX, *LPD3DTLVERTEX;
......@@ -210,67 +210,67 @@ typedef struct _D3DLVERTEX {
union {
D3DVALUE x;
D3DVALUE dvX;
} x;
} DUMMYUNIONNAME1;
union {
D3DVALUE y;
D3DVALUE dvY;
} y;
} DUMMYUNIONNAME2;
union {
D3DVALUE z;
D3DVALUE dvZ;
} z;
} DUMMYUNIONNAME3;
DWORD dwReserved;
union {
D3DCOLOR color;
D3DCOLOR dcColor;
} c;
} DUMMYUNIONNAME4;
union {
D3DCOLOR specular;
D3DCOLOR dcSpecular;
} s;
} DUMMYUNIONNAME5;
union {
D3DVALUE tu;
D3DVALUE dvTU;
} u;
} DUMMYUNIONNAME6;
union {
D3DVALUE tv;
D3DVALUE dvTV;
} v;
} DUMMYUNIONNAME7;
} D3DLVERTEX, *LPD3DLVERTEX;
typedef struct _D3DVERTEX {
union {
D3DVALUE x;
D3DVALUE dvX;
} x;
} DUMMYUNIONNAME1;
union {
D3DVALUE y;
D3DVALUE dvY;
} y;
} DUMMYUNIONNAME2;
union {
D3DVALUE z;
D3DVALUE dvZ;
} z;
} DUMMYUNIONNAME3;
union {
D3DVALUE nx;
D3DVALUE dvNX;
} nx;
} DUMMYUNIONNAME4;
union {
D3DVALUE ny;
D3DVALUE dvNY;
} ny;
} DUMMYUNIONNAME5;
union {
D3DVALUE nz;
D3DVALUE dvNZ;
} nz;
} DUMMYUNIONNAME6;
union {
D3DVALUE tu;
D3DVALUE dvTU;
} u;
} DUMMYUNIONNAME7;
union {
D3DVALUE tv;
D3DVALUE dvTV;
} v;
} DUMMYUNIONNAME8;
/* FIXME: Some C++ stuff to go here */
} D3DVERTEX, *LPD3DVERTEX;
......@@ -432,23 +432,23 @@ typedef struct _D3DMATERIAL {
union {
D3DCOLORVALUE diffuse;
D3DCOLORVALUE dcvDiffuse;
} a;
} DUMMYUNIONNAME;
union {
D3DCOLORVALUE ambient;
D3DCOLORVALUE dcvAmbient;
} b;
} DUMMYUNIONNAME1;
union {
D3DCOLORVALUE specular;
D3DCOLORVALUE dcvSpecular;
} c;
} DUMMYUNIONNAME2;
union {
D3DCOLORVALUE emissive;
D3DCOLORVALUE dcvEmissive;
} d;
} DUMMYUNIONNAME3;
union {
D3DVALUE power;
D3DVALUE dvPower;
} e;
} DUMMYUNIONNAME4;
D3DTEXTUREHANDLE hTexture;
DWORD dwRampSize;
} D3DMATERIAL, *LPD3DMATERIAL;
......@@ -911,11 +911,11 @@ typedef struct _D3DSTATE {
D3DTRANSFORMSTATETYPE dtstTransformStateType;
D3DLIGHTSTATETYPE dlstLightStateType;
D3DRENDERSTATETYPE drstRenderStateType;
} t;
} DUMMYUNIONNAME1;
union {
DWORD dwArg[1];
D3DVALUE dvArg[1];
} v;
} DUMMYUNIONNAME2;
} D3DSTATE, *LPD3DSTATE;
typedef struct _D3DMATRIXLOAD {
......@@ -1064,15 +1064,15 @@ typedef struct _D3DTRIANGLE {
union {
WORD v1;
WORD wV1;
} v1;
} DUMMYUNIONNAME1;
union {
WORD v2;
WORD wV2;
} v2;
} DUMMYUNIONNAME2;
union {
WORD v3;
WORD wV3;
} v3;
} DUMMYUNIONNAME3;
WORD wFlags;
} D3DTRIANGLE, *LPD3DTRIANGLE;
......@@ -1080,11 +1080,11 @@ typedef struct _D3DLINE {
union {
WORD v1;
WORD wV1;
} v1;
} DUMMYUNIONNAME1;
union {
WORD v2;
WORD wV2;
} v2;
} DUMMYUNIONNAME2;
} D3DLINE, *LPD3DLINE;
typedef struct _D3DSPAN {
......
#ifndef __WINE_DPLAY_H
#define __WINE_DPLAY_H
/* FIXME: GCC doesn't yet support annon structures so some of the structures
* defined here don't match the sdk exactly. I've tried to come up with
* suitably terse names, but this file won't cut it for inclusion into a
* Winelib app.
*/
#include "wine/obj_base.h"
#ifdef __cplusplus
......@@ -182,13 +176,13 @@ typedef struct tagDPNAME
{
LPWSTR lpszShortName;
LPSTR lpszShortNameA;
}psn;
} DUMMYUNIONNAME1;
union /*playerLongName */ /* Player's formal/real name */
{
LPWSTR lpszLongName;
LPSTR lpszLongNameA;
}pln;
} DUMMYUNIONNAME2;
} DPNAME, *LPDPNAME;
......@@ -232,13 +226,13 @@ typedef struct tagDPSESSIONDESC2
{
LPWSTR lpszSessionName;
LPSTR lpszSessionNameA;
}sess;
} DUMMYUNIONNAME1;
union /* Optional password */
{
LPWSTR lpszPassword;
LPSTR lpszPasswordA;
}pass;
} DUMMYUNIONNAME2;
DWORD dwReserved1;
DWORD dwReserved2;
......@@ -289,7 +283,7 @@ typedef struct tagDPCHAT
{ /* Message string */
LPWSTR lpszMessage; /* Unicode */
LPSTR lpszMessageA; /* ANSI */
}msgstr;
} DUMMYUNIONNAME;
} DPCHAT, *LPDPCHAT;
typedef struct
......@@ -307,12 +301,12 @@ typedef struct tagDPSECURITYDESC
{ /* SSPI provider name */
LPWSTR lpszSSPIProvider; /* Unicode */
LPSTR lpszSSPIProviderA; /* ANSI */
}sspi;
} DUMMYUNIONNAME1;
union
{ /* CAPI provider name */
LPWSTR lpszCAPIProvider; /* Unicode */
LPSTR lpszCAPIProviderA; /* ANSI */
}capi;
} DUMMYUNIONNAME2;
DWORD dwCAPIProviderType; /* Crypto Service Provider type */
DWORD dwEncryptionAlgorithm; /* Encryption Algorithm type */
} DPSECURITYDESC, *LPDPSECURITYDESC;
......@@ -327,17 +321,17 @@ typedef struct tagDPCREDENTIALS
{ /* User name of the account */
LPWSTR lpszUsername; /* Unicode */
LPSTR lpszUsernameA; /* ANSI */
}name;
} DUMMYUNIONNAME1;
union
{ /* Password of the account */
LPWSTR lpszPassword; /* Unicode */
LPSTR lpszPasswordA; /* ANSI */
}pass;
} DUMMYUNIONNAME2;
union
{ /* Domain name of the account */
LPWSTR lpszDomain; /* Unicode */
LPSTR lpszDomainA; /* ANSI */
}domain;
} DUMMYUNIONNAME3;
} DPCREDENTIALS, *LPDPCREDENTIALS;
typedef const DPCREDENTIALS *LPCDPCREDENTIALS;
......
#ifndef __WINE_DPLOBBY_H
#define __WINE_DPLOBBY_H
/* FIXME: GCC doesn't yet support annon structures so some of the structures
* defined here don't match the sdk exactly. I've tried to come up with
* suitably terse names, but this file won't cut it for inclusion into a
* Winelib app.
*/
#include "dplay.h"
#ifdef __cplusplus
......@@ -276,7 +270,7 @@ typedef struct tagDPLAPPINFO
{
LPSTR lpszAppNameA;
LPWSTR lpszAppName;
} appName;
} DUMMYUNIONNAME;
} DPLAPPINFO, *LPDPLAPPINFO;
typedef const DPLAPPINFO *LPCDPLAPPINFO;
......@@ -298,7 +292,7 @@ typedef struct tagDPAPPLICATIONDESC
{
LPSTR lpszApplicationNameA;
LPWSTR lpszApplicationName;
} appName;
} DUMMYUNIONNAME1;
GUID guidApplication;
......@@ -306,25 +300,25 @@ typedef struct tagDPAPPLICATIONDESC
{
LPSTR lpszFilenameA;
LPWSTR lpszFilename;
} fileName;
} DUMMYUNIONNAME2;
union
{
LPSTR lpszCommandLineA;
LPWSTR lpszCommandLine;
} cmdLine;
} DUMMYUNIONNAME3;
union
{
LPSTR lpszPathA;
LPWSTR lpszPath;
} path;
} DUMMYUNIONNAME4;
union
{
LPSTR lpszCurrentDirectoryA;
LPWSTR lpszCurrentDirectory;
} curDir;
} DUMMYUNIONNAME5;
LPSTR lpszDescriptionA;
LPWSTR lpszDescriptionW;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment