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
Dmitry Timoshkov : wineconsole: Make some data const.
by Alexandre Julliard
10 Jan '07
10 Jan '07
Module: wine Branch: master Commit: 9e357cd78100218bf012ee1876457a26b6325c13 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9e357cd78100218bf012ee187…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Wed Jan 10 15:27:24 2007 +0800 wineconsole: Make some data const. --- programs/wineconsole/curses.c | 8 ++++---- programs/wineconsole/user.c | 2 +- programs/wineconsole/winecon_user.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/programs/wineconsole/curses.c b/programs/wineconsole/curses.c index 692cec2..fcda4ec 100644 --- a/programs/wineconsole/curses.c +++ b/programs/wineconsole/curses.c @@ -130,9 +130,9 @@ MAKE_FUNCPTR(mousemask) static BOOL WCCURSES_bind_libcurses(void) { #ifdef HAVE_NCURSES_H - static const char *ncname = SONAME_LIBNCURSES; + static const char ncname[] = SONAME_LIBNCURSES; #else - static const char *ncname = SONAME_LIBCURSES; + static const char ncname[] = SONAME_LIBCURSES; #endif nc_handle = wine_dlopen(ncname, RTLD_NOW, NULL, 0); @@ -434,7 +434,7 @@ static void WCCURSES_ScrollV(struct inne } /* Ascii -> VK, generated by calling VkKeyScanA(i) */ -static int vkkeyscan_table[256] = +static const int vkkeyscan_table[256] = { 0,0,0,0,0,0,0,0,8,9,0,0,0,13,0,0,0,0,0,19,145,556,0,0,0,0,0,27,0,0,0, 0,32,305,478,307,308,309,311,222,313,304,312,443,188,189,190,191,48, @@ -448,7 +448,7 @@ static int vkkeyscan_table[256] = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,400,0,0,0,0,0,0 }; -static int mapvkey_0[256] = +static const int mapvkey_0[256] = { 0,0,0,0,0,0,0,0,14,15,0,0,0,28,0,0,42,29,56,69,58,0,0,0,0,0,0,1,0,0, 0,0,57,73,81,79,71,75,72,77,80,0,0,0,55,82,83,0,11,2,3,4,5,6,7,8,9, diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c index 4249e1f..d597a1e 100644 --- a/programs/wineconsole/user.c +++ b/programs/wineconsole/user.c @@ -31,7 +31,7 @@ WINE_DECLARE_DEBUG_CHANNEL(wc_font); UINT g_uiDefaultCharset; /* mapping console colors to RGB values */ -COLORREF WCUSER_ColorMap[16] = +const COLORREF WCUSER_ColorMap[16] = { RGB(0x00, 0x00, 0x00), RGB(0x00, 0x00, 0x80), RGB(0x00, 0x80, 0x00), RGB(0x00, 0x80, 0x80), RGB(0x80, 0x00, 0x00), RGB(0x80, 0x00, 0x80), RGB(0x80, 0x80, 0x00), RGB(0x80, 0x80, 0x80), diff --git a/programs/wineconsole/winecon_user.h b/programs/wineconsole/winecon_user.h index aa86338..e6e2507 100644 --- a/programs/wineconsole/winecon_user.h +++ b/programs/wineconsole/winecon_user.h @@ -44,7 +44,7 @@ struct inner_data_user { #define PRIVATE(data) ((struct inner_data_user*)((data)->private)) /* from user.c */ -extern COLORREF WCUSER_ColorMap[16]; +extern const COLORREF WCUSER_ColorMap[16]; extern BOOL WCUSER_GetProperties(struct inner_data*, BOOL); extern BOOL WCUSER_ValidateFont(const struct inner_data* data, const LOGFONT* lf); extern BOOL WCUSER_ValidateFontMetric(const struct inner_data* data,
1
0
0
0
Vitaliy Margolen : dinput: Pass complete DataFormat structure to find_property.
by Alexandre Julliard
10 Jan '07
10 Jan '07
Module: wine Branch: master Commit: cd306046bb94c69a78433749facbacd86817bec1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cd306046bb94c69a78433749f…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Tue Jan 9 13:43:36 2007 -0700 dinput: Pass complete DataFormat structure to find_property. --- dlls/dinput/device.c | 6 +++--- dlls/dinput/device_private.h | 2 +- dlls/dinput/joystick_linux.c | 24 +++++++++++++++--------- dlls/dinput/joystick_linuxinput.c | 9 ++++++--- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 34a721d..edf8350 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -518,12 +518,12 @@ int id_to_offset(DataFormat *df, int id) return obj >= 0 && df->offsets ? df->offsets[obj] : -1; } -int find_property(LPCDIDATAFORMAT df, LPCDIPROPHEADER ph) +int find_property(DataFormat *df, LPCDIPROPHEADER ph) { switch (ph->dwHow) { - case DIPH_BYID: return id_to_object(df, ph->dwObj); - case DIPH_BYOFFSET: return offset_to_object(df, ph->dwObj); + case DIPH_BYID: return id_to_object(df->user_df, ph->dwObj); + case DIPH_BYOFFSET: return offset_to_object(df->user_df, ph->dwObj); } FIXME("Unhandled ph->dwHow=='%04X'\n", (unsigned int)ph->dwHow); diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index 638661a..e541b86 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -75,7 +75,7 @@ extern void queue_event(LPDIRECTINPUTDEV /* Helper functions to work with data format */ extern int offset_to_object(LPCDIDATAFORMAT df, int offset); extern int id_to_offset(DataFormat *df, int id); -extern int find_property(LPCDIDATAFORMAT df, LPCDIPROPHEADER ph); +extern int find_property(DataFormat *df, LPCDIPROPHEADER ph); /** * Callback Data used by specific callback diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index a5d6aad..91ee183 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -909,7 +909,8 @@ static HRESULT WINAPI JoystickAImpl_SetP This->props[i].lMax = pr->lMax; } } else { - int obj = find_property(This->base.data_format.user_df, ph); + int obj = find_property(&This->base.data_format, ph); + TRACE("proprange(%d,%d) obj=%d\n", pr->lMin, pr->lMax, obj); if (obj >= 0) { This->props[obj].lMin = pr->lMin; @@ -926,7 +927,8 @@ static HRESULT WINAPI JoystickAImpl_SetP for (i = 0; i < This->base.data_format.user_df->dwNumObjs; i++) This->props[i].lDeadZone = pd->dwData; } else { - int obj = find_property(This->base.data_format.user_df, ph); + int obj = find_property(&This->base.data_format, ph); + TRACE("deadzone(%d) obj=%d\n", pd->dwData, obj); if (obj >= 0) { This->props[obj].lDeadZone = pd->dwData; @@ -942,7 +944,8 @@ static HRESULT WINAPI JoystickAImpl_SetP for (i = 0; i < This->base.data_format.user_df->dwNumObjs; i++) This->props[i].lSaturation = pd->dwData; } else { - int obj = find_property(This->base.data_format.user_df, ph); + int obj = find_property(&This->base.data_format, ph); + TRACE("saturation(%d) obj=%d\n", pd->dwData, obj); if (obj >= 0) { This->props[obj].lSaturation = pd->dwData; @@ -1171,8 +1174,9 @@ static HRESULT WINAPI JoystickAImpl_GetP if (!HIWORD(rguid)) { switch (LOWORD(rguid)) { case (DWORD) DIPROP_RANGE: { - LPDIPROPRANGE pr = (LPDIPROPRANGE) pdiph; - int obj = find_property(This->base.data_format.user_df, pdiph); + LPDIPROPRANGE pr = (LPDIPROPRANGE)pdiph; + int obj = find_property(&This->base.data_format, pdiph); + /* The app is querying the current range of the axis * return the lMin and lMax values */ if (obj >= 0) { @@ -1184,8 +1188,9 @@ static HRESULT WINAPI JoystickAImpl_GetP break; } case (DWORD) DIPROP_DEADZONE: { - LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph; - int obj = find_property(This->base.data_format.user_df, pdiph); + LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph; + int obj = find_property(&This->base.data_format, pdiph); + if (obj >= 0) { pd->dwData = This->props[obj].lDeadZone; TRACE("deadzone(%d) obj=%d\n", pd->dwData, obj); @@ -1194,8 +1199,9 @@ static HRESULT WINAPI JoystickAImpl_GetP break; } case (DWORD) DIPROP_SATURATION: { - LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph; - int obj = find_property(This->base.data_format.user_df, pdiph); + LPDIPROPDWORD pd = (LPDIPROPDWORD)pdiph; + int obj = find_property(&This->base.data_format, pdiph); + if (obj >= 0) { pd->dwData = This->props[obj].lSaturation; TRACE("saturation(%d) obj=%d\n", pd->dwData, obj); diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index b049730..b9c581d 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -849,7 +849,8 @@ static HRESULT WINAPI JoystickAImpl_SetP This->wantmax[i] = pr->lMax; } } else { - int obj = find_property(This->base.data_format.user_df, ph); + int obj = find_property(&This->base.data_format, ph); + TRACE("proprange(%d,%d) obj=%d\n", pr->lMin, pr->lMax, obj); if (obj >= 0) { This->wantmin[obj] = pr->lMin; @@ -868,7 +869,8 @@ static HRESULT WINAPI JoystickAImpl_SetP This->deadz[i] = pd->dwData; } } else { - int obj = find_property(This->base.data_format.user_df, ph); + int obj = find_property(&This->base.data_format, ph); + TRACE("deadzone(%d) obj=%d\n", pd->dwData, obj); if (obj >= 0) { This->deadz[obj] = pd->dwData; @@ -1127,7 +1129,8 @@ static HRESULT WINAPI JoystickAImpl_GetP switch (LOWORD(rguid)) { case (DWORD) DIPROP_RANGE: { LPDIPROPRANGE pr = (LPDIPROPRANGE) pdiph; - int obj = find_property(This->base.data_format.user_df, pdiph); + int obj = find_property(&This->base.data_format, pdiph); + if (obj >= 0) { pr->lMin = This->joydev->havemin[obj]; pr->lMax = This->joydev->havemax[obj];
1
0
0
0
Vitaliy Margolen : dinput: Remove duplicate Keyboard-> Poll it is the same as base class.
by Alexandre Julliard
10 Jan '07
10 Jan '07
Module: wine Branch: master Commit: af71538d3343a1cec73e75391a7ebfd5b3ed94ee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af71538d3343a1cec73e75391…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Tue Jan 9 13:36:59 2007 -0700 dinput: Remove duplicate Keyboard->Poll it is the same as base class. --- dlls/dinput/keyboard.c | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-) diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index 08c6cd8..dcdcca3 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -483,16 +483,6 @@ static HRESULT WINAPI SysKeyboardWImpl_G return DI_OK; } -static HRESULT WINAPI SysKeyboardAImpl_Poll(LPDIRECTINPUTDEVICE8A iface) -{ - SysKeyboardImpl *This = (SysKeyboardImpl *)iface; - - TRACE("(%p)\n",This); - - if (!This->base.acquired) return DIERR_NOTACQUIRED; - return DI_NOEFFECT; -} - static const IDirectInputDevice8AVtbl SysKeyboardAvt = { IDirectInputDevice2AImpl_QueryInterface, @@ -520,7 +510,7 @@ static const IDirectInputDevice8AVtbl Sy IDirectInputDevice2AImpl_SendForceFeedbackCommand, IDirectInputDevice2AImpl_EnumCreatedEffectObjects, IDirectInputDevice2AImpl_Escape, - SysKeyboardAImpl_Poll, + IDirectInputDevice2AImpl_Poll, IDirectInputDevice2AImpl_SendDeviceData, IDirectInputDevice7AImpl_EnumEffectsInFile, IDirectInputDevice7AImpl_WriteEffectToFile, @@ -562,7 +552,7 @@ static const IDirectInputDevice8WVtbl Sy XCAST(SendForceFeedbackCommand)IDirectInputDevice2AImpl_SendForceFeedbackCommand, XCAST(EnumCreatedEffectObjects)IDirectInputDevice2AImpl_EnumCreatedEffectObjects, XCAST(Escape)IDirectInputDevice2AImpl_Escape, - XCAST(Poll)SysKeyboardAImpl_Poll, + XCAST(Poll)IDirectInputDevice2AImpl_Poll, XCAST(SendDeviceData)IDirectInputDevice2AImpl_SendDeviceData, IDirectInputDevice7WImpl_EnumEffectsInFile, IDirectInputDevice7WImpl_WriteEffectToFile,
1
0
0
0
Vitaliy Margolen : dinput: Fix trace formatting.
by Alexandre Julliard
10 Jan '07
10 Jan '07
Module: wine Branch: master Commit: adddc566994c3af051b502e41447e05267a2dbaf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=adddc566994c3af051b502e41…
Author: Vitaliy Margolen <wine-patches(a)kievinfo.com> Date: Tue Jan 9 13:36:36 2007 -0700 dinput: Fix trace formatting. --- dlls/dinput/mouse.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index dc330d9..79e65d9 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -367,7 +367,7 @@ static LRESULT CALLBACK dinput_mouse_hoo { int i; - TRACE("msg %x @ (%d %d): (X: %d Y: %d Z: %d\n", wparam, hook->pt.x, hook->pt.y, + TRACE("msg %x @ (%d %d): (X: %d Y: %d Z: %d", wparam, hook->pt.x, hook->pt.y, This->m_state.lX, This->m_state.lY, This->m_state.lZ); for (i = 0; i < 5; i++) TRACE(" B%d: %02x", i, This->m_state.rgbButtons[i]); TRACE(")\n");
1
0
0
0
Rob Shearman : ole32: Fix the detection of when we need an additional QueryInterface in CoUnmarshalInterface .
by Alexandre Julliard
10 Jan '07
10 Jan '07
Module: wine Branch: master Commit: f658adffc2e0bcb8e103152fdc2d92a13996ddcc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f658adffc2e0bcb8e103152fd…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Tue Jan 9 17:18:03 2007 +0000 ole32: Fix the detection of when we need an additional QueryInterface in CoUnmarshalInterface. --- dlls/ole32/marshal.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c index 3708f50..5b2d5b2 100644 --- a/dlls/ole32/marshal.c +++ b/dlls/ole32/marshal.c @@ -1671,16 +1671,13 @@ HRESULT WINAPI CoUnmarshalInterface(IStr if (hr) ERR("IMarshal::UnmarshalInterface failed, 0x%08x\n", hr); - /* IID_NULL means use the interface ID of the marshaled object */ - if (!IsEqualIID(riid, &IID_NULL)) - iid = *riid; - if (hr == S_OK) { - if (!IsEqualIID(riid, &iid)) + /* IID_NULL means use the interface ID of the marshaled object */ + if (!IsEqualIID(riid, &IID_NULL) && !IsEqualIID(riid, &iid)) { TRACE("requested interface != marshalled interface, additional QI needed\n"); - hr = IUnknown_QueryInterface(object, &iid, ppv); + hr = IUnknown_QueryInterface(object, riid, ppv); if (hr) ERR("Couldn't query for interface %s, hr = 0x%08x\n", debugstr_guid(riid), hr);
1
0
0
0
Rob Shearman : ole32: Add a test for the failure case of same-apartment unmarshaling when passing in an unsupported iid .
by Alexandre Julliard
10 Jan '07
10 Jan '07
Module: wine Branch: master Commit: fa64950ee1a419bbdaf5514b787585895a4b73f2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fa64950ee1a419bbdaf5514b7…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Tue Jan 9 17:18:12 2007 +0000 ole32: Add a test for the failure case of same-apartment unmarshaling when passing in an unsupported iid. --- dlls/ole32/tests/marshal.c | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/dlls/ole32/tests/marshal.c b/dlls/ole32/tests/marshal.c index 1742588..11f03df 100644 --- a/dlls/ole32/tests/marshal.c +++ b/dlls/ole32/tests/marshal.c @@ -392,6 +392,32 @@ static void test_marshal_and_unmarshal_i end_host_object(tid, thread); } +static void test_same_apartment_unmarshal_failure(void) +{ + HRESULT hr; + IStream *pStream; + IUnknown *pProxy; + static const LARGE_INTEGER llZero; + + cLocks = 0; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream); + ok_ole_success(hr, CreateStreamOnHGlobal); + + hr = CoMarshalInterface(pStream, &IID_IUnknown, (IUnknown *)&Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, CoMarshalInterface); + + ok_more_than_one_lock(); + + hr = IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL); + ok_ole_success(hr, IStream_Seek); + + hr = CoUnmarshalInterface(pStream, &IID_IParseDisplayName, (void **)&pProxy); + ok(hr == E_NOINTERFACE, "CoUnmarshalInterface should have returned E_NOINTERFACE instead of 0x%08x\n", hr); + + ok_no_locks(); +} + /* tests success case of an interthread marshal */ static void test_interthread_marshal_and_unmarshal(void) { @@ -2388,6 +2414,7 @@ START_TEST(marshal) test_normal_marshal_and_release(); test_normal_marshal_and_unmarshal(); test_marshal_and_unmarshal_invalid(); + test_same_apartment_unmarshal_failure(); test_interthread_marshal_and_unmarshal(); test_proxy_marshal_and_unmarshal(); test_proxy_marshal_and_unmarshal2();
1
0
0
0
Rob Shearman : ole32: Add tests for passing invalid arguments to CoUnmarshalInterface.
by Alexandre Julliard
10 Jan '07
10 Jan '07
Module: wine Branch: master Commit: 49fc8ac742c69438da88f1e55163d3172931833f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=49fc8ac742c69438da88f1e55…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Tue Jan 9 17:17:34 2007 +0000 ole32: Add tests for passing invalid arguments to CoUnmarshalInterface. --- dlls/ole32/tests/compobj.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index cc83f83..eb9f281 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -528,6 +528,28 @@ static void test_CoGetPSClsid(void) CoUninitialize(); } +/* basic test, mainly for invalid arguments. see marshal.c for more */ +static void test_CoUnmarshalInterface(void) +{ + IUnknown *pProxy; + IStream *pStream; + HRESULT hr; + + hr = CoUnmarshalInterface(NULL, &IID_IUnknown, (void **)&pProxy); + ok(hr == E_INVALIDARG, "CoUnmarshalInterface should have returned E_INVALIDARG instead of 0x%08x\n", hr); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream); + ok_ole_success(hr, "CreateStreamOnHGlobal"); + + hr = CoUnmarshalInterface(pStream, &IID_IUnknown, (void **)&pProxy); + ok(hr == STG_E_READFAULT, "CoUnmarshalInterface should have returned STG_E_READFAULT instead of 0x%08x\n", hr); + + hr = CoUnmarshalInterface(pStream, &IID_IUnknown, NULL); + ok(hr == E_INVALIDARG, "CoUnmarshalInterface should have returned E_INVALIDARG instead of 0x%08x\n", hr); + + IStream_Release(pStream); +} + static void test_CoGetInterfaceAndReleaseStream(void) { HRESULT hr; @@ -541,6 +563,7 @@ static void test_CoGetInterfaceAndReleas CoUninitialize(); } +/* basic test, mainly for invalid arguments. see marshal.c for more */ static void test_CoMarshalInterface(void) { IStream *pStream; @@ -627,6 +650,7 @@ START_TEST(compobj) test_CoRegisterMessageFilter(); test_CoRegisterPSClsid(); test_CoGetPSClsid(); + test_CoUnmarshalInterface(); test_CoGetInterfaceAndReleaseStream(); test_CoMarshalInterface(); test_CoMarshalInterThreadInterfaceInStream();
1
0
0
0
Rob Shearman : ole32: ReadClassStm should return STG_E_READFAULT is not all of the data could be read , not S_FALSE.
by Alexandre Julliard
10 Jan '07
10 Jan '07
Module: wine Branch: master Commit: b1ee49a74d80c86feb44382e3a54c139ca2e9ecc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b1ee49a74d80c86feb44382e3…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Tue Jan 9 17:17:52 2007 +0000 ole32: ReadClassStm should return STG_E_READFAULT is not all of the data could be read, not S_FALSE. Clear pclsid in case of errors. Add tests for ReadClassStm. --- dlls/ole32/storage32.c | 5 ++++- dlls/ole32/tests/storage32.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletions(-) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 450d5cd..c575ce5 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -7930,13 +7930,16 @@ HRESULT WINAPI ReadClassStm(IStream *pSt if (!pStm || !pclsid) return E_INVALIDARG; + /* clear the output args */ + memcpy(pclsid, &CLSID_NULL, sizeof(*pclsid)); + res = IStream_Read(pStm,(void*)pclsid,sizeof(CLSID),&nbByte); if (FAILED(res)) return res; if (nbByte != sizeof(CLSID)) - return S_FALSE; + return STG_E_READFAULT; else return S_OK; } diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c index 80b6cb0..663bc30 100644 --- a/dlls/ole32/tests/storage32.c +++ b/dlls/ole32/tests/storage32.c @@ -31,6 +31,8 @@ DEFINE_GUID( test_stg_cls, 0x88888888, 0x0425, 0x0000, 0,0,0,0,0,0,0,0); +#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr) + static void test_hglobal_storage_stat(void) { ILockBytes *ilb = NULL; @@ -913,6 +915,36 @@ static void test_transact(void) ok( r == TRUE, "deleted file\n"); } +static void test_ReadClassStm(void) +{ + CLSID clsid; + HRESULT hr; + IStream *pStream; + static const LARGE_INTEGER llZero; + + hr = ReadClassStm(NULL, &clsid); + ok(hr == E_INVALIDARG, "ReadClassStm should have returned E_INVALIDARG instead of 0x%08x\n", hr); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream); + ok_ole_success(hr, "CreateStreamOnHGlobal"); + hr = WriteClassStm(pStream, &test_stg_cls); + ok_ole_success(hr, "WriteClassStm"); + + hr = ReadClassStm(pStream, NULL); + ok(hr == E_INVALIDARG, "ReadClassStm should have returned E_INVALIDARG instead of 0x%08x\n", hr); + + /* test not rewound stream */ + hr = ReadClassStm(pStream, &clsid); + ok(hr == STG_E_READFAULT, "ReadClassStm should have returned STG_E_READFAULT instead of 0x%08x\n", hr); + ok(IsEqualCLSID(&clsid, &CLSID_NULL), "clsid should have been zeroed\n"); + + hr = IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL); + ok_ole_success(hr, "IStream_Seek"); + hr = ReadClassStm(pStream, &clsid); + ok_ole_success(hr, "ReadClassStm"); + ok(IsEqualCLSID(&clsid, &test_stg_cls), "clsid should have been set to CLSID_WineTest\n"); +} + START_TEST(storage32) { test_hglobal_storage_stat(); @@ -923,4 +955,5 @@ START_TEST(storage32) test_storage_refcount(); test_streamenum(); test_transact(); + test_ReadClassStm(); }
1
0
0
0
Rob Shearman : ole32: Add tests for invalid arguments of CoMarshalInterface and CoMarshalInterThreadInterfaceInStream .
by Alexandre Julliard
10 Jan '07
10 Jan '07
Module: wine Branch: master Commit: de527d5ec0f63f7d4a3cf6eeea854b9efa276ee0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=de527d5ec0f63f7d4a3cf6eee…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Tue Jan 9 17:17:15 2007 +0000 ole32: Add tests for invalid arguments of CoMarshalInterface and CoMarshalInterThreadInterfaceInStream. --- dlls/ole32/tests/compobj.c | 149 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 146 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index d68d54a..cc83f83 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -34,6 +34,8 @@ HRESULT (WINAPI * pCoInitializeEx)(LPVOID lpReserved, DWORD dwCoInit); #define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr) +#define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %d\n", cLocks) +#define ok_no_locks() ok(cLocks == 0, "Number of locks should be 0, but actually is %d\n", cLocks) static const CLSID CLSID_non_existent = { 0x12345678, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } }; static const CLSID CLSID_CDeviceMoniker = { 0x4315d437, 0x5b8c, 0x11d0, { 0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86 } }; @@ -58,6 +60,77 @@ static const IID IID_IWineTest = {0xa1, 0xa2, 0x5d, 0x5a, 0x36, 0x54, 0xd3, 0xbd} }; /* 5201163f-8164-4fd0-a1a2-5d5a3654d3bd */ +static LONG cLocks; + +static void LockModule(void) +{ + InterlockedIncrement(&cLocks); +} + +static void UnlockModule(void) +{ + InterlockedDecrement(&cLocks); +} + +static HRESULT WINAPI Test_IClassFactory_QueryInterface( + LPCLASSFACTORY iface, + REFIID riid, + LPVOID *ppvObj) +{ + if (ppvObj == NULL) return E_POINTER; + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IClassFactory)) + { + *ppvObj = (LPVOID)iface; + IClassFactory_AddRef(iface); + return S_OK; + } + + *ppvObj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI Test_IClassFactory_AddRef(LPCLASSFACTORY iface) +{ + LockModule(); + return 2; /* non-heap-based object */ +} + +static ULONG WINAPI Test_IClassFactory_Release(LPCLASSFACTORY iface) +{ + UnlockModule(); + return 1; /* non-heap-based object */ +} + +static HRESULT WINAPI Test_IClassFactory_CreateInstance( + LPCLASSFACTORY iface, + LPUNKNOWN pUnkOuter, + REFIID riid, + LPVOID *ppvObj) +{ + *ppvObj = NULL; + if (pUnkOuter) return CLASS_E_NOAGGREGATION; + return E_NOINTERFACE; +} + +static HRESULT WINAPI Test_IClassFactory_LockServer( + LPCLASSFACTORY iface, + BOOL fLock) +{ + return S_OK; +} + +static const IClassFactoryVtbl TestClassFactory_Vtbl = +{ + Test_IClassFactory_QueryInterface, + Test_IClassFactory_AddRef, + Test_IClassFactory_Release, + Test_IClassFactory_CreateInstance, + Test_IClassFactory_LockServer +}; + +static IClassFactory Test_ClassFactory = { &TestClassFactory_Vtbl }; static void test_ProgIDFromCLSID(void) { @@ -160,7 +233,7 @@ static ATOM register_dummy_class(void) NULL, TEXT("WineOleTestClass"), }; - + return RegisterClass(&wc); } @@ -337,7 +410,7 @@ static HRESULT WINAPI PSFactoryBuffer_Qu } return E_NOINTERFACE; } - + static ULONG WINAPI PSFactoryBuffer_AddRef( IPSFactoryBuffer * This) { @@ -359,7 +432,7 @@ static HRESULT WINAPI PSFactoryBuffer_Cr { return E_NOTIMPL; } - + static HRESULT WINAPI PSFactoryBuffer_CreateStub( IPSFactoryBuffer * This, /* [in] */ REFIID riid, @@ -468,6 +541,74 @@ static void test_CoGetInterfaceAndReleas CoUninitialize(); } +static void test_CoMarshalInterface(void) +{ + IStream *pStream; + HRESULT hr; + static const LARGE_INTEGER llZero; + + pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream); + ok_ole_success(hr, "CreateStreamOnHGlobal"); + + hr = CoMarshalInterface(pStream, &IID_IUnknown, NULL, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok(hr == E_INVALIDARG, "CoMarshalInterface should have returned E_INVALIDARG instead of 0x%08x\n", hr); + + hr = CoMarshalInterface(NULL, &IID_IUnknown, (IUnknown *)&Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok(hr == E_INVALIDARG, "CoMarshalInterface should have returned E_INVALIDARG instead of 0x%08x\n", hr); + + hr = CoMarshalInterface(pStream, &IID_IUnknown, (IUnknown *)&Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); + ok_ole_success(hr, "CoMarshalInterface"); + + /* stream not rewound */ + hr = CoReleaseMarshalData(pStream); + ok(hr == STG_E_READFAULT, "CoReleaseMarshalData should have returned STG_E_READFAULT instead of 0x%08x\n", hr); + + hr = IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL); + ok_ole_success(hr, "IStream_Seek"); + + hr = CoReleaseMarshalData(pStream); + ok_ole_success(hr, "CoReleaseMarshalData"); + + IStream_Release(pStream); + + CoUninitialize(); +} + +static void test_CoMarshalInterThreadInterfaceInStream(void) +{ + IStream *pStream; + HRESULT hr; + IClassFactory *pProxy; + + pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + cLocks = 0; + + hr = CoMarshalInterThreadInterfaceInStream(&IID_IUnknown, (IUnknown *)&Test_ClassFactory, NULL); + ok(hr == E_INVALIDARG, "CoMarshalInterThreadInterfaceInStream should have returned E_INVALIDARG instead of 0x%08x\n", hr); + + hr = CoMarshalInterThreadInterfaceInStream(&IID_IUnknown, NULL, &pStream); + ok(hr == E_INVALIDARG, "CoMarshalInterThreadInterfaceInStream should have returned E_INVALIDARG instead of 0x%08x\n", hr); + + ok_no_locks(); + + hr = CoMarshalInterThreadInterfaceInStream(&IID_IUnknown, (IUnknown *)&Test_ClassFactory, &pStream); + ok_ole_success(hr, "CoMarshalInterThreadInterfaceInStream"); + + ok_more_than_one_lock(); + + hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy); + ok_ole_success(hr, "CoUnmarshalInterface"); + + IClassFactory_Release(pProxy); + + ok_no_locks(); + + CoUninitialize(); +} + START_TEST(compobj) { HMODULE hOle32 = GetModuleHandle("ole32"); @@ -487,4 +628,6 @@ START_TEST(compobj) test_CoRegisterPSClsid(); test_CoGetPSClsid(); test_CoGetInterfaceAndReleaseStream(); + test_CoMarshalInterface(); + test_CoMarshalInterThreadInterfaceInStream(); }
1
0
0
0
Rob Shearman : ole32: Return an error from CoUnmarshalInterface if pStream is NULL or if ppv is NULL .
by Alexandre Julliard
10 Jan '07
10 Jan '07
Module: wine Branch: master Commit: 7730e1408ff33dba394ff078b624e3043a557c1a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7730e1408ff33dba394ff078b…
Author: Rob Shearman <rob(a)codeweavers.com> Date: Tue Jan 9 17:17:24 2007 +0000 ole32: Return an error from CoUnmarshalInterface if pStream is NULL or if ppv is NULL. --- dlls/ole32/marshal.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c index 4294cb5..3708f50 100644 --- a/dlls/ole32/marshal.c +++ b/dlls/ole32/marshal.c @@ -1659,6 +1659,9 @@ HRESULT WINAPI CoUnmarshalInterface(IStr TRACE("(%p, %s, %p)\n", pStream, debugstr_guid(riid), ppv); + if (!pStream || !ppv) + return E_INVALIDARG; + hr = get_unmarshaler_from_stream(pStream, &pMarshal, &iid); if (hr != S_OK) return hr;
1
0
0
0
← Newer
1
...
50
51
52
53
54
55
56
...
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