winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
893 discussions
Start a n
N
ew thread
Rob Shearman : wininet: Fix HTTP_EncodeBasicAuth by passing an out buffer to the second set of character set conversion calls .
by Alexandre Julliard
17 Jan '07
17 Jan '07
Module: wine Branch: master Commit: 1ec14b0b25209875b3ef5b3598d40672114a583a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1ec14b0b25209875b3ef5b359…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Tue Jan 16 14:44:54 2007 -0600 wininet: Fix HTTP_EncodeBasicAuth by passing an out buffer to the second set of character set conversion calls. --- dlls/wininet/http.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index dd56560..fa2b82f 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -900,10 +900,10 @@ static LPWSTR HTTP_EncodeBasicAuth( LPCW char *in; LPWSTR out; static const WCHAR szBasic[] = {'B','a','s','i','c',' ',0}; + int userlen = WideCharToMultiByte(CP_UTF8, 0, username, lstrlenW(username), NULL, 0, NULL, NULL); + int passlen = WideCharToMultiByte(CP_UTF8, 0, password, lstrlenW(password), NULL, 0, NULL, NULL); - len = WideCharToMultiByte(CP_UTF8, 0, username, lstrlenW(username), NULL, 0, NULL, NULL) + - 1 + WideCharToMultiByte(CP_UTF8, 0, password, lstrlenW(password), NULL, 0, NULL, NULL); - in = HeapAlloc( GetProcessHeap(), 0, (len+1)*sizeof(CHAR) ); + in = HeapAlloc( GetProcessHeap(), 0, userlen + 1 + passlen ); if( !in ) return NULL; @@ -912,11 +912,11 @@ static LPWSTR HTTP_EncodeBasicAuth( LPCW out = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); if( out ) { - WideCharToMultiByte(CP_UTF8, 0, username, -1, NULL, 0, NULL, NULL); - strcat(in, ":"); - WideCharToMultiByte(CP_UTF8, 0, password, -1, NULL, 0, NULL, NULL); + WideCharToMultiByte(CP_UTF8, 0, username, -1, in, userlen, NULL, NULL); + in[userlen] = ':'; + WideCharToMultiByte(CP_UTF8, 0, password, -1, &in[userlen+1], passlen, NULL, NULL); lstrcpyW( out, szBasic ); - HTTP_EncodeBase64( in, len, &out[strlenW(out)] ); + HTTP_EncodeBase64( in, userlen + 1 + passlen, &out[strlenW(out)] ); } HeapFree( GetProcessHeap(), 0, in );
1
0
0
0
Stefan Dösinger : wined3d: Implement per stream offsets.
by Alexandre Julliard
17 Jan '07
17 Jan '07
Module: wine Branch: master Commit: 354fdae524a02655eaecaa95f0bf6f04713bd7e1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=354fdae524a02655eaecaa95f…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Wed Jan 17 00:06:34 2007 +0100 wined3d: Implement per stream offsets. --- dlls/wined3d/directx.c | 2 +- dlls/wined3d/drawprim.c | 47 +++++++++++++++++++++++++++++++++++++---------- dlls/wined3d/state.c | 22 ++++++++++++---------- 3 files changed, 50 insertions(+), 21 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=354fdae524a02655eaeca…
1
0
0
0
Stefan Dösinger : wined3d: Store the stream number in the strided structure.
by Alexandre Julliard
17 Jan '07
17 Jan '07
Module: wine Branch: master Commit: 1d3abdeeaa32766a2506d3b99f8ad24a038e1064 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1d3abdeeaa32766a2506d3b99…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue Jan 16 23:58:29 2007 +0100 wined3d: Store the stream number in the strided structure. --- dlls/ddraw/device.c | 2 +- dlls/wined3d/device.c | 2 +- dlls/wined3d/drawprim.c | 15 ++++++++++++--- dlls/wined3d/wined3d_private.h | 3 ++- include/wine/wined3d_types.h | 1 + 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 62cfa50..d0f81f3 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -3281,6 +3281,7 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrid TRACE("(%p)->(%08x,%08x,%p,%08x,%08x): stub!\n", This, PrimitiveType, VertexType, D3DDrawPrimStrideData, VertexCount, Flags); + memset(&WineD3DStrided, 0, sizeof(WineD3DStrided)); /* Get the strided data right. the wined3d structure is a bit bigger * Watch out: The contents of the strided data are determined by the fvf, * not by the members set in D3DDrawPrimStrideData. So it's valid @@ -3289,7 +3290,6 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrid */ if(VertexType & D3DFVF_POSITION_MASK) { - memset(&WineD3DStrided, 0, sizeof(WineD3DStrided)); WineD3DStrided.u.s.position.lpData = D3DDrawPrimStrideData->position.lpvData; WineD3DStrided.u.s.position.dwStride = D3DDrawPrimStrideData->position.dwStride; WineD3DStrided.u.s.position.dwType = WINED3DDECLTYPE_FLOAT3; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index a77ccdc..bc4b2f2 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4098,7 +4098,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl } memset(&strided, 0, sizeof(strided)); - primitiveConvertFVFtoOffset(SrcImpl->fvf, get_flexible_vertex_size(SrcImpl->fvf), SrcImpl->resource.allocatedMemory + get_flexible_vertex_size(SrcImpl->fvf) * SrcStartIndex, &strided, 0); + primitiveConvertFVFtoOffset(SrcImpl->fvf, get_flexible_vertex_size(SrcImpl->fvf), SrcImpl->resource.allocatedMemory + get_flexible_vertex_size(SrcImpl->fvf) * SrcStartIndex, &strided, 0, 0); return process_vertices_strided(This, DestIndex, VertexCount, &strided, SrcImpl->fvf, (IWineD3DVertexBufferImpl *) pDestBuffer, Flags); } diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index f7df49c..400ffb5 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -223,6 +223,7 @@ void primitiveDeclarationConvertToStride strided->u.input[idx].dwType = element->Type; strided->u.input[idx].dwStride = stride; strided->u.input[idx].VBO = streamVBO; + strided->u.input[idx].streamNo = element->Stream; if (!useVertexShaderFunction) { if (element->Usage == D3DDECLUSAGE_POSITION) strided->u.s.position_transformed = FALSE; @@ -244,7 +245,7 @@ void primitiveDeclarationConvertToStride } } -void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDirect3DVertexStridedData *strided, GLint streamVBO) { +void primitiveConvertFVFtoOffset(DWORD thisFVF, DWORD stride, BYTE *data, WineDirect3DVertexStridedData *strided, GLint streamVBO, UINT streamNo) { int numBlends; int numTextures; int textureNo; @@ -259,6 +260,7 @@ void primitiveConvertFVFtoOffset(DWORD t strided->u.s.position.dwType = WINED3DDECLTYPE_FLOAT3; strided->u.s.position.dwStride = stride; strided->u.s.position.VBO = streamVBO; + strided->u.s.position.streamNo = streamNo; data += 3 * sizeof(float); if (thisFVF & WINED3DFVF_XYZRHW) { strided->u.s.position.dwType = WINED3DDECLTYPE_FLOAT4; @@ -279,6 +281,7 @@ void primitiveConvertFVFtoOffset(DWORD t strided->u.s.blendWeights.dwType = WINED3DDECLTYPE_FLOAT1 + numBlends - 1; strided->u.s.blendWeights.dwStride = stride; strided->u.s.blendWeights.VBO = streamVBO; + strided->u.s.blendWeights.streamNo = streamNo; data += numBlends * sizeof(FLOAT); if (thisFVF & WINED3DFVF_LASTBETA_UBYTE4) { @@ -286,6 +289,7 @@ void primitiveConvertFVFtoOffset(DWORD t strided->u.s.blendMatrixIndices.dwType = WINED3DDECLTYPE_UBYTE4; strided->u.s.blendMatrixIndices.dwStride= stride; strided->u.s.blendMatrixIndices.VBO = streamVBO; + strided->u.s.blendMatrixIndices.streamNo= streamNo; data += sizeof(DWORD); } } @@ -295,7 +299,8 @@ void primitiveConvertFVFtoOffset(DWORD t strided->u.s.normal.lpData = data; strided->u.s.normal.dwType = WINED3DDECLTYPE_FLOAT3; strided->u.s.normal.dwStride = stride; - strided->u.s.normal.VBO = streamVBO; + strided->u.s.normal.VBO = streamVBO; + strided->u.s.normal.streamNo = streamNo; data += 3 * sizeof(FLOAT); } @@ -305,6 +310,7 @@ void primitiveConvertFVFtoOffset(DWORD t strided->u.s.pSize.dwType = WINED3DDECLTYPE_FLOAT1; strided->u.s.pSize.dwStride = stride; strided->u.s.pSize.VBO = streamVBO; + strided->u.s.pSize.streamNo = streamNo; data += sizeof(FLOAT); } @@ -314,6 +320,7 @@ void primitiveConvertFVFtoOffset(DWORD t strided->u.s.diffuse.dwType = WINED3DDECLTYPE_SHORT4; strided->u.s.diffuse.dwStride = stride; strided->u.s.diffuse.VBO = streamVBO; + strided->u.s.diffuse.streamNo = streamNo; data += sizeof(DWORD); } @@ -323,6 +330,7 @@ void primitiveConvertFVFtoOffset(DWORD t strided->u.s.specular.dwType = WINED3DDECLTYPE_SHORT4; strided->u.s.specular.dwStride = stride; strided->u.s.specular.VBO = streamVBO; + strided->u.s.specular.streamNo = streamNo; data += sizeof(DWORD); } @@ -343,6 +351,7 @@ void primitiveConvertFVFtoOffset(DWORD t strided->u.s.texCoords[textureNo].dwType = WINED3DDECLTYPE_FLOAT1; strided->u.s.texCoords[textureNo].dwStride = stride; strided->u.s.texCoords[textureNo].VBO = streamVBO; + strided->u.s.texCoords[textureNo].streamNo = streamNo; numCoords[textureNo] = coordIdxInfo & 0x03; /* Always one set */ @@ -420,7 +429,7 @@ void primitiveConvertToStridedData(IWine if (thisFVF == 0) continue; /* Now convert the stream into pointers */ - primitiveConvertFVFtoOffset(thisFVF, stride, data, strided, streamVBO); + primitiveConvertFVFtoOffset(thisFVF, stride, data, strided, streamVBO, nStream); } /* Now call PreLoad on all the vertex buffers. In the very rare case * that the buffers stopps converting PreLoad will dirtify the VDECL again. diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6b4c42a..529bada 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -396,7 +396,8 @@ void primitiveConvertFVFtoOffset(DWORD t DWORD stride, BYTE *data, WineDirect3DVertexStridedData *strided, - GLint streamVBO); + GLint streamVBO, + UINT streamNo); DWORD get_flexible_vertex_size(DWORD d3dvtVertexType); diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h index 2f75be6..a75c4d4 100644 --- a/include/wine/wined3d_types.h +++ b/include/wine/wined3d_types.h @@ -1252,6 +1252,7 @@ typedef struct WineDirect3DStridedData { DWORD dwStride; /* Stride between occurances of this data */ DWORD dwType; /* Type (as in D3DVSDT_TYPE) */ int VBO; /* Vertex buffer object this data is in */ + UINT streamNo; /* D3D stream number */ } WineDirect3DStridedData; typedef struct WineDirect3DVertexStridedData {
1
0
0
0
Stefan Dösinger : wined3d: Improve drawStridedSlow a bit.
by Alexandre Julliard
17 Jan '07
17 Jan '07
Module: wine Branch: master Commit: 71f923a6d20785ebd43bae9186f62c0029ca0db0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=71f923a6d20785ebd43bae918…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue Jan 16 23:43:28 2007 +0100 wined3d: Improve drawStridedSlow a bit. --- dlls/wined3d/drawprim.c | 123 ++++++++++++++++------------------------------ 1 files changed, 43 insertions(+), 80 deletions(-) diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index b46192e..f7df49c 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -615,9 +615,7 @@ static void drawStridedSlow(IWineD3DDevi const long *pIdxBufL = NULL; LONG vx_index; float x = 0.0f, y = 0.0f, z = 0.0f; /* x,y,z coordinates */ - float nx = 0.0f, ny = 0.0, nz = 0.0f; /* normal x,y,z coordinates */ float rhw = 0.0f; /* rhw */ - float ptSize = 0.0f; /* Point size */ DWORD diffuseColor = 0xFFFFFFFF; /* Diffuse Color */ DWORD specularColor = 0; /* Specular Color */ IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; @@ -635,6 +633,19 @@ static void drawStridedSlow(IWineD3DDevi VTRACE(("glBegin(%x)\n", glPrimType)); glBegin(glPrimType); + /* Default settings for data that is not passed */ + if (sd->u.s.normal.lpData == NULL) { + glNormal3f(0, 0, 1); + } + if(sd->u.s.diffuse.lpData != NULL) { + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } + if(sd->u.s.specular.lpData != NULL) { + if (GL_SUPPORT(EXT_SECONDARY_COLOR)) { + GL_EXTCALL(glSecondaryColor3fEXT)(0, 0, 0); + } + } + /* We shouldn't start this function if any VBO is involved. Should I put a safety check here? * Guess it's not necessary(we crash then anyway) and would only eat CPU time */ @@ -645,6 +656,10 @@ static void drawStridedSlow(IWineD3DDevi /* Initialize diffuse color */ diffuseColor = 0xFFFFFFFF; + /* Blending data and Point sizes are not supported by this function. They are not supported by the fixed + * function pipeline at all. A Fixme for them is printed after decoding the vertex declaration + */ + /* For indexed data, we need to go a few more strides in */ if (idxData != NULL) { @@ -658,68 +673,6 @@ static void drawStridedSlow(IWineD3DDevi } } - /* Position Information ------------------ */ - if (sd->u.s.position.lpData != NULL) { - - float *ptrToCoords = (float *)(sd->u.s.position.lpData + (SkipnStrides * sd->u.s.position.dwStride)); - x = ptrToCoords[0]; - y = ptrToCoords[1]; - z = ptrToCoords[2]; - rhw = 1.0; - VTRACE(("x,y,z=%f,%f,%f\n", x,y,z)); - - /* RHW follows, only if transformed, ie 4 floats were provided */ - if (sd->u.s.position_transformed) { - rhw = ptrToCoords[3]; - VTRACE(("rhw=%f\n", rhw)); - } - } - - /* Blending data -------------------------- */ - if (sd->u.s.blendWeights.lpData != NULL) { - /* float *ptrToCoords = (float *)(sd->u.s.blendWeights.lpData + (SkipnStrides * sd->u.s.blendWeights.dwStride)); */ - FIXME("Blending not supported yet\n"); - - if (sd->u.s.blendMatrixIndices.lpData != NULL) { - /*DWORD *ptrToCoords = (DWORD *)(sd->u.s.blendMatrixIndices.lpData + (SkipnStrides * sd->u.s.blendMatrixIndices.dwStride));*/ - } - } - - /* Vertex Normal Data (untransformed only)- */ - if (sd->u.s.normal.lpData != NULL) { - - float *ptrToCoords = (float *)(sd->u.s.normal.lpData + (SkipnStrides * sd->u.s.normal.dwStride)); - nx = ptrToCoords[0]; - ny = ptrToCoords[1]; - nz = ptrToCoords[2]; - VTRACE(("nx,ny,nz=%f,%f,%f\n", nx, ny, nz)); - } - - /* Point Size ----------------------------- */ - if (sd->u.s.pSize.lpData != NULL) { - - float *ptrToCoords = (float *)(sd->u.s.pSize.lpData + (SkipnStrides * sd->u.s.pSize.dwStride)); - ptSize = ptrToCoords[0]; - VTRACE(("ptSize=%f\n", ptSize)); - FIXME("No support for ptSize yet\n"); - } - - /* Diffuse -------------------------------- */ - if (sd->u.s.diffuse.lpData != NULL) { - - DWORD *ptrToCoords = (DWORD *)(sd->u.s.diffuse.lpData + (SkipnStrides * sd->u.s.diffuse.dwStride)); - diffuseColor = ptrToCoords[0]; - VTRACE(("diffuseColor=%lx\n", diffuseColor)); - } - - /* Specular -------------------------------- */ - if (sd->u.s.specular.lpData != NULL) { - - DWORD *ptrToCoords = (DWORD *)(sd->u.s.specular.lpData + (SkipnStrides * sd->u.s.specular.dwStride)); - specularColor = ptrToCoords[0]; - VTRACE(("specularColor=%lx\n", specularColor)); - } - /* Texture coords --------------------------- */ for (textureNo = 0, texture_idx = 0; textureNo < GL_LIMITS(texture_stages); ++textureNo) { @@ -835,7 +788,11 @@ static void drawStridedSlow(IWineD3DDevi /* Diffuse -------------------------------- */ if (sd->u.s.diffuse.lpData != NULL) { - glColor4ub(D3DCOLOR_B_R(diffuseColor), + DWORD *ptrToCoords = (DWORD *)(sd->u.s.diffuse.lpData + (SkipnStrides * sd->u.s.diffuse.dwStride)); + diffuseColor = ptrToCoords[0]; + VTRACE(("diffuseColor=%lx\n", diffuseColor)); + + glColor4ub(D3DCOLOR_B_R(diffuseColor), D3DCOLOR_B_G(diffuseColor), D3DCOLOR_B_B(diffuseColor), D3DCOLOR_B_A(diffuseColor)); @@ -844,12 +801,14 @@ static void drawStridedSlow(IWineD3DDevi D3DCOLOR_B_G(diffuseColor), D3DCOLOR_B_B(diffuseColor), D3DCOLOR_B_A(diffuseColor))); - } else { - if (vx_index == 0) glColor4f(1.0f, 1.0f, 1.0f, 1.0f); } /* Specular ------------------------------- */ if (sd->u.s.specular.lpData != NULL) { + DWORD *ptrToCoords = (DWORD *)(sd->u.s.specular.lpData + (SkipnStrides * sd->u.s.specular.dwStride)); + specularColor = ptrToCoords[0]; + VTRACE(("specularColor=%lx\n", specularColor)); + /* special case where the fog density is stored in the diffuse alpha channel */ if(This->stateBlock->renderState[WINED3DRS_FOGENABLE] && (This->stateBlock->renderState[WINED3DRS_FOGVERTEXMODE] == WINED3DFOG_NONE || sd->u.s.position.dwType == WINED3DDECLTYPE_FLOAT4 )&& @@ -879,27 +838,31 @@ static void drawStridedSlow(IWineD3DDevi /* Do not worry if specular colour missing and disable request */ VTRACE(("Specular color extensions not supplied\n")); } - } else { - if (vx_index == 0) { - if (GL_SUPPORT(EXT_SECONDARY_COLOR)) { - GL_EXTCALL(glSecondaryColor3fEXT)(0, 0, 0); - } else { - /* Do not worry if specular colour missing and disable request */ - VTRACE(("Specular color extensions not supplied\n")); - } - } } /* Normal -------------------------------- */ if (sd->u.s.normal.lpData != NULL) { - VTRACE(("glNormal:nx,ny,nz=%f,%f,%f\n", nx,ny,nz)); - glNormal3f(nx, ny, nz); - } else { - if (vx_index == 0) glNormal3f(0, 0, 1); + float *ptrToCoords = (float *)(sd->u.s.normal.lpData + (SkipnStrides * sd->u.s.normal.dwStride)); + + VTRACE(("glNormal:nx,ny,nz=%f,%f,%f\n", ptrToCoords[0], ptrToCoords[1], ptrToCoords[2])); + glNormal3f(ptrToCoords[0], ptrToCoords[1], ptrToCoords[2]); } /* Position -------------------------------- */ if (sd->u.s.position.lpData != NULL) { + float *ptrToCoords = (float *)(sd->u.s.position.lpData + (SkipnStrides * sd->u.s.position.dwStride)); + x = ptrToCoords[0]; + y = ptrToCoords[1]; + z = ptrToCoords[2]; + rhw = 1.0; + VTRACE(("x,y,z=%f,%f,%f\n", x,y,z)); + + /* RHW follows, only if transformed, ie 4 floats were provided */ + if (sd->u.s.position_transformed) { + rhw = ptrToCoords[3]; + VTRACE(("rhw=%f\n", rhw)); + } + if (1.0f == rhw || ((rhw < eps) && (rhw > -eps))) { VTRACE(("Vertex: glVertex:x,y,z=%f,%f,%f\n", x,y,z)); glVertex3f(x, y, z);
1
0
0
0
Alasdair Sinclair : msvcrt: If we' re at EOF in the buffer and we have pattern %n in format string we should not count the EOF in the total .
by Alexandre Julliard
17 Jan '07
17 Jan '07
Module: wine Branch: master Commit: 8137c094fdf37e9d101e52f114103bda55c5b3ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8137c094fdf37e9d101e52f11…
Author: Alasdair Sinclair <alasdairs(a)dsl.pipex.com> Date: Wed Jan 17 04:14:27 2007 +0000 msvcrt: If we're at EOF in the buffer and we have pattern %n in format string we should not count the EOF in the total. --- dlls/msvcrt/scanf.h | 2 +- dlls/msvcrt/tests/scanf.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/dlls/msvcrt/scanf.h b/dlls/msvcrt/scanf.h index 139f142..7fe3cc4 100644 --- a/dlls/msvcrt/scanf.h +++ b/dlls/msvcrt/scanf.h @@ -415,7 +415,7 @@ _FUNCTION_ { case 'n': { if (!suppress) { int*n = va_arg(ap, int*); - *n = consumed - (nch!=_EOF_); + *n = consumed - 1; } /* This is an odd one: according to the standard, * "Execution of a %n directive does not increment the diff --git a/dlls/msvcrt/tests/scanf.c b/dlls/msvcrt/tests/scanf.c index 71e6e22..65bea46 100644 --- a/dlls/msvcrt/tests/scanf.c +++ b/dlls/msvcrt/tests/scanf.c @@ -162,6 +162,12 @@ static void test_sscanf( void ) ok(strcmp(buffer1,"def")==0, "Second %%s read incorrectly: %s\n", buffer1); ok(number_so_far==6, "%%n yielded wrong result: %d\n", number_so_far); ok(ret == 2, "%%n shouldn't count as a conversion: %d\n", ret); + + /* Check where %n matches to EOF in buffer */ + strcpy(buffer, "3:45"); + ret = sscanf(buffer, "%d:%d%n", &hour, &min, &number_so_far); + ok(ret == 2, "Wrong number of arguments read: %d\n", ret); + ok(number_so_far == 4, "%%n yielded wrong result: %d\n", number_so_far); } START_TEST(scanf)
1
0
0
0
Andrew Talbot : netapi32: Declare a variable static.
by Alexandre Julliard
17 Jan '07
17 Jan '07
Module: wine Branch: master Commit: 9d70a6ee2caf36d66f1154760fe056919d14234b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d70a6ee2caf36d66f1154760…
Author: Andrew Talbot <Andrew.Talbot(a)talbotville.com> Date: Tue Jan 16 21:11:37 2007 +0000 netapi32: Declare a variable static. --- dlls/netapi32/netapi32.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/netapi32/netapi32.c b/dlls/netapi32/netapi32.c index d583353..a1cef9f 100644 --- a/dlls/netapi32/netapi32.c +++ b/dlls/netapi32/netapi32.c @@ -24,7 +24,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(netbios); -HMODULE NETAPI32_hModule = 0; +static HMODULE NETAPI32_hModule; BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
1
0
0
0
Detlef Riekenberg : localspl: Implement PortIsValid for XcvDataPort.
by Alexandre Julliard
17 Jan '07
17 Jan '07
Module: wine Branch: master Commit: 44570c118c5adc353722e213954490fa758566b8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=44570c118c5adc353722e2139…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Tue Jan 16 00:42:15 2007 +0100 localspl: Implement PortIsValid for XcvDataPort. --- dlls/localspl/localmon.c | 67 ++++++++++++++++++++++++++++++++++++++ dlls/localspl/localspl_private.h | 16 +++++++++ 2 files changed, 83 insertions(+), 0 deletions(-) diff --git a/dlls/localspl/localmon.c b/dlls/localspl/localmon.c index fcf26f9..66d95cf 100644 --- a/dlls/localspl/localmon.c +++ b/dlls/localspl/localmon.c @@ -37,6 +37,7 @@ #include "wine/debug.h" #include "wine/list.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(localspl); @@ -65,8 +66,15 @@ static struct list xcv_handles = LIST_IN /* ############################### */ static const WCHAR cmd_MonitorUIW[] = {'M','o','n','i','t','o','r','U','I',0}; +static const WCHAR cmd_PortIsValidW[] = {'P','o','r','t','I','s','V','a','l','i','d',0}; static const WCHAR dllnameuiW[] = {'l','o','c','a','l','u','i','.','d','l','l',0}; +static const WCHAR portname_LPT[] = {'L','P','T',0}; +static const WCHAR portname_COM[] = {'C','O','M',0}; +static const WCHAR portname_FILE[] = {'F','I','L','E',':',0}; +static const WCHAR portname_CUPS[] = {'C','U','P','S',':',0}; +static const WCHAR portname_LPR[] = {'L','P','R',':',0}; + static const WCHAR WinNT_CV_PortsW[] = {'S','o','f','t','w','a','r','e','\\', 'M','i','c','r','o','s','o','f','t','\\', 'W','i','n','d','o','w','s',' ','N','T','\\', @@ -198,6 +206,52 @@ getports_cleanup: } /***************************************************** + * get_type_from_name (internal) + * + */ + +static DWORD get_type_from_name(LPCWSTR name) +{ + HANDLE hfile; + + if (!strncmpW(name, portname_LPT, sizeof(portname_LPT) / sizeof(WCHAR) -1)) + return PORT_IS_LPT; + + if (!strncmpW(name, portname_COM, sizeof(portname_COM) / sizeof(WCHAR) -1)) + return PORT_IS_COM; + + if (!strcmpW(name, portname_FILE)) + return PORT_IS_FILE; + + if (name[0] == '/') + return PORT_IS_UNIXNAME; + + if (name[0] == '|') + return PORT_IS_PIPE; + + if (!strncmpW(name, portname_CUPS, sizeof(portname_CUPS) / sizeof(WCHAR) -1)) + return PORT_IS_CUPS; + + if (!strncmpW(name, portname_LPR, sizeof(portname_LPR) / sizeof(WCHAR) -1)) + return PORT_IS_LPR; + + /* Must be a file or a directory. Does the file exist ? */ + hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + TRACE("%p for OPEN_EXISTING on %s\n", hfile, debugstr_w(name)); + if (hfile == INVALID_HANDLE_VALUE) { + /* Can we create the file? */ + hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); + TRACE("%p for OPEN_ALWAYS\n", hfile); + } + if (hfile != INVALID_HANDLE_VALUE) { + CloseHandle(hfile); + return PORT_IS_FILENAME; + } + /* We can't use the name. use GetLastError() for the reason */ + return PORT_IS_UNKNOWN; +} + +/***************************************************** * localmon_ConfigurePortW [exported through MONITOREX] * * Display the Configuration-Dialog for a specific Port @@ -370,6 +424,7 @@ BOOL WINAPI localmon_XcvClosePort(HANDLE DWORD WINAPI localmon_XcvDataPort(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInputData, DWORD cbInputData, PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded) { + DWORD res; TRACE("(%p, %s, %p, %d, %p, %d, %p)\n", hXcv, debugstr_w(pszDataName), pInputData, cbInputData, pOutputData, cbOutputData, pcbOutputNeeded); @@ -383,6 +438,18 @@ DWORD WINAPI localmon_XcvDataPort(HANDLE } return ERROR_INSUFFICIENT_BUFFER; } + + if (!lstrcmpW(pszDataName, cmd_PortIsValidW)) { + TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData)); + res = get_type_from_name((LPCWSTR) pInputData); + TRACE("detected as %u\n", res); + /* names, that we have recognized, are valid */ + if (res) return ERROR_SUCCESS; + + /* ERROR_ACCESS_DENIED, ERROR_PATH_NOT_FOUND ore something else */ + return GetLastError(); + } + FIXME("command not supported: %s\n", debugstr_w(pszDataName)); return ERROR_INVALID_PARAMETER; } diff --git a/dlls/localspl/localspl_private.h b/dlls/localspl/localspl_private.h index 7633c93..7755858 100644 --- a/dlls/localspl/localspl_private.h +++ b/dlls/localspl/localspl_private.h @@ -35,6 +35,22 @@ extern HINSTANCE LOCALSPL_hInstance; #define IDS_LOCALPORT_MAXLEN 32 #define IDS_NOTHINGTOCONFIG_MAXLEN 80 +/* ## Type of Ports ## */ +/* windows types */ +#define PORT_IS_UNKNOWN 0 +#define PORT_IS_LPT 1 +#define PORT_IS_COM 2 +#define PORT_IS_FILE 3 +#define PORT_IS_FILENAME 4 + +/* wine extensions */ +#define PORT_IS_WINE 5 +#define PORT_IS_UNIXNAME 5 +#define PORT_IS_PIPE 6 +#define PORT_IS_CUPS 7 +#define PORT_IS_LPR 8 + + /* ## Memory allocation macros ## */ static inline void *spl_alloc( size_t len )
1
0
0
0
Detlef Riekenberg : localspl: Implement XcvDataPort.
by Alexandre Julliard
17 Jan '07
17 Jan '07
Module: wine Branch: master Commit: 3777163202bf6bd05f71e3e254ecd8552752eb8e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3777163202bf6bd05f71e3e25…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Tue Jan 16 00:38:02 2007 +0100 localspl: Implement XcvDataPort. --- dlls/localspl/localmon.c | 52 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 51 insertions(+), 1 deletions(-) diff --git a/dlls/localspl/localmon.c b/dlls/localspl/localmon.c index e6dcf39..fcf26f9 100644 --- a/dlls/localspl/localmon.c +++ b/dlls/localspl/localmon.c @@ -64,6 +64,8 @@ static struct list xcv_handles = LIST_IN /* ############################### */ +static const WCHAR cmd_MonitorUIW[] = {'M','o','n','i','t','o','r','U','I',0}; +static const WCHAR dllnameuiW[] = {'l','o','c','a','l','u','i','.','d','l','l',0}; static const WCHAR WinNT_CV_PortsW[] = {'S','o','f','t','w','a','r','e','\\', 'M','i','c','r','o','s','o','f','t','\\', @@ -338,6 +340,54 @@ BOOL WINAPI localmon_XcvClosePort(HANDLE } /***************************************************** + * localmon_XcvDataPort [exported through MONITOREX] + * + * Execute command through a Communication-Channel + * + * PARAMS + * hXcv [i] The Handle to work with + * pszDataName [i] Name of the command to execute + * pInputData [i] Buffer for extra Input Data (needed only for some commands) + * cbInputData [i] Size in Bytes of Buffer at pInputData + * pOutputData [o] Buffer to receive additional Data (needed only for some commands) + * cbOutputData [i] Size in Bytes of Buffer at pOutputData + * pcbOutputNeeded [o] PTR to receive the minimal Size in Bytes of the Buffer at pOutputData + * + * RETURNS + * Success: ERROR_SUCCESS + * Failure: win32 error code (same value is returned by GetLastError) + * + * NOTES + * + * Minimal List of commands, that every Printmonitor DLL should support: + * + *| "MonitorUI" : Return the Name of the Userinterface-DLL as WSTR in pOutputData + *| "AddPort" : Add a Port (Name as WSTR in pInputData) + *| "DeletePort": Delete a Port (Name as WSTR in pInputData) + * + * + */ +DWORD WINAPI localmon_XcvDataPort(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInputData, DWORD cbInputData, + PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded) +{ + + TRACE("(%p, %s, %p, %d, %p, %d, %p)\n", hXcv, debugstr_w(pszDataName), + pInputData, cbInputData, pOutputData, cbOutputData, pcbOutputNeeded); + + + if (!lstrcmpW(pszDataName, cmd_MonitorUIW)) { + * pcbOutputNeeded = sizeof(dllnameuiW); + if (cbOutputData >= sizeof(dllnameuiW)) { + memcpy(pOutputData, dllnameuiW, sizeof(dllnameuiW)); + return ERROR_SUCCESS; + } + return ERROR_INSUFFICIENT_BUFFER; + } + FIXME("command not supported: %s\n", debugstr_w(pszDataName)); + return ERROR_INVALID_PARAMETER; +} + +/***************************************************** * localmon_XcvOpenPort [exported through MONITOREX] * * Open a Communication-Channel @@ -418,7 +468,7 @@ LPMONITOREX WINAPI InitializePrintMonito NULL, /* localmon_GetPrinterDataFromPort */ NULL, /* localmon_SetPortTimeOuts */ localmon_XcvOpenPort, - NULL, /* localmon_XcvDataPort */ + localmon_XcvDataPort, localmon_XcvClosePort } };
1
0
0
0
Detlef Riekenberg : localspl: Implement XcvOpenPort and XcvClosePort.
by Alexandre Julliard
17 Jan '07
17 Jan '07
Module: wine Branch: master Commit: ece92cc4384fd15d6f5a812790b43a19f1d1c4e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ece92cc4384fd15d6f5a81279…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Thu Jan 11 15:02:24 2007 +0100 localspl: Implement XcvOpenPort and XcvClosePort. --- dlls/localspl/localmon.c | 97 +++++++++++++++++++++++++++++++++++++- dlls/localspl/localspl_private.h | 13 +++++ 2 files changed, 109 insertions(+), 1 deletions(-) diff --git a/dlls/localspl/localmon.c b/dlls/localspl/localmon.c index 4f65417..e6dcf39 100644 --- a/dlls/localspl/localmon.c +++ b/dlls/localspl/localmon.c @@ -36,12 +36,35 @@ #include "localspl_private.h" #include "wine/debug.h" +#include "wine/list.h" WINE_DEFAULT_DEBUG_CHANNEL(localspl); /*****************************************************/ +static CRITICAL_SECTION xcv_handles_cs; +static CRITICAL_SECTION_DEBUG xcv_handles_cs_debug = +{ + 0, 0, &xcv_handles_cs, + { &xcv_handles_cs_debug.ProcessLocksList, &xcv_handles_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": xcv_handles_cs") } +}; +static CRITICAL_SECTION xcv_handles_cs = { &xcv_handles_cs_debug, -1, 0, 0, 0, 0 }; + +/* ############################### */ + +typedef struct { + struct list entry; + ACCESS_MASK GrantedAccess; + WCHAR nameW[1]; +} xcv_t; + +static struct list xcv_handles = LIST_INIT( xcv_handles ); + +/* ############################### */ + + static const WCHAR WinNT_CV_PortsW[] = {'S','o','f','t','w','a','r','e','\\', 'M','i','c','r','o','s','o','f','t','\\', 'W','i','n','d','o','w','s',' ','N','T','\\', @@ -289,6 +312,73 @@ cleanup: } /***************************************************** + * localmon_XcvClosePort [exported through MONITOREX] + * + * Close a Communication-Channel + * + * PARAMS + * hXcv [i] The Handle to close + * + * RETURNS + * Success: TRUE + * Failure: FALSE + * + */ +BOOL WINAPI localmon_XcvClosePort(HANDLE hXcv) +{ + xcv_t * xcv = (xcv_t *) hXcv; + + TRACE("(%p)\n", xcv); + /* No checks are done in Windows */ + EnterCriticalSection(&xcv_handles_cs); + list_remove(&xcv->entry); + LeaveCriticalSection(&xcv_handles_cs); + spl_free(xcv); + return TRUE; +} + +/***************************************************** + * localmon_XcvOpenPort [exported through MONITOREX] + * + * Open a Communication-Channel + * + * PARAMS + * pName [i] Name of selected Object + * GrantedAccess [i] Access-Rights to use + * phXcv [o] The resulting Handle is stored here + * + * RETURNS + * Success: TRUE + * Failure: FALSE + * + */ +BOOL WINAPI localmon_XcvOpenPort(LPCWSTR pName, ACCESS_MASK GrantedAccess, PHANDLE phXcv) +{ + DWORD len; + xcv_t * xcv; + + TRACE("%s, 0x%x, %p)\n", debugstr_w(pName), GrantedAccess, phXcv); + /* No checks for any field is done in Windows */ + len = (lstrlenW(pName) + 1) * sizeof(WCHAR); + xcv = spl_alloc( sizeof(xcv_t) + len); + if (xcv) { + xcv->GrantedAccess = GrantedAccess; + memcpy(&xcv->nameW, pName, len); + *phXcv = (HANDLE) xcv; + EnterCriticalSection(&xcv_handles_cs); + list_add_tail(&xcv_handles, &xcv->entry); + LeaveCriticalSection(&xcv_handles_cs); + TRACE("=> %p\n", xcv); + return TRUE; + } + else + { + *phXcv = (HANDLE) NULL; + return FALSE; + } +} + +/***************************************************** * InitializePrintMonitor (LOCALSPL.@) * * Initialize the Monitor for the Local Ports @@ -324,7 +414,12 @@ LPMONITOREX WINAPI InitializePrintMonito NULL, /* localmon_AddPortW */ NULL, /* localmon_AddPortExW */ localmon_ConfigurePortW, - localmon_DeletePortW + localmon_DeletePortW, + NULL, /* localmon_GetPrinterDataFromPort */ + NULL, /* localmon_SetPortTimeOuts */ + localmon_XcvOpenPort, + NULL, /* localmon_XcvDataPort */ + localmon_XcvClosePort } }; diff --git a/dlls/localspl/localspl_private.h b/dlls/localspl/localspl_private.h index ad396c2..7633c93 100644 --- a/dlls/localspl/localspl_private.h +++ b/dlls/localspl/localspl_private.h @@ -35,4 +35,17 @@ extern HINSTANCE LOCALSPL_hInstance; #define IDS_LOCALPORT_MAXLEN 32 #define IDS_NOTHINGTOCONFIG_MAXLEN 80 +/* ## Memory allocation macros ## */ + +static inline void *spl_alloc( size_t len ) +{ + return HeapAlloc( GetProcessHeap(), 0, len ); +} + +static inline BOOL spl_free( void *mem ) +{ + return HeapFree( GetProcessHeap(), 0, mem ); +} + + #endif /* __WINE_LOCALSPL_PRIVATE__ */
1
0
0
0
Detlef Riekenberg : localspl/tests: Add test for XcvDataPort_PortIsValid.
by Alexandre Julliard
17 Jan '07
17 Jan '07
Module: wine Branch: master Commit: 9a3f4546b75cc6532596613be4a7e31658c7516b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9a3f4546b75cc6532596613be…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Tue Jan 16 00:37:08 2007 +0100 localspl/tests: Add test for XcvDataPort_PortIsValid. --- dlls/localspl/tests/localmon.c | 176 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 175 insertions(+), 1 deletions(-) diff --git a/dlls/localspl/tests/localmon.c b/dlls/localspl/tests/localmon.c index 7a3464b..a254a90 100644 --- a/dlls/localspl/tests/localmon.c +++ b/dlls/localspl/tests/localmon.c @@ -67,6 +67,7 @@ static BOOL (WINAPI *pDeletePortUI)(PCW static WCHAR cmd_MonitorUIW[] = {'M','o','n','i','t','o','r','U','I',0}; static WCHAR cmd_MonitorUI_lcaseW[] = {'m','o','n','i','t','o','r','u','i',0}; +static WCHAR cmd_PortIsValidW[] = {'P','o','r','t','I','s','V','a','l','i','d',0}; static WCHAR does_not_existW[] = {'d','o','e','s','_','n','o','t','_','e','x','i','s','t',0}; static WCHAR emptyW[] = {0}; static WCHAR Monitors_LocalPortW[] = { @@ -78,10 +79,15 @@ static WCHAR Monitors_LocalPortW[] = { 'L','o','c','a','l',' ','P','o','r','t',0}; static WCHAR portname_com1W[] = {'C','O','M','1',':',0}; +static WCHAR portname_com2W[] = {'C','O','M','2',':',0}; static WCHAR portname_fileW[] = {'F','I','L','E',':',0}; static WCHAR portname_lpt1W[] = {'L','P','T','1',':',0}; - +static WCHAR portname_lpt2W[] = {'L','P','T','2',':',0}; static WCHAR server_does_not_existW[] = {'\\','\\','d','o','e','s','_','n','o','t','_','e','x','i','s','t',0}; +static WCHAR wineW[] = {'W','i','n','e',0}; + +static WCHAR tempdirW[MAX_PATH]; +static WCHAR tempfileW[MAX_PATH]; /* ########################### */ @@ -459,6 +465,165 @@ static void test_XcvDataPort_MonitorUI(v /* ########################### */ +static void test_XcvDataPort_PortIsValid(void) +{ + DWORD res; + HANDLE hXcv; + DWORD needed; + + + if ((pXcvOpenPort == NULL) || (pXcvDataPort == NULL) || (pXcvClosePort == NULL)) return; + + hXcv = (HANDLE) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvOpenPort(emptyW, SERVER_ACCESS_ADMINISTER, &hXcv); + ok(res, "hXcv: %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv); + if (!res) return; + + /* normal use: "LPT1:" */ + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W), NULL, 0, &needed); + if (res == ERROR_INVALID_PARAMETER) { + pXcvClosePort(hXcv); + skip("'PostIsValid' not supported\n"); + return; + } + ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + + + if (0) { + /* crash with native localspl.dll (w2k+xp) */ + res = pXcvDataPort(hXcv, cmd_PortIsValidW, NULL, 0, NULL, 0, &needed); + } + + + /* hXcv is ignored for the command "PortIsValid" */ + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(NULL, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W), NULL, 0, NULL); + ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + + /* needed is ignored */ + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W), NULL, 0, NULL); + ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + + + /* cbInputData is ignored */ + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, 0, NULL, 0, &needed); + ok( res == ERROR_SUCCESS, + "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + res, GetLastError(), needed); + + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, 1, NULL, 0, &needed); + ok( res == ERROR_SUCCESS, + "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + res, GetLastError(), needed); + + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W) -1, NULL, 0, &needed); + ok( res == ERROR_SUCCESS, + "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + res, GetLastError(), needed); + + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W) -2, NULL, 0, &needed); + ok( res == ERROR_SUCCESS, + "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + res, GetLastError(), needed); + + + /* an empty name is not allowed */ + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) emptyW, sizeof(emptyW), NULL, 0, &needed); + ok( res == ERROR_PATH_NOT_FOUND, + "returned %d with %u and 0x%x (expected ERROR_PATH_NOT_FOUND)\n", + res, GetLastError(), needed); + + + /* a directory is not allowed */ + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) tempdirW, (lstrlenW(tempdirW) + 1) * sizeof(WCHAR), NULL, 0, &needed); + /* XP(admin): ERROR_INVALID_NAME, XP(user): ERROR_PATH_NOT_FOUND, w2k ERROR_ACCESS_DENIED */ + ok( (res == ERROR_INVALID_NAME) || (res == ERROR_PATH_NOT_FOUND) || + (res == ERROR_ACCESS_DENIED), "returned %d with %u and 0x%x " + "(expected ERROR_INVALID_NAME, ERROR_PATH_NOT_FOUND or ERROR_ACCESS_DENIED)\n", + res, GetLastError(), needed); + + + /* test more valid well known Ports: */ + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt2W, sizeof(portname_lpt2W), NULL, 0, &needed); + ok( res == ERROR_SUCCESS, + "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + res, GetLastError(), needed); + + + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_com1W, sizeof(portname_com1W), NULL, 0, &needed); + ok( res == ERROR_SUCCESS, + "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + res, GetLastError(), needed); + + + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_com2W, sizeof(portname_com2W), NULL, 0, &needed); + ok( res == ERROR_SUCCESS, + "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + res, GetLastError(), needed); + + + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_fileW, sizeof(portname_fileW), NULL, 0, &needed); + ok( res == ERROR_SUCCESS, + "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + res, GetLastError(), needed); + + + /* a normal, writeable file is allowed */ + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) tempfileW, (lstrlenW(tempfileW) + 1) * sizeof(WCHAR), NULL, 0, &needed); + ok( res == ERROR_SUCCESS, + "returned %d with %u and 0x%x (expected ERROR_SUCCESS)\n", + res, GetLastError(), needed); + + pXcvClosePort(hXcv); + + + /* small check without access-rights: */ + hXcv = (HANDLE) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvOpenPort(emptyW, 0, &hXcv); + ok(res, "returned %d with %u and %p (expected '!= 0')\n", res, GetLastError(), hXcv); + if (!res) return; + + /* The ACCESS_MASK from XcvOpenPort is ignored in "PortIsValid" */ + needed = (DWORD) 0xdeadbeef; + SetLastError(0xdeadbeef); + res = pXcvDataPort(hXcv, cmd_PortIsValidW, (PBYTE) portname_lpt1W, sizeof(portname_lpt1W), NULL, 0, &needed); + ok( res == ERROR_SUCCESS, "returned %d with %u (expected ERROR_SUCCESS)\n", res, GetLastError()); + + pXcvClosePort(hXcv); + +} + +/* ########################### */ + static void test_XcvOpenPort(void) { DWORD res; @@ -517,11 +682,19 @@ static void test_XcvOpenPort(void) START_TEST(localmon) { DWORD numentries; + DWORD res; /* This DLL does not exists on Win9x */ hdll = LoadLibraryA("localspl.dll"); if (!hdll) return; + tempdirW[0] = '\0'; + tempfileW[0] = '\0'; + res = GetTempPathW(MAX_PATH, tempdirW); + ok(res != 0, "with %u\n", GetLastError()); + res = GetTempFileNameW(tempdirW, wineW, 0, tempfileW); + ok(res != 0, "with %u\n", GetLastError()); + pInitializePrintMonitor = (void *) GetProcAddress(hdll, "InitializePrintMonitor"); pInitializePrintMonitorUI = (void *) GetProcAddress(hdll, "InitializePrintMonitorUI"); @@ -603,5 +776,6 @@ START_TEST(localmon) test_EnumPorts(); test_XcvClosePort(); test_XcvDataPort_MonitorUI(); + test_XcvDataPort_PortIsValid(); test_XcvOpenPort(); }
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200