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 2009
----- 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
3 participants
1348 discussions
Start a n
N
ew thread
Stefan Dösinger : wined3d: Use the ARB fog option in ARB_fragment_program shaders.
by Alexandre Julliard
12 Jan '09
12 Jan '09
Module: wine Branch: master Commit: e61aa24aa31cd09f63d54512e4459ef4afdbd71c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e61aa24aa31cd09f63d54512e…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Dec 14 17:10:09 2008 +0100 wined3d: Use the ARB fog option in ARB_fragment_program shaders. This is the "replacement" for the fog coord optimization removed in the previous patch. --- dlls/wined3d/arb_program_shader.c | 63 ++++++++++++++---------------------- 1 files changed, 25 insertions(+), 38 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 438b025..902c9d3 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -1924,14 +1924,30 @@ static GLuint shader_arb_generate_pshader(IWineD3DPixelShader *iface, SHADER_BUF const shader_reg_maps* reg_maps = &This->baseShader.reg_maps; CONST DWORD *function = This->baseShader.function; DWORD shader_version = reg_maps->shader_version; - const char *fragcolor; const WineD3D_GL_Info *gl_info = &((IWineD3DDeviceImpl *)This->baseShader.device)->adapter->gl_info; const local_constant *lconst; GLuint retval; + const char *fragcolor; /* Create the hw ARB shader */ shader_addline(buffer, "!!ARBfp1.0\n"); + if (shader_version < WINED3DPS_VERSION(3,0)) { + switch(args->fog) { + case FOG_OFF: + break; + case FOG_LINEAR: + shader_addline(buffer, "OPTION ARB_fog_linear;\n"); + break; + case FOG_EXP: + shader_addline(buffer, "OPTION ARB_fog_exp;\n"); + break; + case FOG_EXP2: + shader_addline(buffer, "OPTION ARB_fog_exp2;\n"); + break; + } + } + shader_addline(buffer, "TEMP TMP;\n"); /* Used in matrix ops */ shader_addline(buffer, "TEMP TMP2;\n"); /* Used in matrix ops */ shader_addline(buffer, "TEMP TA;\n"); /* Used for modifiers */ @@ -1941,52 +1957,23 @@ static GLuint shader_arb_generate_pshader(IWineD3DPixelShader *iface, SHADER_BUF shader_addline(buffer, "PARAM coefmul = { 2, 4, 8, 16 };\n"); shader_addline(buffer, "PARAM one = { 1.0, 1.0, 1.0, 1.0 };\n"); + if (shader_version < WINED3DPS_VERSION(2,0)) { + fragcolor = "R0"; + } else { + shader_addline(buffer, "TEMP TMP_COLOR;\n"); + fragcolor = "TMP_COLOR"; + } + /* Base Declarations */ shader_generate_arb_declarations( (IWineD3DBaseShader*) This, reg_maps, buffer, &GLINFO_LOCATION); - /* We need two variables for fog blending */ - if(args->fog != FOG_OFF) shader_addline(buffer, "TEMP TMP_FOG;\n"); - if (shader_version >= WINED3DPS_VERSION(2,0)) shader_addline(buffer, "TEMP TMP_COLOR;\n"); - /* Base Shader Body */ shader_generate_main( (IWineD3DBaseShader*) This, buffer, reg_maps, function); - if (shader_version < WINED3DPS_VERSION(2,0)) { - fragcolor = "R0"; - } else { - fragcolor = "TMP_COLOR"; - } if(args->srgb_correction) { arbfp_add_sRGB_correction(buffer, fragcolor, "TMP", "TMP2", "TA", "TB"); } - if (shader_version < WINED3DPS_VERSION(3,0)) { - /* calculate fog and blend it - * NOTE: state.fog.params.y and state.fog.params.z don't hold fog start s and end e but - * -1/(e-s) and e/(e-s) respectively. - */ - switch(args->fog) { - case FOG_OFF: - shader_addline(buffer, "MOV result.color, %s;\n", fragcolor); - break; - case FOG_LINEAR: - shader_addline(buffer, "SUB TMP_FOG.x, state.fog.params.z, state.fog.params.y;\n"); - shader_addline(buffer, "RCP TMP_FOG, -TMP_FOG.x;\n"); - shader_addline(buffer, "MUL TMP_FOG.y, -TMP_FOG.y, state.fog.params.z;\n"); - shader_addline(buffer, "MAD_SAT TMP_FOG, fragment.fogcoord, TMP_FOG.x, TMP_FOG.y;\n"); - shader_addline(buffer, "LRP result.color.rgb, TMP_FOG.x, %s, state.fog.color;\n", fragcolor); - shader_addline(buffer, "MOV result.color.a, %s.a;\n", fragcolor); - break; - case FOG_EXP: - FIXME("Implement EXP fog in ARB\n"); - shader_addline(buffer, "MOV result.color, %s;\n", fragcolor); - break; - case FOG_EXP2: - FIXME("Implement EXP2 fog in ARB\n"); - shader_addline(buffer, "MOV result.color, %s;\n", fragcolor); - break; - } - } - + shader_addline(buffer, "MOV result.color, %s;\n", fragcolor); shader_addline(buffer, "END\n"); /* TODO: change to resource.glObjectHandle or something like that */
1
0
0
0
Stefan Dösinger : wined3d: Remove the pixelshader fogstart/fogend optimization.
by Alexandre Julliard
12 Jan '09
12 Jan '09
Module: wine Branch: master Commit: 7c21147dcda0fd8c0513abdc25f68e4a2e13c50c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7c21147dcda0fd8c0513abdc2…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Sun Dec 14 17:00:21 2008 +0100 wined3d: Remove the pixelshader fogstart/fogend optimization. --- dlls/wined3d/arb_program_shader.c | 9 ++- dlls/wined3d/glsl_shader.c | 4 +- dlls/wined3d/state.c | 103 ++++++++----------------------------- 3 files changed, 31 insertions(+), 85 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index cd6ba29..438b025 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -1969,9 +1969,12 @@ static GLuint shader_arb_generate_pshader(IWineD3DPixelShader *iface, SHADER_BUF shader_addline(buffer, "MOV result.color, %s;\n", fragcolor); break; case FOG_LINEAR: - shader_addline(buffer, "MAD_SAT TMP_FOG, fragment.fogcoord, state.fog.params.y, state.fog.params.z;\n"); - shader_addline(buffer, "LRP result.color.xyz, TMP_FOG.x, %s, state.fog.color;\n", fragcolor); - shader_addline(buffer, "MOV result.color.w, %s.w;\n", fragcolor); + shader_addline(buffer, "SUB TMP_FOG.x, state.fog.params.z, state.fog.params.y;\n"); + shader_addline(buffer, "RCP TMP_FOG, -TMP_FOG.x;\n"); + shader_addline(buffer, "MUL TMP_FOG.y, -TMP_FOG.y, state.fog.params.z;\n"); + shader_addline(buffer, "MAD_SAT TMP_FOG, fragment.fogcoord, TMP_FOG.x, TMP_FOG.y;\n"); + shader_addline(buffer, "LRP result.color.rgb, TMP_FOG.x, %s, state.fog.color;\n", fragcolor); + shader_addline(buffer, "MOV result.color.a, %s.a;\n", fragcolor); break; case FOG_EXP: FIXME("Implement EXP fog in ARB\n"); diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 0acdcad..8dfb416 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -3844,7 +3844,9 @@ static GLuint shader_glsl_generate_pshader(IWineD3DPixelShader *iface, SHADER_BU switch(args->fog) { case FOG_OFF: break; case FOG_LINEAR: - shader_addline(buffer, "float Fog = clamp(gl_FogFragCoord * gl_Fog.start + gl_Fog.end, 0.0, 1.0);\n"); + shader_addline(buffer, "float fogstart = -1.0 / (gl_Fog.end - gl_Fog.start);\n"); + shader_addline(buffer, "float fogend = gl_Fog.end * -fogstart;\n"); + shader_addline(buffer, "float Fog = clamp(gl_FogFragCoord * fogstart + fogend, 0.0, 1.0);\n"); shader_addline(buffer, "%s.xyz = mix(gl_Fog.color.xyz, %s.xyz, Fog);\n", fragcolor, fragcolor); break; case FOG_EXP: diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 9d97283..d05ed21 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -897,9 +897,6 @@ static void state_stencilwrite(DWORD state, IWineD3DStateBlockImpl *stateblock, } static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { - BOOL fogenable = stateblock->renderState[WINED3DRS_FOGENABLE]; - IWineD3DPixelShaderImpl *ps_impl = (IWineD3DPixelShaderImpl *)stateblock->pixelShader; - BOOL is_ps3 = use_ps(stateblock) && ps_impl->baseShader.reg_maps.shader_version >= WINED3DPS_VERSION(3,0); float fogstart, fogend; union { @@ -907,7 +904,7 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo float f; } tmpvalue; - if (!fogenable) { + if (!stateblock->renderState[WINED3DRS_FOGENABLE]) { /* No fog? Disable it, and we're done :-) */ glDisable(GL_FOG); checkGLcall("glDisable GL_FOG"); @@ -955,19 +952,9 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo * without shaders). */ - if( is_ps3 ) { - if (!use_vs(stateblock) && stateblock->renderState[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE) - { - FIXME("Implement vertex fog for pixel shader >= 3.0 and fixed function pipeline\n"); - } - } - - if (use_vs(stateblock) && ((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->baseShader.reg_maps.fog) - { + if (use_vs(stateblock) && ((IWineD3DVertexShaderImpl *)stateblock->vertexShader)->baseShader.reg_maps.fog) { if( stateblock->renderState[WINED3DRS_FOGTABLEMODE] != WINED3DFOG_NONE ) { - if(!is_ps3) FIXME("Implement table fog for foggy vertex shader\n"); - /* Disable fog */ - fogenable = FALSE; + FIXME("vertex shader with table fog used\n"); } else { /* Set fog computation in the rasterizer to pass through the value (just blend it) */ glFogi(GL_FOG_MODE, GL_LINEAR); @@ -983,47 +970,6 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo } context->last_was_foggy_shader = TRUE; } - else if (use_ps(stateblock)) - { - /* NOTE: For pixel shader, GL_FOG_START and GL_FOG_END don't hold fog start s and end e but - * -1/(e-s) and e/(e-s) respectively to simplify fog computation in the shader. - */ - WINED3DFOGMODE mode; - context->last_was_foggy_shader = FALSE; - - /* If both fogmodes are set use the table fog mode */ - if(stateblock->renderState[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE) - mode = stateblock->renderState[WINED3DRS_FOGVERTEXMODE]; - else - mode = stateblock->renderState[WINED3DRS_FOGTABLEMODE]; - - switch (mode) { - case WINED3DFOG_EXP: - case WINED3DFOG_EXP2: - if(!is_ps3) FIXME("Implement non linear fog for pixel shader < 3.0\n"); - /* Disable fog */ - fogenable = FALSE; - break; - - case WINED3DFOG_LINEAR: - fogstart = -1.0f/(fogend-fogstart); - fogend *= -fogstart; - break; - - case WINED3DFOG_NONE: - if(!is_ps3) FIXME("Implement software vertex fog for pixel shader < 3.0\n"); - /* Disable fog */ - fogenable = FALSE; - break; - default: FIXME("Unexpected WINED3DRS_FOGVERTEXMODE %d\n", stateblock->renderState[WINED3DRS_FOGVERTEXMODE]); - } - - if(context->fog_coord) { - glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT); - checkGLcall("glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)"); - context->fog_coord = FALSE; - } - } /* DX 7 sdk: "If both render states(vertex and table fog) are set to valid modes, * the system will apply only pixel(=table) fog effects." */ @@ -1130,33 +1076,28 @@ static void state_fog(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo } } - if(fogenable) { - glEnable(GL_FOG); - checkGLcall("glEnable GL_FOG"); + glEnable(GL_FOG); + checkGLcall("glEnable GL_FOG"); - if(fogstart != fogend) - { - glFogfv(GL_FOG_START, &fogstart); - checkGLcall("glFogf(GL_FOG_START, fogstart)"); - TRACE("Fog Start == %f\n", fogstart); + if(fogstart != fogend) + { + glFogfv(GL_FOG_START, &fogstart); + checkGLcall("glFogf(GL_FOG_START, fogstart)"); + TRACE("Fog Start == %f\n", fogstart); - glFogfv(GL_FOG_END, &fogend); - checkGLcall("glFogf(GL_FOG_END, fogend)"); - TRACE("Fog End == %f\n", fogend); - } - else - { - glFogf(GL_FOG_START, -1.0 / 0.0); - checkGLcall("glFogf(GL_FOG_START, fogstart)"); - TRACE("Fog Start == %f\n", fogstart); + glFogfv(GL_FOG_END, &fogend); + checkGLcall("glFogf(GL_FOG_END, fogend)"); + TRACE("Fog End == %f\n", fogend); + } + else + { + glFogf(GL_FOG_START, -1.0 / 0.0); + checkGLcall("glFogf(GL_FOG_START, fogstart)"); + TRACE("Fog Start == %f\n", fogstart); - glFogf(GL_FOG_END, 0.0); - checkGLcall("glFogf(GL_FOG_END, fogend)"); - TRACE("Fog End == %f\n", fogend); - } - } else { - glDisable(GL_FOG); - checkGLcall("glDisable GL_FOG"); + glFogf(GL_FOG_END, 0.0); + checkGLcall("glFogf(GL_FOG_END, fogend)"); + TRACE("Fog End == %f\n", fogend); } }
1
0
0
0
Jacek Caban : wininet: Use SSL_pending in NETCON_query_data_available.
by Alexandre Julliard
12 Jan '09
12 Jan '09
Module: wine Branch: master Commit: 4a43c308b58862e78d3ef44ed3f1560458adc1a8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4a43c308b58862e78d3ef44ed…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sat Jan 10 17:02:31 2009 +0100 wininet: Use SSL_pending in NETCON_query_data_available. --- dlls/wininet/netconnection.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index 4a46327..c573407 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -118,6 +118,7 @@ MAKE_FUNCPTR(SSL_connect); MAKE_FUNCPTR(SSL_shutdown); MAKE_FUNCPTR(SSL_write); MAKE_FUNCPTR(SSL_read); +MAKE_FUNCPTR(SSL_pending); MAKE_FUNCPTR(SSL_get_verify_result); MAKE_FUNCPTR(SSL_get_peer_certificate); MAKE_FUNCPTR(SSL_CTX_get_timeout); @@ -181,6 +182,7 @@ BOOL NETCON_init(WININET_NETCONNECTION *connection, BOOL useSSL) DYNSSL(SSL_shutdown); DYNSSL(SSL_write); DYNSSL(SSL_read); + DYNSSL(SSL_pending); DYNSSL(SSL_get_verify_result); DYNSSL(SSL_get_peer_certificate); DYNSSL(SSL_CTX_get_timeout); @@ -606,7 +608,7 @@ BOOL NETCON_query_data_available(WININET_NETCONNECTION *connection, DWORD *avail return FALSE; #ifdef SONAME_LIBSSL - if (connection->peek_msg) *available = connection->peek_len; + if (connection->peek_msg) *available = connection->peek_len + pSSL_pending(connection->ssl_s); #endif #ifdef FIONREAD
1
0
0
0
Jacek Caban : wininet: Improve NETCON_recv over SSL implementation.
by Alexandre Julliard
12 Jan '09
12 Jan '09
Module: wine Branch: master Commit: 5bf719690aefc385b2c386516b6185b4908390f6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5bf719690aefc385b2c386516…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sat Jan 10 17:02:18 2009 +0100 wininet: Improve NETCON_recv over SSL implementation. Current implementation uses only peek buffer if there is any data, which causes reads one byte per call in common InternetQueryDataAvailable/InternetReadFile scenario. --- dlls/wininet/netconnection.c | 88 +++++++++++++++++++++--------------------- 1 files changed, 44 insertions(+), 44 deletions(-) diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index d8bdf45..4a46327 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -539,55 +539,55 @@ BOOL NETCON_recv(WININET_NETCONNECTION *connection, void *buf, size_t len, int f else { #ifdef SONAME_LIBSSL + size_t peek_read = 0, read; + if (flags & ~(MSG_PEEK|MSG_WAITALL)) FIXME("SSL_read does not support the following flag: %08x\n", flags); /* this ugly hack is all for MSG_PEEK. eww gross */ - if (flags & MSG_PEEK && !connection->peek_msg) - { - connection->peek_msg = connection->peek_msg_mem = HeapAlloc(GetProcessHeap(), 0, (sizeof(char) * len) + 1); - } - else if (flags & MSG_PEEK && connection->peek_msg) - { - if (len < connection->peek_len) - FIXME("buffer isn't big enough. Do the expect us to wrap?\n"); - *recvd = min(len, connection->peek_len); - memcpy(buf, connection->peek_msg, *recvd); - return TRUE; - } - else if (connection->peek_msg) - { - *recvd = min(len, connection->peek_len); - memcpy(buf, connection->peek_msg, *recvd); - connection->peek_len -= *recvd; - connection->peek_msg += *recvd; - if (connection->peek_len == 0) - { - HeapFree(GetProcessHeap(), 0, connection->peek_msg_mem); - connection->peek_msg_mem = NULL; + if(connection->peek_msg) { + if(connection->peek_len >= len) { + memcpy(buf, connection->peek_msg, len); + if(!(flags & MSG_PEEK)) { + if(connection->peek_len == len) { + HeapFree(GetProcessHeap(), 0, connection->peek_msg); + connection->peek_msg = NULL; + connection->peek_len = 0; + }else { + memmove(connection->peek_msg, connection->peek_msg+len, connection->peek_len-len); + connection->peek_len -= len; + connection->peek_msg = HeapReAlloc(GetProcessHeap(), 0, connection->peek_msg, connection->peek_len); + } + } + + *recvd = len; + return TRUE; + } + + memcpy(buf, connection->peek_msg, connection->peek_len); + peek_read = connection->peek_len; + + if(!(flags & MSG_PEEK)) { + HeapFree(GetProcessHeap(), 0, connection->peek_msg); connection->peek_msg = NULL; - } - /* check if we got enough data from the peek buffer */ - if (!(flags & MSG_WAITALL) || (*recvd == len)) - return TRUE; - /* otherwise, fall through */ - } - *recvd += pSSL_read(connection->ssl_s, (char*)buf + *recvd, len - *recvd); - if (flags & MSG_PEEK) /* must copy stuff into buffer */ - { - connection->peek_len = *recvd; - if (!*recvd) - { - HeapFree(GetProcessHeap(), 0, connection->peek_msg_mem); - connection->peek_msg_mem = NULL; - connection->peek_msg = NULL; - } - else - memcpy(connection->peek_msg, buf, *recvd); - } - if (*recvd < 1 && len) - return FALSE; - return TRUE; + connection->peek_len = 0; + } + } + + read = pSSL_read(connection->ssl_s, (BYTE*)buf+peek_read, len-peek_read); + + if(flags & MSG_PEEK) { + if(connection->peek_msg) + connection->peek_msg = HeapReAlloc(GetProcessHeap(), 0, connection->peek_msg, + connection->peek_len+read); + else + connection->peek_msg = HeapAlloc(GetProcessHeap(), 0, read); + memcpy(connection->peek_msg+connection->peek_len, (BYTE*)buf+peek_read, read); + connection->peek_len += read; + } + + *recvd = read + peek_read; + return *recvd > 0 || !len; #else return FALSE; #endif
1
0
0
0
Alexandre Julliard : user32: The PackDDElParam return value is sign-extended on 64-bit.
by Alexandre Julliard
12 Jan '09
12 Jan '09
Module: wine Branch: master Commit: 9c6494a41765b0618aa4108af902f6189c1c7ad3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9c6494a41765b0618aa4108af…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 10 21:06:49 2009 +0100 user32: The PackDDElParam return value is sign-extended on 64-bit. --- dlls/user32/dde_misc.c | 2 +- dlls/user32/tests/dde.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/user32/dde_misc.c b/dlls/user32/dde_misc.c index 02c6789..2f69e84 100644 --- a/dlls/user32/dde_misc.c +++ b/dlls/user32/dde_misc.c @@ -103,7 +103,7 @@ LPARAM WINAPI PackDDElParam(UINT msg, UINT_PTR uiLo, UINT_PTR uiHi) return uiHi; default: - return MAKELPARAM(uiLo, uiHi); + return MAKELONG(uiLo, uiHi); } } diff --git a/dlls/user32/tests/dde.c b/dlls/user32/tests/dde.c index f11e0fe..0ece009 100644 --- a/dlls/user32/tests/dde.c +++ b/dlls/user32/tests/dde.c @@ -1793,7 +1793,8 @@ static void test_PackDDElParam(void) BOOL ret; lparam = PackDDElParam(WM_DDE_INITIATE, 0xcafe, 0xbeef); - ok(lparam == 0xbeefcafe, "Expected 0xbeefcafe, got %08lx\n", lparam); + /* value gets sign-extended despite being an LPARAM */ + ok(lparam == (int)0xbeefcafe, "Expected 0xbeefcafe, got %08lx\n", lparam); ok(GlobalLock((HGLOBAL)lparam) == NULL, "Expected NULL, got %p\n", GlobalLock((HGLOBAL)lparam)); ok(GetLastError() == ERROR_INVALID_HANDLE, @@ -1809,7 +1810,7 @@ static void test_PackDDElParam(void) ok(ret == TRUE, "Expected TRUE, got %d\n", ret); lparam = PackDDElParam(WM_DDE_TERMINATE, 0xcafe, 0xbeef); - ok(lparam == 0xbeefcafe, "Expected 0xbeefcafe, got %08lx\n", lparam); + ok(lparam == (int)0xbeefcafe, "Expected 0xbeefcafe, got %08lx\n", lparam); ok(GlobalLock((HGLOBAL)lparam) == NULL, "Expected NULL, got %p\n", GlobalLock((HGLOBAL)lparam)); ok(GetLastError() == ERROR_INVALID_HANDLE, @@ -1853,7 +1854,7 @@ static void test_PackDDElParam(void) "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); lparam = PackDDElParam(WM_DDE_UNADVISE, 0xcafe, 0xbeef); - ok(lparam == 0xbeefcafe, "Expected 0xbeefcafe, got %08lx\n", lparam); + ok(lparam == (int)0xbeefcafe, "Expected 0xbeefcafe, got %08lx\n", lparam); ok(GlobalLock((HGLOBAL)lparam) == NULL, "Expected NULL, got %p\n", GlobalLock((HGLOBAL)lparam)); ok(GetLastError() == ERROR_INVALID_HANDLE, @@ -1870,7 +1871,7 @@ static void test_PackDDElParam(void) lparam = PackDDElParam(WM_DDE_ACK, 0xcafe, 0xbeef); /* win9x returns the input (0xbeef<<16 | 0xcafe) here */ - if (lparam != 0xbeefcafe) { + if (lparam != (int)0xbeefcafe) { ptr = GlobalLock((HGLOBAL)lparam); ok(ptr != NULL, "Expected non-NULL ptr\n"); ok(ptr[0] == 0xcafe, "Expected 0xcafe, got %08lx\n", ptr[0]); @@ -1925,7 +1926,7 @@ static void test_PackDDElParam(void) "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); lparam = PackDDElParam(WM_DDE_REQUEST, 0xcafe, 0xbeef); - ok(lparam == 0xbeefcafe, "Expected 0xbeefcafe, got %08lx\n", lparam); + ok(lparam == (int)0xbeefcafe, "Expected 0xbeefcafe, got %08lx\n", lparam); ok(GlobalLock((HGLOBAL)lparam) == NULL, "Expected NULL, got %p\n", GlobalLock((HGLOBAL)lparam)); ok(GetLastError() == ERROR_INVALID_HANDLE,
1
0
0
0
Alexandre Julliard : user32: Winproc handles do not get sign-extended on 64-bit.
by Alexandre Julliard
12 Jan '09
12 Jan '09
Module: wine Branch: master Commit: 9cc75a5b50710e44ac12ddb41a140b46a8350eed URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9cc75a5b50710e44ac12ddb41…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 10 21:06:32 2009 +0100 user32: Winproc handles do not get sign-extended on 64-bit. --- dlls/user32/tests/class.c | 2 +- dlls/user32/winproc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c index ce6d020..7e596f0 100644 --- a/dlls/user32/tests/class.c +++ b/dlls/user32/tests/class.c @@ -39,7 +39,7 @@ static const WCHAR WC_EDITW[] = {'E','d','i','t',0}; #define NUMCLASSWORDS 4 -#define IS_WNDPROC_HANDLE(x) (((ULONG_PTR)(x) >> 16) == (~((ULONG_PTR)0) >> 16)) +#define IS_WNDPROC_HANDLE(x) (((ULONG_PTR)(x) >> 16) == (~0u >> 16)) static LRESULT WINAPI ClassTest_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index ac5ec41..dda649b 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -50,7 +50,7 @@ typedef struct tagWINDOWPROC WNDPROC procW; /* Unicode window proc */ } WINDOWPROC; -#define WINPROC_HANDLE (~0UL >> 16) +#define WINPROC_HANDLE (~0u >> 16) #define MAX_WINPROCS 8192 #define BUILTIN_WINPROCS 9 /* first BUILTIN_WINPROCS entries are reserved for builtin procs */ #define MAX_WINPROC_RECURSION 64
1
0
0
0
Alexandre Julliard : ole32/tests: Fix marshalling data layout for Win64.
by Alexandre Julliard
12 Jan '09
12 Jan '09
Module: wine Branch: master Commit: 8377b2464b25085ddd57f3c00556ef5a20a57f3c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8377b2464b25085ddd57f3c00…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 10 21:06:09 2009 +0100 ole32/tests: Fix marshalling data layout for Win64. --- dlls/ole32/tests/marshal.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c index 9dc7632..ddac36f 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -2056,15 +2056,18 @@ static void test_freethreadedmarshaldata(IStream *pStream, MSHCTX mshctx, void * if (mshctx == MSHCTX_INPROC) { - DWORD expected_size = sizeof(DWORD) + sizeof(void *) + sizeof(DWORD) + sizeof(GUID); + DWORD expected_size = 3*sizeof(DWORD) + sizeof(GUID); ok(size == expected_size, "size should have been %d instead of %d\n", expected_size, size); ok(*(DWORD *)marshal_data == mshlflags, "expected 0x%x, but got 0x%x for mshctx\n", mshlflags, *(DWORD *)marshal_data); marshal_data += sizeof(DWORD); ok(*(void **)marshal_data == ptr, "expected %p, but got %p for mshctx\n", ptr, *(void **)marshal_data); marshal_data += sizeof(void *); - ok(*(DWORD *)marshal_data == 0, "expected 0x0, but got 0x%x\n", *(DWORD *)marshal_data); - marshal_data += sizeof(DWORD); + if (sizeof(void*) == 4) + { + ok(*(DWORD *)marshal_data == 0, "expected 0x0, but got 0x%x\n", *(DWORD *)marshal_data); + marshal_data += sizeof(DWORD); + } trace("got guid data: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n", ((GUID *)marshal_data)->Data1, ((GUID *)marshal_data)->Data2, ((GUID *)marshal_data)->Data3, ((GUID *)marshal_data)->Data4[0], ((GUID *)marshal_data)->Data4[1], ((GUID *)marshal_data)->Data4[2], ((GUID *)marshal_data)->Data4[3],
1
0
0
0
Alexandre Julliard : gdi32/tests: Fix an uninitialized value check and a structure size for Win64.
by Alexandre Julliard
12 Jan '09
12 Jan '09
Module: wine Branch: master Commit: ac543e5bc78a3535575969d8c6e42898a9804919 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ac543e5bc78a3535575969d8c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 10 21:05:52 2009 +0100 gdi32/tests: Fix an uninitialized value check and a structure size for Win64. --- dlls/gdi32/tests/pen.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/gdi32/tests/pen.c b/dlls/gdi32/tests/pen.c index 64304fa..2948467 100644 --- a/dlls/gdi32/tests/pen.c +++ b/dlls/gdi32/tests/pen.c @@ -61,6 +61,7 @@ static void test_logpen(void) LOGPEN lp; EXTLOGPEN elp; LOGBRUSH lb; + DWORD_PTR unset_hatch; DWORD obj_type, user_style[2] = { 0xabc, 0xdef }; struct { @@ -118,7 +119,7 @@ static void test_logpen(void) /* see how larger buffer sizes are handled */ memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(lp) * 2, &lp); + size = GetObject(hpen, sizeof(lp) * 4, &lp); ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); /* see how larger buffer sizes are handled */ @@ -258,11 +259,12 @@ static void test_logpen(void) /* for PS_NULL it also works this way */ memset(&elp, 0xb0, sizeof(elp)); + memset(&unset_hatch, 0xb0, sizeof(unset_hatch)); SetLastError(0xdeadbeef); size = GetObject(hpen, sizeof(elp), &elp); ok(size == sizeof(EXTLOGPEN), "GetObject returned %d, error %d\n", size, GetLastError()); - ok(ext_pen.elp.elpHatch == 0xb0b0b0b0, "expected 0xb0b0b0b0, got %p\n", (void *)ext_pen.elp.elpHatch); + ok(ext_pen.elp.elpHatch == unset_hatch, "expected 0xb0b0b0b0, got %p\n", (void *)ext_pen.elp.elpHatch); ok(ext_pen.elp.elpNumEntries == 0xb0b0b0b0, "expected 0xb0b0b0b0, got %x\n", ext_pen.elp.elpNumEntries); break; @@ -542,7 +544,7 @@ static void test_ps_userstyle(void) ok(pen != 0, "ExtCreatePen should not fail\n"); size = GetObject(pen, sizeof(ext_pen), &ext_pen); - expect(88, size); + expect(FIELD_OFFSET(EXTLOGPEN,elpStyleEntry[16]), size); for(i = 0; i < 16; i++) expect(style[i], ext_pen.elp.elpStyleEntry[i]);
1
0
0
0
Alexandre Julliard : comctl32/tests: Fix lparam checks in the treeview test for Win64.
by Alexandre Julliard
12 Jan '09
12 Jan '09
Module: wine Branch: master Commit: 76a2fe5cf771125d23b904724076226537a2c671 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=76a2fe5cf771125d23b904724…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 10 21:05:32 2009 +0100 comctl32/tests: Fix lparam checks in the treeview test for Win64. --- dlls/comctl32/tests/treeview.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index d0157d4..5e2746c 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -111,7 +111,7 @@ static const struct message TestGetSetBkColorSeq[] = { { TVM_GETBKCOLOR, sent|wparam|lparam, 0x00000000, 0x00000000 }, { TVM_SETBKCOLOR, sent|wparam|lparam, 0x00000000, 0x00ffffff }, { TVM_GETBKCOLOR, sent|wparam|lparam, 0x00000000, 0x00000000 }, - { TVM_SETBKCOLOR, sent|wparam|lparam, 0x00000000, 0xffffffff }, + { TVM_SETBKCOLOR, sent|wparam|lparam, 0x00000000, -1 }, { 0 } }; @@ -146,7 +146,7 @@ static const struct message TestGetSetItemSeq[] = { static const struct message TestGetSetItemHeightSeq[] = { { TVM_GETITEMHEIGHT, sent|wparam|lparam, 0x00000000, 0x00000000 }, - { TVM_SETITEMHEIGHT, sent|wparam|lparam, 0xffffffff, 0x00000000 }, + { TVM_SETITEMHEIGHT, sent|wparam|lparam, -1, 0x00000000 }, { TVM_GETITEMHEIGHT, sent|wparam|lparam, 0x00000000, 0x00000000 }, { TVM_SETITEMHEIGHT, sent|lparam, 0xcccccccc, 0x00000000 }, { TVM_GETITEMHEIGHT, sent|wparam|lparam|optional, 0x00000000, 0x00000000 }, @@ -171,7 +171,7 @@ static const struct message TestGetSetTextColorSeq[] = { { TVM_GETTEXTCOLOR, sent|wparam|lparam, 0x00000000, 0x00000000 }, { TVM_SETTEXTCOLOR, sent|wparam|lparam, 0x00000000, 0x00ffffff }, { TVM_GETTEXTCOLOR, sent|wparam|lparam, 0x00000000, 0x00000000 }, - { TVM_SETTEXTCOLOR, sent|wparam|lparam, 0x00000000, 0xffffffff }, + { TVM_SETTEXTCOLOR, sent|wparam|lparam, 0x00000000, -1 }, { 0 } };
1
0
0
0
Alexandre Julliard : comctl32: Fix the COMBOBOXEXITEM structure and the treeview handles for Win64.
by Alexandre Julliard
12 Jan '09
12 Jan '09
Module: wine Branch: master Commit: de375d7335f6706563413857c9840c00e35965c8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=de375d7335f6706563413857c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Sat Jan 10 21:05:17 2009 +0100 comctl32: Fix the COMBOBOXEXITEM structure and the treeview handles for Win64. --- dlls/comctl32/comboex.c | 41 +++++++++++++++++++++-------------------- include/commctrl.h | 12 ++++++------ 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 0f55f4e..2f95b1a 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -164,7 +164,7 @@ static void COMBOEX_DumpItem (CBE_ITEMDATA const *item) static void COMBOEX_DumpInput (COMBOBOXEXITEMW const *input) { - TRACE("input - mask=%08x, iItem=%d, pszText=%p, cchTM=%d, iImage=%d\n", + TRACE("input - mask=%08x, iItem=%ld, pszText=%p, cchTM=%d, iImage=%d\n", input->mask, input->iItem, input->pszText, input->cchTextMax, input->iImage); if (input->mask & CBEIF_TEXT) @@ -467,7 +467,7 @@ static void COMBOEX_SetEditText (COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item) } -static CBE_ITEMDATA * COMBOEX_FindItem(COMBOEX_INFO *infoPtr, INT index) +static CBE_ITEMDATA * COMBOEX_FindItem(COMBOEX_INFO *infoPtr, INT_PTR index) { CBE_ITEMDATA *item; INT i; @@ -500,7 +500,7 @@ static inline BOOL COMBOEX_HasEdit(COMBOEX_INFO const *infoPtr) /* *** CBEM_xxx message support *** */ -static UINT COMBOEX_GetListboxText(COMBOEX_INFO *infoPtr, int n, LPWSTR buf) +static UINT COMBOEX_GetListboxText(COMBOEX_INFO *infoPtr, INT_PTR n, LPWSTR buf) { CBE_ITEMDATA *item; LPCWSTR str; @@ -527,9 +527,9 @@ static UINT COMBOEX_GetListboxText(COMBOEX_INFO *infoPtr, int n, LPWSTR buf) } -static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT index) +static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT_PTR index) { - TRACE("(index=%d)\n", index); + TRACE("(index=%ld)\n", index); /* if item number requested does not exist then return failure */ if ((index >= infoPtr->nb_items) || (index < 0)) return CB_ERR; @@ -544,7 +544,7 @@ static INT COMBOEX_DeleteItem (COMBOEX_INFO *infoPtr, INT index) static BOOL COMBOEX_GetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) { - INT index = cit->iItem; + INT_PTR index = cit->iItem; CBE_ITEMDATA *item; TRACE("(...)\n"); @@ -607,7 +607,7 @@ static inline BOOL COMBOEX_HasEditChanged (COMBOEX_INFO const *infoPtr) static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *cit) { - INT index; + INT_PTR index; CBE_ITEMDATA *item; NMCOMBOBOXEXW nmcit; @@ -765,7 +765,7 @@ static HIMAGELIST COMBOEX_SetImageList (COMBOEX_INFO *infoPtr, HIMAGELIST himl) static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) { - INT index = cit->iItem; + INT_PTR index = cit->iItem; CBE_ITEMDATA *item; if (TRACE_ON(comboex)) COMBOEX_DumpInput (cit); @@ -870,7 +870,7 @@ COMBOEX_FindStringExact (COMBOEX_INFO *infoPtr, INT start, LPCWSTR str) } -static DWORD_PTR COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT index) +static DWORD_PTR COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT_PTR index) { CBE_ITEMDATA const *item1; CBE_ITEMDATA const *item2; @@ -893,7 +893,7 @@ static DWORD_PTR COMBOEX_GetItemData (COMBOEX_INFO *infoPtr, INT index) } -static INT COMBOEX_SetCursel (COMBOEX_INFO *infoPtr, INT index) +static INT COMBOEX_SetCursel (COMBOEX_INFO *infoPtr, INT_PTR index) { CBE_ITEMDATA *item; INT sel; @@ -901,7 +901,7 @@ static INT COMBOEX_SetCursel (COMBOEX_INFO *infoPtr, INT index) if (!(item = COMBOEX_FindItem(infoPtr, index))) return SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL, index, 0); - TRACE("selecting item %d text=%s\n", index, debugstr_txt(item->pszText)); + TRACE("selecting item %ld text=%s\n", index, debugstr_txt(item->pszText)); infoPtr->selected = index; sel = (INT)SendMessageW (infoPtr->hwndCombo, CB_SETCURSEL, index, 0); @@ -910,7 +910,7 @@ static INT COMBOEX_SetCursel (COMBOEX_INFO *infoPtr, INT index) } -static DWORD_PTR COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT index, DWORD_PTR data) +static DWORD_PTR COMBOEX_SetItemData (COMBOEX_INFO *infoPtr, INT_PTR index, DWORD_PTR data) { CBE_ITEMDATA *item1; CBE_ITEMDATA const *item2; @@ -1124,7 +1124,8 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam) INT command = HIWORD(wParam); CBE_ITEMDATA *item = 0; WCHAR wintext[520]; - INT cursel, n, oldItem; + INT cursel, n; + INT_PTR oldItem; NMCBEENDEDITW cbeend; DWORD oldflags; HWND parent = infoPtr->hwndNotify; @@ -1224,7 +1225,7 @@ static LRESULT COMBOEX_Command (COMBOEX_INFO *infoPtr, WPARAM wParam) */ oldItem = SendMessageW (infoPtr->hwndCombo, CB_GETCURSEL, 0, 0); if (!(item = COMBOEX_FindItem(infoPtr, oldItem))) { - ERR("item %d not found. Problem!\n", oldItem); + ERR("item %ld not found. Problem!\n", oldItem); break; } infoPtr->selected = oldItem; @@ -1750,7 +1751,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) hwnd, uMsg, wParam, lParam); case WM_KEYDOWN: { - INT oldItem, selected, step = 1; + INT_PTR oldItem, selected, step = 1; CBE_ITEMDATA *item; switch ((INT)wParam) @@ -1787,7 +1788,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) oldItem = SendMessageW (infoPtr->hwndCombo, CB_GETCURSEL, 0, 0); InvalidateRect (infoPtr->hwndCombo, 0, 0); if (!(item = COMBOEX_FindItem(infoPtr, oldItem))) { - ERR("item %d not found. Problem!\n", oldItem); + ERR("item %ld not found. Problem!\n", oldItem); break; } infoPtr->selected = oldItem; @@ -1829,7 +1830,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (selected != -1) { cmp_func_t cmptext = get_cmp_func(infoPtr); item = COMBOEX_FindItem (infoPtr, selected); - TRACE("handling VK_RETURN, selected = %d, selected_text=%s\n", + TRACE("handling VK_RETURN, selected = %ld, selected_text=%s\n", selected, debugstr_txt(item->pszText)); TRACE("handling VK_RETURN, edittext=%s\n", debugstr_w(edit_text)); @@ -2079,8 +2080,8 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) LPCWSTR lastwrk; cmp_func_t cmptext = get_cmp_func(infoPtr); - INT selected = SendMessageW (infoPtr->hwndCombo, - CB_GETCURSEL, 0, 0); + INT_PTR selected = SendMessageW (infoPtr->hwndCombo, + CB_GETCURSEL, 0, 0); /* lstrlenW( lastworkingURL ) */ @@ -2093,7 +2094,7 @@ COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) lastwrk = COMBOEX_GetText(infoPtr, item); } - TRACE("handling EN_CHANGE, selected = %d, selected_text=%s\n", + TRACE("handling EN_CHANGE, selected = %ld, selected_text=%s\n", selected, debugstr_w(lastwrk)); TRACE("handling EN_CHANGE, edittext=%s\n", debugstr_w(edit_text)); diff --git a/include/commctrl.h b/include/commctrl.h index 9f68edd..426d70a 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -2381,10 +2381,10 @@ static const WCHAR WC_TREEVIEWW[] = { 'S','y','s', #define TVIF_INTEGRAL 0x0080 #define TVIF_DI_SETITEM 0x1000 -#define TVI_ROOT ((HTREEITEM)0xffff0000) /* -65536 */ -#define TVI_FIRST ((HTREEITEM)0xffff0001) /* -65535 */ -#define TVI_LAST ((HTREEITEM)0xffff0002) /* -65534 */ -#define TVI_SORT ((HTREEITEM)0xffff0003) /* -65533 */ +#define TVI_ROOT ((HTREEITEM)-65536) +#define TVI_FIRST ((HTREEITEM)-65535) +#define TVI_LAST ((HTREEITEM)-65534) +#define TVI_SORT ((HTREEITEM)-65533) #define TVIS_FOCUSED 0x0001 #define TVIS_SELECTED 0x0002 @@ -4244,7 +4244,7 @@ static const WCHAR WC_COMBOBOXEXW[] = { 'C','o','m','b','o', typedef struct tagCOMBOBOXEXITEMA { UINT mask; - int iItem; + INT_PTR iItem; LPSTR pszText; int cchTextMax; int iImage; @@ -4258,7 +4258,7 @@ typedef COMBOBOXEXITEMA const *PCCOMBOEXITEMA; /* Yes, there's a BOX missing */ typedef struct tagCOMBOBOXEXITEMW { UINT mask; - int iItem; + INT_PTR iItem; LPWSTR pszText; int cchTextMax; int iImage;
1
0
0
0
← Newer
1
...
83
84
85
86
87
88
89
...
135
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
Results per page:
10
25
50
100
200