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
May 2010
----- 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
955 discussions
Start a n
N
ew thread
Alexandre Julliard : winex11: Move X11 locking inside the cursor creation functions.
by Alexandre Julliard
21 May '10
21 May '10
Module: wine Branch: master Commit: 45b7eb6858f8da0721101a19a9fcd46d53c08e94 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=45b7eb6858f8da0721101a19a…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 20 14:40:06 2010 +0200 winex11: Move X11 locking inside the cursor creation functions. --- dlls/winex11.drv/mouse.c | 54 +++++++++++++++++++++++++++++++++++---------- 1 files changed, 42 insertions(+), 12 deletions(-) diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index b044182..9581945 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -176,6 +176,7 @@ static Cursor get_empty_cursor(void) static Cursor cursor; static const char data[] = { 0 }; + wine_tsx11_lock(); if (!cursor) { XColor bg; @@ -189,6 +190,7 @@ static Cursor get_empty_cursor(void) XFreePixmap( gdi_display, pixmap ); } } + wine_tsx11_unlock(); return cursor; } @@ -682,7 +684,7 @@ static Cursor create_xcursor_cursor( Display *display, CURSORICONINFO *ptr ) * * Create an X cursor from a Windows one. */ -static Cursor create_cursor( Display *display, CURSORICONINFO *ptr ) +static Cursor create_xlib_cursor( Display *display, CURSORICONINFO *ptr ) { Pixmap pixmapBits, pixmapMask, pixmapMaskInv = 0, pixmapAll; XColor fg, bg; @@ -691,12 +693,6 @@ static Cursor create_cursor( Display *display, CURSORICONINFO *ptr ) char *bitMask32 = NULL; BOOL alpha_zero = TRUE; - if (!ptr) return get_empty_cursor(); - -#ifdef SONAME_LIBXCURSOR - if (pXcursorImageLoadCursor) return create_xcursor_cursor( display, ptr ); -#endif - /* Create the X cursor from the bits */ { XImage *image; @@ -992,26 +988,60 @@ static Cursor create_cursor( Display *display, CURSORICONINFO *ptr ) } /*********************************************************************** + * create_cursor + * + * Create an X cursor from a Windows one. + */ +static Cursor create_cursor( HANDLE handle, CURSORICONINFO *ptr ) +{ + Cursor cursor; + + if (!handle) return get_empty_cursor(); + +#ifdef SONAME_LIBXCURSOR + if (pXcursorImageLoadCursor) + { + wine_tsx11_lock(); + cursor = create_xcursor_cursor( gdi_display, ptr ); + wine_tsx11_unlock(); + if (cursor) return cursor; + } +#endif + + wine_tsx11_lock(); + cursor = create_xlib_cursor( gdi_display, ptr ); + wine_tsx11_unlock(); + return cursor; +} + +/*********************************************************************** * CreateCursorIcon (X11DRV.@) */ void CDECL X11DRV_CreateCursorIcon( HCURSOR handle, CURSORICONINFO *info ) { static const WORD ICON_HOTSPOT = 0x4242; - Cursor cursor; + Cursor cursor, prev; /* ignore icons (FIXME: shouldn't use magic hotspot value) */ if (info->ptHotSpot.x == ICON_HOTSPOT && info->ptHotSpot.y == ICON_HOTSPOT) return; - wine_tsx11_lock(); - cursor = create_cursor( gdi_display, info ); + cursor = create_cursor( handle, info ); if (cursor) { + wine_tsx11_lock(); if (!cursor_context) cursor_context = XUniqueContext(); - XSaveContext( gdi_display, (XID)handle, cursor_context, (char *)cursor ); + if (!XFindContext( gdi_display, (XID)handle, cursor_context, (char **)&prev )) + { + /* someone else was here first */ + XFreeCursor( gdi_display, cursor ); + cursor = prev; + } + else + XSaveContext( gdi_display, (XID)handle, cursor_context, (char *)cursor ); + wine_tsx11_unlock(); TRACE( "cursor %p %ux%u, planes %u, bpp %u -> xid %lx\n", handle, info->nWidth, info->nHeight, info->bPlanes, info->bBitsPerPixel, cursor ); } - wine_tsx11_unlock(); } /***********************************************************************
1
0
0
0
Alexandre Julliard : winex11: Fix a bitmap leak when setting the small icon hints.
by Alexandre Julliard
20 May '10
20 May '10
Module: wine Branch: master Commit: 0d84ccbfa1d542e333a2f706414420d05af07587 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0d84ccbfa1d542e333a2f7064…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu May 20 17:37:28 2010 +0200 winex11: Fix a bitmap leak when setting the small icon hints. --- dlls/winex11.drv/window.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 28d5ae6..fa72ada 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -928,12 +928,12 @@ static void set_icon_hints( Display *display, struct x11drv_win_data *data, HBITMAP hbmOrig; RECT rcMask; BITMAP bm; - ICONINFO ii; + ICONINFO ii, ii_small; HDC hDC; unsigned int size; unsigned long *bits; - GetIconInfo(icon_big, &ii); + if (!GetIconInfo(icon_big, &ii)) return; GetObjectW(ii.hbmMask, sizeof(bm), &bm); rcMask.top = 0; @@ -943,12 +943,12 @@ static void set_icon_hints( Display *display, struct x11drv_win_data *data, hDC = CreateCompatibleDC(0); bits = get_bitmap_argb( hDC, ii.hbmColor, ii.hbmMask, &size ); - if (GetIconInfo( icon_small, &ii )) + if (bits && GetIconInfo( icon_small, &ii_small )) { unsigned int size_small; unsigned long *bits_small, *new; - if ((bits_small = get_bitmap_argb( hDC, ii.hbmColor, ii.hbmMask, &size_small )) && + if ((bits_small = get_bitmap_argb( hDC, ii_small.hbmColor, ii_small.hbmMask, &size_small )) && (bits_small[0] != bits[0] || bits_small[1] != bits[1])) /* size must be different */ { if ((new = HeapReAlloc( GetProcessHeap(), 0, bits, @@ -960,8 +960,8 @@ static void set_icon_hints( Display *display, struct x11drv_win_data *data, } } HeapFree( GetProcessHeap(), 0, bits_small ); - DeleteObject( ii.hbmColor ); - DeleteObject( ii.hbmMask ); + DeleteObject( ii_small.hbmColor ); + DeleteObject( ii_small.hbmMask ); } wine_tsx11_lock(); if (bits)
1
0
0
0
Piotr Caban : wininet: Fix variables values after redirection in HTTP_HttpSendRequestW.
by Alexandre Julliard
20 May '10
20 May '10
Module: wine Branch: master Commit: 224af0d0e7a936e9a88b8124e98a9a2ae6a56ebf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=224af0d0e7a936e9a88b8124e…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu May 20 02:35:38 2010 +0200 wininet: Fix variables values after redirection in HTTP_HttpSendRequestW. Moved dwContentLength reset after HTTP_DrainContent (this function disconnects when dwContentLength is set to ~0u). --- dlls/wininet/http.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index dc6533b..ac0edea 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -3462,6 +3462,10 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *lpwhr, LPCWSTR lpszHeaders, * for all the data */ HTTP_DrainContent(lpwhr); lpwhr->dwContentRead = 0; + if(redirected) { + lpwhr->dwContentLength = ~0u; + lpwhr->dwBytesToWrite = 0; + } if (TRACE_ON(wininet)) {
1
0
0
0
Mike Kaplinskiy : server: Move async activation into separate function.
by Alexandre Julliard
20 May '10
20 May '10
Module: wine Branch: master Commit: ee5ee5c538db0622283886988e66641c5536a0b4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ee5ee5c538db0622283886988…
Author: Mike Kaplinskiy <mike.kaplinskiy(a)gmail.com> Date: Wed May 19 16:14:08 2010 -0400 server: Move async activation into separate function. --- server/sock.c | 33 +++++++++++++++++++-------------- 1 files changed, 19 insertions(+), 14 deletions(-) diff --git a/server/sock.c b/server/sock.c index 0a1bb40..0c8cb54 100644 --- a/server/sock.c +++ b/server/sock.c @@ -295,6 +295,23 @@ static inline int sock_error( struct fd *fd ) return optval; } +static void sock_dispatch_asyncs( struct sock *sock, int event ) +{ + if ( sock->flags & WSA_FLAG_OVERLAPPED ) + { + if ( event & (POLLIN|POLLPRI|POLLERR|POLLHUP) && async_waiting( sock->read_q )) + { + if (debug_level) fprintf( stderr, "activating read queue for socket %p\n", sock ); + async_wake_up( sock->read_q, STATUS_ALERTED ); + } + if ( event & (POLLOUT|POLLERR|POLLHUP) && async_waiting( sock->write_q )) + { + if (debug_level) fprintf( stderr, "activating write queue for socket %p\n", sock ); + async_wake_up( sock->write_q, STATUS_ALERTED ); + } + } +} + static void sock_poll_event( struct fd *fd, int event ) { struct sock *sock = get_fd_user( fd ); @@ -422,23 +439,11 @@ static void sock_poll_event( struct fd *fd, int event ) event |= POLLHUP; } + sock_dispatch_asyncs( sock, event ); + /* wake up anyone waiting for whatever just happened */ sock_wake_up( sock ); - if ( sock->flags & WSA_FLAG_OVERLAPPED ) - { - if ( event & (POLLIN|POLLPRI|POLLERR|POLLHUP) && async_waiting( sock->read_q )) - { - if (debug_level) fprintf( stderr, "activating read queue for socket %p\n", sock ); - async_wake_up( sock->read_q, STATUS_ALERTED ); - } - if ( event & (POLLOUT|POLLERR|POLLHUP) && async_waiting( sock->write_q )) - { - if (debug_level) fprintf( stderr, "activating write queue for socket %p\n", sock ); - async_wake_up( sock->write_q, STATUS_ALERTED ); - } - } - /* if anyone is stupid enough to wait on the socket object itself, * maybe we should wake them up too, just in case? */ wake_up( &sock->obj, 0 );
1
0
0
0
Andrew Nguyen : oleaut32/tests: Update a comment about PNG support in OLE picture tests.
by Alexandre Julliard
20 May '10
20 May '10
Module: wine Branch: master Commit: b8fb1c97a1d9fc62af0c95c4f32d5612396ce3d0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b8fb1c97a1d9fc62af0c95c4f…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Wed May 19 22:26:25 2010 -0500 oleaut32/tests: Update a comment about PNG support in OLE picture tests. --- dlls/oleaut32/tests/olepicture.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index 8ea1a2a..3208368 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -889,7 +889,7 @@ START_TEST(olepicture) test_pic(jpgimage, sizeof(jpgimage)); test_pic(bmpimage, sizeof(bmpimage)); test_pic(gif4pixel, sizeof(gif4pixel)); - /* FIXME: No PNG support yet in Wine or in older Windows... */ + /* FIXME: No PNG support in Windows... */ if (0) test_pic(pngimage, sizeof(pngimage)); test_empty_image(); test_empty_image_2();
1
0
0
0
Andrew Nguyen : oleaut32: Implicitly initialize COM in OleLoadPicturePath.
by Alexandre Julliard
20 May '10
20 May '10
Module: wine Branch: master Commit: 96dbdcb8c9a8f028d1d1e40191a75db5a84bedfa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=96dbdcb8c9a8f028d1d1e4019…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Wed May 19 22:26:22 2010 -0500 oleaut32: Implicitly initialize COM in OleLoadPicturePath. --- dlls/oleaut32/olepicture.c | 43 ++++++++++++++++++------------------- dlls/oleaut32/tests/olepicture.c | 3 -- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index 07d4dde..b8e949d 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -2273,6 +2273,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, BOOL bRead; IPersistStream *pStream; HRESULT hRes; + HRESULT init_res; WCHAR *file_candidate; WCHAR path_buf[MAX_PATH]; @@ -2349,34 +2350,32 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, return hRes; } - hRes = CoCreateInstance(&CLSID_StdPicture, punkCaller, CLSCTX_INPROC_SERVER, - &IID_IPicture, (LPVOID*)&ipicture); - if (hRes != S_OK) { - IStream_Release(stream); - return hRes; - } - - hRes = IPicture_QueryInterface(ipicture, &IID_IPersistStream, (LPVOID*)&pStream); - if (hRes) { - IStream_Release(stream); + init_res = CoInitialize(NULL); + + hRes = CoCreateInstance(&CLSID_StdPicture, punkCaller, CLSCTX_INPROC_SERVER, + &IID_IPicture, (LPVOID*)&ipicture); + if (SUCCEEDED(hRes)) { + hRes = IPicture_QueryInterface(ipicture, &IID_IPersistStream, (LPVOID*)&pStream); + + if (SUCCEEDED(hRes)) { + hRes = IPersistStream_Load(pStream, stream); + + if (SUCCEEDED(hRes)) { + hRes = IPicture_QueryInterface(ipicture, riid, ppvRet); + + if (FAILED(hRes)) + ERR("Failed to get interface %s from IPicture.\n", debugstr_guid(riid)); + } + IPersistStream_Release(pStream); + } IPicture_Release(ipicture); - return hRes; } - hRes = IPersistStream_Load(pStream, stream); - IPersistStream_Release(pStream); IStream_Release(stream); - if (hRes) { - IPicture_Release(ipicture); - return hRes; - } + if (SUCCEEDED(init_res)) + CoUninitialize(); - hRes = IPicture_QueryInterface(ipicture,riid,ppvRet); - if (hRes) - ERR("Failed to get interface %s from IPicture.\n",debugstr_guid(riid)); - - IPicture_Release(ipicture); return hRes; } diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index 6bf3c44..8ea1a2a 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -813,7 +813,6 @@ static void test_OleLoadPicturePath(void) /* Try a normal DOS path. */ hres = OleLoadPicturePath(temp_fileW + 8, NULL, 0, 0, &IID_IPicture, (void **)&pic); - todo_wine ok(hres == S_OK || broken(hres == E_UNEXPECTED), /* NT4/Win95 */ "Expected OleLoadPicturePath to return S_OK, got 0x%08x\n", hres); @@ -822,7 +821,6 @@ static void test_OleLoadPicturePath(void) /* Try a DOS path with tacked on "file:". */ hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic); - todo_wine ok(hres == S_OK || broken(hres == E_UNEXPECTED), /* NT4/Win95 */ "Expected OleLoadPicturePath to return S_OK, got 0x%08x\n", hres); @@ -859,7 +857,6 @@ static void test_OleLoadPicturePath(void) } hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic); - todo_wine ok(hres == S_OK || broken(hres == E_UNEXPECTED), /* NT4/Win95 */ "Expected OleLoadPicturePath to return S_OK, got 0x%08x\n", hres);
1
0
0
0
Andrew Nguyen : oleaut32: Convert file URLs to DOS paths for special handling in OleLoadPicturePath.
by Alexandre Julliard
20 May '10
20 May '10
Module: wine Branch: master Commit: 61f7f77636c621e576da229f74b70c234cbb612b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=61f7f77636c621e576da229f7…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Wed May 19 22:29:42 2010 -0500 oleaut32: Convert file URLs to DOS paths for special handling in OleLoadPicturePath. File URLs cannot be used in the moniker code path, as binding to the IStream interface is not possible. --- dlls/oleaut32/olepicture.c | 28 ++++++++++--- dlls/oleaut32/tests/olepicture.c | 80 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 7 deletions(-) diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index d9d488f..07d4dde 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -2263,7 +2263,7 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, DWORD dwReserved, OLE_COLOR clrReserved, REFIID riid, LPVOID *ppvRet ) { - static const WCHAR file[] = { 'f','i','l','e',':','/','/',0 }; + static const WCHAR file[] = { 'f','i','l','e',':',0 }; IPicture *ipicture; HANDLE hFile; DWORD dwFileSize; @@ -2273,6 +2273,8 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, BOOL bRead; IPersistStream *pStream; HRESULT hRes; + WCHAR *file_candidate; + WCHAR path_buf[MAX_PATH]; TRACE("(%s,%p,%d,%08x,%s,%p): stub\n", debugstr_w(szURLorPath), punkCaller, dwReserved, clrReserved, @@ -2283,13 +2285,25 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, *ppvRet = NULL; - if (strncmpW(szURLorPath, file, 7) == 0) { - szURLorPath += 7; - - hFile = CreateFileW(szURLorPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, - 0, NULL); + /* Convert file URLs to DOS paths. */ + if (strncmpW(szURLorPath, file, 5) == 0) { + DWORD size; + hRes = CoInternetParseUrl(szURLorPath, PARSE_PATH_FROM_URL, 0, path_buf, + sizeof(path_buf)/sizeof(WCHAR), &size, 0); + if (FAILED(hRes)) + return hRes; + + file_candidate = path_buf; + } + else + file_candidate = szURLorPath; + + /* Handle candidate DOS paths separately. */ + if (file_candidate[1] == ':') { + hFile = CreateFileW(file_candidate, GENERIC_READ, 0, NULL, OPEN_EXISTING, + 0, NULL); if (hFile == INVALID_HANDLE_VALUE) - return E_UNEXPECTED; + return E_UNEXPECTED; dwFileSize = GetFileSize(hFile, NULL); if (dwFileSize != INVALID_FILE_SIZE ) diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index 2874804..6bf3c44 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -745,6 +745,12 @@ static void test_OleLoadPicturePath(void) IPicture *pic; HRESULT hres; int i; + char temp_path[MAX_PATH]; + char temp_file[MAX_PATH]; + WCHAR temp_fileW[MAX_PATH + 5] = {'f','i','l','e',':','/','/','/'}; + HANDLE file; + DWORD size; + WCHAR *ptr; const struct { @@ -794,6 +800,80 @@ static void test_OleLoadPicturePath(void) "Expected OleLoadPicturePath to return INET_E_UNKNOWN_PROTOCOL, got 0x%08x\n", hres); ok(pic == NULL, "Expected the output interface pointer to be NULL, got %p\n", pic); + + /* Create a local temporary image file for testing. */ + GetTempPathA(sizeof(temp_path), temp_path); + GetTempFileNameA(temp_path, "bmp", 0, temp_file); + file = CreateFileA(temp_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + WriteFile(file, bmpimage, sizeof(bmpimage), &size, NULL); + CloseHandle(file); + + MultiByteToWideChar(CP_ACP, 0, temp_file, -1, temp_fileW + 8, sizeof(temp_fileW)/sizeof(WCHAR) - 8); + + /* Try a normal DOS path. */ + hres = OleLoadPicturePath(temp_fileW + 8, NULL, 0, 0, &IID_IPicture, (void **)&pic); + todo_wine + ok(hres == S_OK || + broken(hres == E_UNEXPECTED), /* NT4/Win95 */ + "Expected OleLoadPicturePath to return S_OK, got 0x%08x\n", hres); + if (pic) + IPicture_Release(pic); + + /* Try a DOS path with tacked on "file:". */ + hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic); + todo_wine + ok(hres == S_OK || + broken(hres == E_UNEXPECTED), /* NT4/Win95 */ + "Expected OleLoadPicturePath to return S_OK, got 0x%08x\n", hres); + if (pic) + IPicture_Release(pic); + + DeleteFileA(temp_file); + + /* Try with a non-existent file. */ + hres = OleLoadPicturePath(temp_fileW + 8, NULL, 0, 0, &IID_IPicture, (void **)&pic); + ok(hres == INET_E_RESOURCE_NOT_FOUND || /* XP+ */ + hres == E_UNEXPECTED || /* NT4/Win95 */ + hres == E_FAIL, /* Win9x/Win2k */ + "Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08x\n", hres); + + hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic); + ok(hres == INET_E_RESOURCE_NOT_FOUND || /* XP+ */ + hres == E_UNEXPECTED || /* NT4/Win95 */ + hres == E_FAIL, /* Win9x/Win2k */ + "Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08x\n", hres); + + file = CreateFileA(temp_file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + WriteFile(file, bmpimage, sizeof(bmpimage), &size, NULL); + CloseHandle(file); + + /* Try a "file:" URL with slash separators. */ + ptr = temp_fileW + 8; + while (*ptr) + { + if (*ptr == '\\') + *ptr = '/'; + ptr++; + } + + hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic); + todo_wine + ok(hres == S_OK || + broken(hres == E_UNEXPECTED), /* NT4/Win95 */ + "Expected OleLoadPicturePath to return S_OK, got 0x%08x\n", hres); + if (pic) + IPicture_Release(pic); + + DeleteFileA(temp_file); + + /* Try with a non-existent file. */ + hres = OleLoadPicturePath(temp_fileW, NULL, 0, 0, &IID_IPicture, (void **)&pic); + ok(hres == INET_E_RESOURCE_NOT_FOUND || /* XP+ */ + hres == E_UNEXPECTED || /* NT4/Win95 */ + hres == E_FAIL, /* Win9x/Win2k */ + "Expected OleLoadPicturePath to return INET_E_RESOURCE_NOT_FOUND, got 0x%08x\n", hres); } START_TEST(olepicture)
1
0
0
0
Andrew Nguyen : oleaut32: Improve parameter validation in OleLoadPicturePath.
by Alexandre Julliard
20 May '10
20 May '10
Module: wine Branch: master Commit: dc13339988523e06148037b06b90ffb8070316ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dc13339988523e06148037b06…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Wed May 19 22:26:15 2010 -0500 oleaut32: Improve parameter validation in OleLoadPicturePath. --- dlls/oleaut32/olepicture.c | 5 ++- dlls/oleaut32/tests/olepicture.c | 72 ++++++++++++++++++++++++++++++++++--- 2 files changed, 70 insertions(+), 7 deletions(-) diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index 3f431fd..d9d488f 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -2278,7 +2278,10 @@ HRESULT WINAPI OleLoadPicturePath( LPOLESTR szURLorPath, LPUNKNOWN punkCaller, debugstr_w(szURLorPath), punkCaller, dwReserved, clrReserved, debugstr_guid(riid), ppvRet); - if (!ppvRet) return E_POINTER; + if (!szURLorPath || !ppvRet) + return E_INVALIDARG; + + *ppvRet = NULL; if (strncmpW(szURLorPath, file, 7) == 0) { szURLorPath += 7; diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index c8ddc8a..2874804 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -36,6 +36,7 @@ #include <winerror.h> #include <winnt.h> +#include <urlmon.h> #include <wtypes.h> #include <olectl.h> #include <objidl.h> @@ -737,6 +738,64 @@ static void test_get_Type(void) IPicture_Release(pic); } +static void test_OleLoadPicturePath(void) +{ + static WCHAR emptyW[] = {0}; + + IPicture *pic; + HRESULT hres; + int i; + + const struct + { + LPOLESTR szURLorPath; + REFIID riid; + IPicture **pic; + } invalid_parameters[] = + { + {NULL, NULL, NULL}, + {NULL, NULL, &pic}, + {NULL, &IID_IPicture, NULL}, + {NULL, &IID_IPicture, &pic}, + {emptyW, NULL, NULL}, + {emptyW, &IID_IPicture, NULL}, + }; + + for (i = 0; i < sizeof(invalid_parameters)/sizeof(invalid_parameters[0]); i++) + { + pic = (IPicture *)0xdeadbeef; + hres = OleLoadPicturePath(invalid_parameters[i].szURLorPath, NULL, 0, 0, + invalid_parameters[i].riid, + (void **)invalid_parameters[i].pic); + ok(hres == E_INVALIDARG, + "[%d] Expected OleLoadPicturePath to return E_INVALIDARG, got 0x%08x\n", i, hres); + ok(pic == (IPicture *)0xdeadbeef, + "[%d] Expected output pointer to be 0xdeadbeef, got %p\n", i, pic); + } + + pic = (IPicture *)0xdeadbeef; + hres = OleLoadPicturePath(emptyW, NULL, 0, 0, NULL, (void **)&pic); + todo_wine + ok(hres == INET_E_UNKNOWN_PROTOCOL || /* XP/Vista+ */ + hres == E_UNEXPECTED || /* NT4/Win95 */ + hres == E_FAIL || /* Win95 OSR2 */ + hres == E_OUTOFMEMORY, /* Win98/Win2k/Win2k3 */ + "Expected OleLoadPicturePath to return INET_E_UNKNOWN_PROTOCOL, got 0x%08x\n", hres); + ok(pic == NULL, + "Expected the output interface pointer to be NULL, got %p\n", pic); + + pic = (IPicture *)0xdeadbeef; + hres = OleLoadPicturePath(emptyW, NULL, 0, 0, &IID_IPicture, (void **)&pic); + todo_wine + ok(hres == INET_E_UNKNOWN_PROTOCOL || /* XP/Vista+ */ + hres == E_UNEXPECTED || /* NT4/Win95 */ + hres == E_FAIL || /* Win95 OSR2 */ + hres == E_OUTOFMEMORY, /* Win98/Win2k/Win2k3 */ + "Expected OleLoadPicturePath to return INET_E_UNKNOWN_PROTOCOL, got 0x%08x\n", hres); + ok(pic == NULL, + "Expected the output interface pointer to be NULL, got %p\n", pic); +} + START_TEST(olepicture) { hOleaut32 = GetModuleHandleA("oleaut32.dll"); @@ -761,12 +820,13 @@ START_TEST(olepicture) test_metafile(); test_enhmetafile(); - test_Invoke(); - test_OleCreatePictureIndirect(); - test_Render(); - test_get_Attributes(); - test_get_Handle(); - test_get_Type(); + test_Invoke(); + test_OleCreatePictureIndirect(); + test_Render(); + test_get_Attributes(); + test_get_Handle(); + test_get_Type(); + test_OleLoadPicturePath(); }
1
0
0
0
Andrew Nguyen : urlmon/tests: Fix CoInternetCompareUrl failure message typos.
by Alexandre Julliard
20 May '10
20 May '10
Module: wine Branch: master Commit: 0b3eac9227c8cb664962cf10624fef0ce3c54137 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0b3eac9227c8cb664962cf106…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Wed May 19 22:26:02 2010 -0500 urlmon/tests: Fix CoInternetCompareUrl failure message typos. --- dlls/urlmon/tests/misc.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/urlmon/tests/misc.c b/dlls/urlmon/tests/misc.c index f9c14a4..66d2c7e 100644 --- a/dlls/urlmon/tests/misc.c +++ b/dlls/urlmon/tests/misc.c @@ -385,13 +385,13 @@ static void test_CoInternetCompareUrl(void) } hres = pCoInternetCompareUrl(url1, url1, 0); - ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres); + ok(hres == S_OK, "CoInternetCompareUrl failed: %08x\n", hres); hres = pCoInternetCompareUrl(url1, url3, 0); - ok(hres == S_FALSE, "CoInternetParseUrl failed: %08x\n", hres); + ok(hres == S_FALSE, "CoInternetCompareUrl failed: %08x\n", hres); hres = pCoInternetCompareUrl(url3, url1, 0); - ok(hres == S_FALSE, "CoInternetParseUrl failed: %08x\n", hres); + ok(hres == S_FALSE, "CoInternetCompareUrl failed: %08x\n", hres); } static const struct {
1
0
0
0
Andrew Nguyen : urlmon: Validate URL and output pointer in CreateURLMoniker .
by Alexandre Julliard
20 May '10
20 May '10
Module: wine Branch: master Commit: e92cca8df654109110c8e82a24b9c892c78b157a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e92cca8df654109110c8e82a2…
Author: Andrew Nguyen <anguyen(a)codeweavers.com> Date: Wed May 19 22:25:54 2010 -0500 urlmon: Validate URL and output pointer in CreateURLMoniker. --- dlls/urlmon/tests/url.c | 20 ++++++++++++++++++++ dlls/urlmon/umon.c | 6 ++++++ 2 files changed, 26 insertions(+), 0 deletions(-) diff --git a/dlls/urlmon/tests/url.c b/dlls/urlmon/tests/url.c index 661bf6e..bf5e9fe 100644 --- a/dlls/urlmon/tests/url.c +++ b/dlls/urlmon/tests/url.c @@ -242,6 +242,26 @@ static void test_CreateURLMoniker(LPCWSTR url1, LPCWSTR url2) IMoniker *mon1 = NULL; IMoniker *mon2 = NULL; + hr = CreateURLMoniker(NULL, NULL, NULL); + ok(hr == E_INVALIDARG, + "Expected CreateURLMoniker to return E_INVALIDARG, got 0x%08x\n", hr); + + mon1 = (IMoniker *)0xdeadbeef; + hr = CreateURLMoniker(NULL, NULL, &mon1); + ok(hr == E_INVALIDARG, + "Expected CreateURLMoniker to return E_INVALIDARG, got 0x%08x\n", hr); + ok(mon1 == NULL, "Expected the output pointer to be NULL, got %p\n", mon1); + + hr = CreateURLMoniker(NULL, emptyW, NULL); + ok(hr == E_INVALIDARG, + "Expected CreateURLMoniker to return E_INVALIDARG, got 0x%08x\n", hr); + + hr = CreateURLMoniker(NULL, emptyW, &mon1); + ok(hr == S_OK || + broken(hr == MK_E_SYNTAX), /* IE5/IE5.01/IE6 SP2 */ + "Expected CreateURLMoniker to return S_OK, got 0x%08x\n", hr); + if(mon1) IMoniker_Release(mon1); + hr = CreateURLMoniker(NULL, url1, &mon1); ok(SUCCEEDED(hr), "failed to create moniker: 0x%08x\n", hr); if(SUCCEEDED(hr)) { diff --git a/dlls/urlmon/umon.c b/dlls/urlmon/umon.c index 5e6a8f6..92e902f 100644 --- a/dlls/urlmon/umon.c +++ b/dlls/urlmon/umon.c @@ -513,6 +513,12 @@ HRESULT WINAPI CreateURLMonikerEx(IMoniker *pmkContext, LPCWSTR szURL, IMoniker TRACE("(%p, %s, %p, %08x)\n", pmkContext, debugstr_w(szURL), ppmk, dwFlags); + if (ppmk) + *ppmk = NULL; + + if (!szURL || !ppmk) + return E_INVALIDARG; + if (dwFlags & URL_MK_UNIFORM) FIXME("ignoring flag URL_MK_UNIFORM\n"); if(!(obj = alloc_moniker()))
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
96
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
Results per page:
10
25
50
100
200