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
November 2008
----- 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
2 participants
734 discussions
Start a n
N
ew thread
Paul Vriens : kernel32/tests: Fix timeouts on NT4 and W2K.
by Alexandre Julliard
14 Nov '08
14 Nov '08
Module: wine Branch: master Commit: 21765291cf603e4977295f060a1ab76f6ec95c4e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=21765291cf603e4977295f060…
Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Fri Nov 14 14:00:12 2008 +0100 kernel32/tests: Fix timeouts on NT4 and W2K. --- dlls/kernel32/tests/pipe.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index 2d45702..e6a57bf 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -796,7 +796,7 @@ static void test_CreatePipe(void) size = 32768; buffer = HeapAlloc( GetProcessHeap(), 0, size ); for (i = 0; i < size; i++) buffer[i] = i; - ok(CreatePipe(&piperead, &pipewrite, &pipe_attr, size) != 0, "CreatePipe failed\n"); + ok(CreatePipe(&piperead, &pipewrite, &pipe_attr, (size + 24)) != 0, "CreatePipe failed\n"); ok(WriteFile(pipewrite, buffer, size, &written, NULL), "Write to anonymous pipe failed\n"); ok(written == size, "Write to anonymous pipe wrote %d bytes\n", written); /* and close the write end, read should still succeed*/
1
0
0
0
Andrew Riedi : user32: Initial .ani support (only first frame).
by Alexandre Julliard
14 Nov '08
14 Nov '08
Module: wine Branch: master Commit: 7f5b4ab15d535f48b846b8187213345c3eb323b0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7f5b4ab15d535f48b846b8187…
Author: Andrew Riedi <andrewriedi(a)gmail.com> Date: Sun Nov 9 14:00:54 2008 -0800 user32: Initial .ani support (only first frame). Based on patches by Henri Verbeet. --- dlls/user32/cursoricon.c | 186 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 185 insertions(+), 1 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index ac533ef..d854351 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -5,6 +5,7 @@ * 1996 Martin Von Loewis * 1997 Alex Korobka * 1998 Turchanov Sergey + * 2007 Henri Verbeet * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -851,6 +852,189 @@ static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi, /********************************************************************** + * .ANI cursor support + */ +#define RIFF_FOURCC( c0, c1, c2, c3 ) \ + ( (DWORD)(BYTE)(c0) | ( (DWORD)(BYTE)(c1) << 8 ) | \ + ( (DWORD)(BYTE)(c2) << 16 ) | ( (DWORD)(BYTE)(c3) << 24 ) ) + +#define ANI_RIFF_ID RIFF_FOURCC('R', 'I', 'F', 'F') +#define ANI_LIST_ID RIFF_FOURCC('L', 'I', 'S', 'T') +#define ANI_ACON_ID RIFF_FOURCC('A', 'C', 'O', 'N') +#define ANI_anih_ID RIFF_FOURCC('a', 'n', 'i', 'h') +#define ANI_seq__ID RIFF_FOURCC('s', 'e', 'q', ' ') +#define ANI_fram_ID RIFF_FOURCC('f', 'r', 'a', 'm') + +#define ANI_FLAG_ICON 0x1 +#define ANI_FLAG_SEQUENCE 0x2 + +typedef struct { + DWORD header_size; + DWORD num_frames; + DWORD num_steps; + DWORD width; + DWORD height; + DWORD bpp; + DWORD num_planes; + DWORD display_rate; + DWORD flags; +} ani_header; + +typedef struct { + DWORD data_size; + const unsigned char *data; +} riff_chunk_t; + +static void dump_ani_header( const ani_header *header ) +{ + TRACE(" header size: %d\n", header->header_size); + TRACE(" frames: %d\n", header->num_frames); + TRACE(" steps: %d\n", header->num_steps); + TRACE(" width: %d\n", header->width); + TRACE(" height: %d\n", header->height); + TRACE(" bpp: %d\n", header->bpp); + TRACE(" planes: %d\n", header->num_planes); + TRACE(" display rate: %d\n", header->display_rate); + TRACE(" flags: 0x%08x\n", header->flags); +} + + +/* + * RIFF: + * DWORD "RIFF" + * DWORD size + * DWORD riff_id + * BYTE[] data + * + * LIST: + * DWORD "LIST" + * DWORD size + * DWORD list_id + * BYTE[] data + * + * CHUNK: + * DWORD chunk_id + * DWORD size + * BYTE[] data + */ +static void riff_find_chunk( DWORD chunk_id, DWORD chunk_type, const riff_chunk_t *parent_chunk, riff_chunk_t *chunk ) +{ + const unsigned char *ptr = parent_chunk->data; + const unsigned char *end = parent_chunk->data + (parent_chunk->data_size - (2 * sizeof(DWORD))); + + if (chunk_type == ANI_LIST_ID || chunk_type == ANI_RIFF_ID) end -= sizeof(DWORD); + + while (ptr < end) + { + if ((!chunk_type && *(DWORD *)ptr == chunk_id ) + || (chunk_type && *(DWORD *)ptr == chunk_type && *((DWORD *)ptr + 2) == chunk_id )) + { + ptr += sizeof(DWORD); + chunk->data_size = *(DWORD *)ptr; + ptr += sizeof(DWORD); + if (chunk_type == ANI_LIST_ID || chunk_type == ANI_RIFF_ID) ptr += sizeof(DWORD); + chunk->data = ptr; + + return; + } + + ptr += sizeof(DWORD); + ptr += *(DWORD *)ptr; + ptr += sizeof(DWORD); + } +} + + +/* + * .ANI layout: + * + * RIFF:'ACON' RIFF chunk + * |- CHUNK:'anih' Header + * |- CHUNK:'seq ' Sequence information (optional) + * \- LIST:'fram' Frame list + * |- CHUNK:icon Cursor frames + * |- CHUNK:icon + * |- ... + * \- CHUNK:icon + */ +static HCURSOR CURSORICON_CreateIconFromANI( const LPBYTE bits, DWORD bits_size, + INT width, INT height ) +{ + HCURSOR cursor; + ani_header header = {0}; + LPBYTE frame_bits = 0; + POINT16 hotspot; + CURSORICONFILEDIRENTRY *entry; + + riff_chunk_t root_chunk = { bits_size, bits }; + riff_chunk_t ACON_chunk = {0}; + riff_chunk_t anih_chunk = {0}; + riff_chunk_t fram_chunk = {0}; + const unsigned char *icon_data; + + TRACE("bits %p, bits_size %d\n", bits, bits_size); + + if (!bits) return 0; + + riff_find_chunk( ANI_ACON_ID, ANI_RIFF_ID, &root_chunk, &ACON_chunk ); + if (!ACON_chunk.data) + { + ERR("Failed to get root chunk.\n"); + return 0; + } + + riff_find_chunk( ANI_anih_ID, 0, &ACON_chunk, &anih_chunk ); + if (!anih_chunk.data) + { + ERR("Failed to get 'anih' chunk.\n"); + return 0; + } + memcpy( &header, anih_chunk.data, sizeof(header) ); + dump_ani_header( &header ); + + riff_find_chunk( ANI_fram_ID, ANI_LIST_ID, &ACON_chunk, &fram_chunk ); + if (!fram_chunk.data) + { + ERR("Failed to get icon list.\n"); + return 0; + } + + /* FIXME: For now, just load the first frame. Before we can load all the + * frames, we need to write the needed code in wineserver, etc. to handle + * cursors. Once this code is written, we can extend it to support .ani + * cursors and then update user32 and winex11.drv to load all frames. + * + * Hopefully this will at least make some games (C&C3, etc.) more playable + * in the mean time. + */ + FIXME("Loading all frames for .ani cursors not implemented.\n"); + icon_data = fram_chunk.data + (2 * sizeof(DWORD)); + + entry = CURSORICON_FindBestCursorFile( (CURSORICONFILEDIR *) icon_data, + width, height, 1 ); + + frame_bits = HeapAlloc( GetProcessHeap(), 0, entry->dwDIBSize ); + memcpy( frame_bits, icon_data + entry->dwDIBOffset, entry->dwDIBSize ); + + if (!header.width || !header.height) + { + header.width = entry->bWidth; + header.height = entry->bHeight; + } + + hotspot.x = entry->xHotspot; + hotspot.y = entry->yHotspot; + + cursor = CURSORICON_CreateIconFromBMI( (BITMAPINFO *) frame_bits, hotspot, + FALSE, 0x00030000, header.width, header.height, 0 ); + + HeapFree( GetProcessHeap(), 0, frame_bits ); + + return cursor; +} + + +/********************************************************************** * CreateIconFromResourceEx (USER32.@) * * FIXME: Convert to mono when cFlag is LR_MONOCHROME. Do something @@ -915,7 +1099,7 @@ static HICON CURSORICON_LoadFromFile( LPCWSTR filename, /* Check for .ani. */ if (memcmp( bits, "RIFF", 4 ) == 0) { - FIXME("No support for .ani cursors.\n"); + hIcon = CURSORICON_CreateIconFromANI( bits, filesize, width, height ); goto end; }
1
0
0
0
Damjan Jovanovic : shdocvw, winemenubuilder: Generate fd.o entries for . url files.
by Alexandre Julliard
14 Nov '08
14 Nov '08
Module: wine Branch: master Commit: 9ff230dcaa0f18c3bf1af58bf37b5d29a31edd75 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9ff230dcaa0f18c3bf1af58bf…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com> Date: Thu Nov 13 08:19:25 2008 +0200 shdocvw, winemenubuilder: Generate fd.o entries for .url files. --- dlls/shdocvw/intshcut.c | 89 +++++++++++++++- programs/winemenubuilder/winemenubuilder.c | 155 +++++++++++++++++++++++++++- 2 files changed, 237 insertions(+), 7 deletions(-) diff --git a/dlls/shdocvw/intshcut.c b/dlls/shdocvw/intshcut.c index e24d56d..01da03e 100644 --- a/dlls/shdocvw/intshcut.c +++ b/dlls/shdocvw/intshcut.c @@ -20,10 +20,8 @@ /* * TODO: - * fd.o desktop and menu integration * Implement the IShellLinkA/W interfaces * Handle the SetURL flags - * Loading .url files * Implement any other interfaces? Does any software actually use them? * * The installer for the Zuma Deluxe Popcap game is good for testing. @@ -67,6 +65,42 @@ static inline InternetShortcut* impl_from_IPersistFile(IPersistFile *iface) return (InternetShortcut*)((char*)iface - FIELD_OFFSET(InternetShortcut, persistFile)); } +static BOOL StartLinkProcessor(LPCOLESTR szLink) +{ + static const WCHAR szFormat[] = { + 'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e', + ' ','-','w',' ','-','u',' ','"','%','s','"',0 }; + LONG len; + LPWSTR buffer; + STARTUPINFOW si; + PROCESS_INFORMATION pi; + BOOL ret; + + len = sizeof(szFormat) + lstrlenW( szLink ) * sizeof(WCHAR); + buffer = heap_alloc( len ); + if( !buffer ) + return FALSE; + + wsprintfW( buffer, szFormat, szLink ); + + TRACE("starting %s\n",debugstr_w(buffer)); + + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); + + ret = CreateProcessW( NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi ); + + HeapFree( GetProcessHeap(), 0, buffer ); + + if (ret) + { + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + } + + return ret; +} + /* interface functions */ static HRESULT WINAPI Unknown_QueryInterface(InternetShortcut *This, REFIID riid, PVOID *ppvObject) @@ -282,8 +316,54 @@ static HRESULT WINAPI PersistFile_IsDirty(IPersistFile *pFile) static HRESULT WINAPI PersistFile_Load(IPersistFile *pFile, LPCOLESTR pszFileName, DWORD dwMode) { - FIXME("(%p, %p, 0x%x): stub\n", pFile, pszFileName, dwMode); - return E_NOTIMPL; + WCHAR str_header[] = {'I','n','t','e','r','n','e','t','S','h','o','r','t','c','u','t',0}; + WCHAR str_URL[] = {'U','R','L',0}; + WCHAR *filename = NULL; + HRESULT hr; + InternetShortcut *This = impl_from_IPersistFile(pFile); + TRACE("(%p, %s, 0x%x)\n", pFile, debugstr_w(pszFileName), dwMode); + if (dwMode != 0) + FIXME("ignoring unimplemented mode 0x%x\n", dwMode); + filename = co_strdupW(pszFileName); + if (filename != NULL) + { + DWORD len = 128; + DWORD r; + WCHAR *url = CoTaskMemAlloc(len); + if (url != NULL) + { + r = GetPrivateProfileStringW(str_header, str_URL, NULL, url, len, pszFileName); + while (r == len-1) + { + CoTaskMemFree(url); + len *= 2; + url = CoTaskMemAlloc(len); + if (url == NULL) + break; + r = GetPrivateProfileStringW(str_header, str_URL, NULL, url, len, pszFileName); + } + if (r == 0) + hr = E_FAIL; + else if (url != NULL) + { + CoTaskMemFree(This->currentFile); + This->currentFile = filename; + CoTaskMemFree(This->url); + This->url = url; + This->isDirty = FALSE; + return S_OK; + } + else + hr = E_OUTOFMEMORY; + CoTaskMemFree(url); + } + else + hr = E_OUTOFMEMORY; + CoTaskMemFree(filename); + } + else + hr = E_OUTOFMEMORY; + return hr; } static HRESULT WINAPI PersistFile_Save(IPersistFile *pFile, LPCOLESTR pszFileName, BOOL fRemember) @@ -336,6 +416,7 @@ static HRESULT WINAPI PersistFile_Save(IPersistFile *pFile, LPCOLESTR pszFileNam CloseHandle(file); if (pszFileName == NULL || fRemember) This->isDirty = FALSE; + StartLinkProcessor(pszFileName); } else hr = E_FAIL; diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index 26571f6..4792d0d 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -73,6 +73,7 @@ #include <shlguid.h> #include <appmgmt.h> #include <tlhelp32.h> +#include <intshcut.h> #include "wine/unicode.h" #include "wine/debug.h" @@ -1409,6 +1410,82 @@ cleanup: return ( r == 0 ); } +static BOOL InvokeShellLinkerForURL( IUniformResourceLocatorW *url, LPCWSTR link, BOOL bWait ) +{ + char *link_name = NULL; + DWORD csidl = -1; + LPWSTR urlPath; + char *escaped_urlPath = NULL; + HRESULT hr; + HANDLE hSem = NULL; + BOOL ret = TRUE; + int r = -1; + + if ( !link ) + { + WINE_ERR("Link name is null\n"); + return TRUE; + } + + if( !GetLinkLocation( link, &csidl, &link_name ) ) + { + WINE_WARN("Unknown link location %s. Ignoring.\n",wine_dbgstr_w(link)); + return TRUE; + } + if (!in_desktop_dir(csidl) && !in_startmenu(csidl)) + { + WINE_WARN("Not under desktop or start menu. Ignoring.\n"); + ret = TRUE; + goto cleanup; + } + WINE_TRACE("Link : %s\n", wine_dbgstr_a(link_name)); + + hr = url->lpVtbl->GetURL(url, &urlPath); + if (FAILED(hr)) + { + ret = TRUE; + goto cleanup; + } + WINE_TRACE("path : %s\n", wine_dbgstr_w(urlPath)); + + escaped_urlPath = escape(urlPath); + + hSem = CreateSemaphoreA( NULL, 1, 1, "winemenubuilder_semaphore"); + if( WAIT_OBJECT_0 != MsgWaitForMultipleObjects( 1, &hSem, FALSE, INFINITE, QS_ALLINPUT ) ) + { + WINE_ERR("failed wait for semaphore\n"); + goto cleanup; + } + if (in_desktop_dir(csidl)) + { + char *location; + const char *lastEntry; + lastEntry = strrchr(link_name, '/'); + if (lastEntry == NULL) + lastEntry = link_name; + else + ++lastEntry; + location = heap_printf("%s/Desktop/%s.desktop", getenv("HOME"), lastEntry); + if (location) + { + r = !write_desktop_entry(location, lastEntry, "winebrowser", escaped_urlPath, NULL, NULL, NULL); + HeapFree(GetProcessHeap(), 0, location); + } + } + else + r = !write_menu_entry(link_name, "winebrowser", escaped_urlPath, NULL, NULL, NULL); + ret = (r != 0); + ReleaseSemaphore(hSem, 1, NULL); + +cleanup: + if (hSem) + CloseHandle(hSem); + HeapFree(GetProcessHeap(), 0, link_name); + CoTaskMemFree( urlPath ); + HeapFree(GetProcessHeap(), 0, escaped_urlPath); + return ret; +} + static BOOL WaitForParentProcess( void ) { PROCESSENTRY32 procentry; @@ -1522,6 +1599,70 @@ static BOOL Process_Link( LPCWSTR linkname, BOOL bWait ) return !r; } +static BOOL Process_URL( LPCWSTR urlname, BOOL bWait ) +{ + IUniformResourceLocatorW *url; + IPersistFile *pf; + HRESULT r; + WCHAR fullname[MAX_PATH]; + DWORD len; + + WINE_TRACE("%s, wait %d\n", wine_dbgstr_w(urlname), bWait); + + if( !urlname[0] ) + { + WINE_ERR("URL name missing\n"); + return 1; + } + + len=GetFullPathNameW( urlname, MAX_PATH, fullname, NULL ); + if (len==0 || len>MAX_PATH) + { + WINE_ERR("couldn't get full path of URL file\n"); + return 1; + } + + r = CoInitialize( NULL ); + if( FAILED( r ) ) + { + WINE_ERR("CoInitialize failed\n"); + return 1; + } + + r = CoCreateInstance( &CLSID_InternetShortcut, NULL, CLSCTX_INPROC_SERVER, + &IID_IUniformResourceLocatorW, (LPVOID *) &url ); + if( FAILED( r ) ) + { + WINE_ERR("No IID_IUniformResourceLocatorW\n"); + return 1; + } + + r = url->lpVtbl->QueryInterface( url, &IID_IPersistFile, (LPVOID*) &pf ); + if( FAILED( r ) ) + { + WINE_ERR("No IID_IPersistFile\n"); + return 1; + } + r = IPersistFile_Load( pf, fullname, STGM_READ ); + if( SUCCEEDED( r ) ) + { + /* If something fails (eg. Couldn't extract icon) + * wait for parent process and try again + */ + if( ! InvokeShellLinkerForURL( url, fullname, bWait ) && bWait ) + { + WaitForParentProcess(); + InvokeShellLinkerForURL( url, fullname, FALSE ); + } + } + + IPersistFile_Release( pf ); + url->lpVtbl->Release( url ); + + CoUninitialize(); + + return !r; +} static CHAR *next_token( LPSTR *p ) { @@ -1596,6 +1737,7 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show { LPSTR token = NULL, p; BOOL bWait = FALSE; + BOOL bURL = FALSE; int ret = 0; init_xdg(); @@ -1607,6 +1749,8 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show break; if( !lstrcmpA( token, "-w" ) ) bWait = TRUE; + else if ( !lstrcmpA( token, "-u" ) ) + bURL = TRUE; else if( token[0] == '-' ) { WINE_ERR( "unknown option %s\n",token); @@ -1614,12 +1758,17 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show else { WCHAR link[MAX_PATH]; + BOOL bRet; MultiByteToWideChar( CP_ACP, 0, token, -1, link, sizeof(link)/sizeof(WCHAR) ); - if( !Process_Link( link, bWait ) ) + if (bURL) + bRet = Process_URL( link, bWait ); + else + bRet = Process_Link( link, bWait ); + if (!bRet) { - WINE_ERR( "failed to build menu item for %s\n",token); - ret = 1; + WINE_ERR( "failed to build menu item for %s\n",token); + ret = 1; } } }
1
0
0
0
Alexandre Julliard : kernel32/tests: Fix the file test on various Windows versions.
by Alexandre Julliard
14 Nov '08
14 Nov '08
Module: wine Branch: master Commit: 16feb03778ec19cec6daebeabaa6a6579403963d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=16feb03778ec19cec6daebeab…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 14 13:30:16 2008 +0100 kernel32/tests: Fix the file test on various Windows versions. --- dlls/kernel32/tests/file.c | 123 +++++++++++++++++++++++++++---------------- 1 files changed, 77 insertions(+), 46 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=16feb03778ec19cec6dae…
1
0
0
0
Detlef Riekenberg : comctl32/tests: Make the header test dpi aware.
by Alexandre Julliard
14 Nov '08
14 Nov '08
Module: wine Branch: master Commit: f0d0ac75dcb2c2195b617c0da513742cbd81f84a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f0d0ac75dcb2c2195b617c0da…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Fri Nov 14 05:29:57 2008 +0100 comctl32/tests: Make the header test dpi aware. --- dlls/comctl32/tests/header.c | 55 ++++++++++++++++++++++++++--------------- 1 files changed, 35 insertions(+), 20 deletions(-) diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c index b7341d4..e6a2524 100644 --- a/dlls/comctl32/tests/header.c +++ b/dlls/comctl32/tests/header.c @@ -39,6 +39,7 @@ static CUSTOMDRAWPROC g_CustomDrawProc; static int g_CustomDrawCount; static DRAWITEMSTRUCT g_DrawItem; static BOOL g_DrawItemReceived; +static DWORD g_customheight; static EXPECTEDNOTIFY expectedNotify[10]; static INT nExpectedNotify = 0; @@ -821,7 +822,7 @@ static void test_hdm_getitemrect(HWND hParent) expect(160, rect.right); todo_wine { - expect(18, rect.bottom); + expect(g_customheight, rect.bottom); } retVal = SendMessage(hChild, HDM_GETITEMRECT, 0, (LPARAM) &rect); @@ -833,7 +834,7 @@ static void test_hdm_getitemrect(HWND hParent) expect(80, rect.right); todo_wine { - expect(18, rect.bottom); + expect(g_customheight, rect.bottom); } retVal = SendMessage(hChild, HDM_GETITEMRECT, 10, (LPARAM) &rect); ok(retVal == 0, "Getting rect of nonexistent item should return 0, got %d\n", retVal); @@ -892,7 +893,7 @@ static void test_hdm_hittest(HWND hParent) HDHITTESTINFO hdHitTestInfo; const int firstItemRightBoundary = 80; const int secondItemRightBoundary = 160; - const int bottomBoundary = 18; + const int bottomBoundary = g_customheight; pt.x = firstItemRightBoundary - 1; pt.y = bottomBoundary - 1; @@ -1206,7 +1207,7 @@ static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm) { case 0: /* don't test dwItemSpec - it's 0 no comctl5 but 1308756 on comctl6 */ - TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, 18); + TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight); return 0; } @@ -1224,16 +1225,16 @@ static LRESULT customdraw_2(int n, NMCUSTOMDRAW *nm) switch (n) { case 0: - TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, 18); + TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight); return CDRF_NOTIFYITEMDRAW; case 1: - TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 0, 0, 0, 0, 50, 18); + TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 0, 0, 0, 0, 50, g_customheight); return 0; case 2: - TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 1, 5, 50, 0, 150, 18); + TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 1, 5, 50, 0, 150, g_customheight); return 0; case 3: - TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, 18); + TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, g_customheight); return 0; } @@ -1251,19 +1252,19 @@ static LRESULT customdraw_3(int n, NMCUSTOMDRAW *nm) switch (n) { case 0: - TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, 18); + TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight); return CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYPOSTERASE|CDRF_NOTIFYPOSTPAINT|CDRF_SKIPDEFAULT; case 1: - TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 0, 0, 0, 0, 50, 18); + TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 0, 0, 0, 0, 50, g_customheight); return 0; case 2: - TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 1, 5, 50, 0, 150, 18); + TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 1, 5, 50, 0, 150, g_customheight); return 0; case 3: - TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, 18); + TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, g_customheight); return 0; case 4: - TEST_NMCUSTOMDRAW(CDDS_POSTPAINT, -1, 0, 0, 0, 670, 18); + TEST_NMCUSTOMDRAW(CDDS_POSTPAINT, -1, 0, 0, 0, 670, g_customheight); return 0; } @@ -1282,16 +1283,16 @@ static LRESULT customdraw_4(int n, NMCUSTOMDRAW *nm) switch (n) { case 0: - TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, 18); + TEST_NMCUSTOMDRAW(CDDS_PREPAINT, -1, 0, 0, 0, 670, g_customheight); return CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYPOSTPAINT; case 1: - TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 0, 0, 0, 0, 50, 18); + TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 0, 0, 0, 0, 50, g_customheight); return 0; case 2: - TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, 18); + TEST_NMCUSTOMDRAW(CDDS_ITEMPREPAINT, 2, 10, 150, 0, 300, g_customheight); return 0; case 3: - TEST_NMCUSTOMDRAW(CDDS_POSTPAINT, -1, 0, 0, 0, 670, 18); + TEST_NMCUSTOMDRAW(CDDS_POSTPAINT, -1, 0, 0, 0, 670, g_customheight); return 0; } @@ -1317,9 +1318,9 @@ static void test_customdraw(void) CHAR name[] = "Test"; hWndHeader = create_header_control(); GetClientRect(hWndHeader, &rect); - ok(rect.right - rect.left == 670 && rect.bottom - rect.top == 18, - "Tests will fail as header size is %dx%d instead of 670x18\n", - rect.right - rect.left, rect.bottom - rect.top); + ok(rect.right - rect.left == 670 && rect.bottom - rect.top == g_customheight, + "Tests will fail as header size is %dx%d instead of 670x%d\n", + rect.right - rect.left, rect.bottom - rect.top, g_customheight); for (i = 0; i < 3; i++) { @@ -1496,6 +1497,9 @@ static int init(void) BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); WNDCLASSA wc; INITCOMMONCONTROLSEX iccex; + TEXTMETRICA tm; + HFONT hOldFont; + HDC hdc; hComctl32 = GetModuleHandleA("comctl32.dll"); pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); @@ -1521,6 +1525,17 @@ static int init(void) wc.lpfnWndProc = HeaderTestWndProc; RegisterClassA(&wc); + /* The height of the header control depends on the height of the system font. + The height of the system font is dpi dependent */ + hdc = GetDC(0); + hOldFont = SelectObject(hdc, GetStockObject(SYSTEM_FONT)); + GetTextMetricsA(hdc, &tm); + /* 2 dot extra space are needed for the border */ + g_customheight = tm.tmHeight + 2; + trace("customdraw height: %d (dpi: %d)\n", g_customheight, GetDeviceCaps(hdc, LOGPIXELSY)); + SelectObject(hdc, hOldFont); + ReleaseDC(0, hdc); + hHeaderParentWnd = CreateWindowExA(0, "HeaderTestClass", "Header test", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 672+2*GetSystemMetrics(SM_CXSIZEFRAME), 226+GetSystemMetrics(SM_CYCAPTION)+2*GetSystemMetrics(SM_CYSIZEFRAME),
1
0
0
0
Alexandre Julliard : urlmon/tests: Accept IInternetProtocolEx interface id.
by Alexandre Julliard
14 Nov '08
14 Nov '08
Module: wine Branch: master Commit: d4226445d0739d3790c3896f63579f7318fb7bc7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d4226445d0739d3790c3896f6…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 14 12:08:26 2008 +0100 urlmon/tests: Accept IInternetProtocolEx interface id. --- dlls/urlmon/tests/protocol.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c index bdd5a85..55a6052 100644 --- a/dlls/urlmon/tests/protocol.c +++ b/dlls/urlmon/tests/protocol.c @@ -755,6 +755,12 @@ static HRESULT WINAPI Protocol_QueryInterface(IInternetProtocol *iface, REFIID r return S_OK; } + if(IsEqualGUID(&IID_IInternetProtocolEx, riid)) { + trace("IID_IInternetProtocolEx not supported\n"); + *ppv = NULL; + return E_NOINTERFACE; + } + if(IsEqualGUID(&IID_IInternetPriority, riid)) { *ppv = &InternetPriority; return S_OK;
1
0
0
0
Alexandre Julliard : include: Added the IInternetProtocolEx interface.
by Alexandre Julliard
14 Nov '08
14 Nov '08
Module: wine Branch: master Commit: 9ab359314d0b6e44391fb455203f4ff4a0014e18 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9ab359314d0b6e44391fb4552…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 14 12:08:03 2008 +0100 include: Added the IInternetProtocolEx interface. Based on an old patch by Reece Dunn. --- include/urlmon.idl | 145 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 145 insertions(+), 0 deletions(-) diff --git a/include/urlmon.idl b/include/urlmon.idl index 866f9a8..a3dd39a 100644 --- a/include/urlmon.idl +++ b/include/urlmon.idl @@ -22,6 +22,10 @@ import "oleidl.idl"; import "servprov.idl"; import "msxml.idl"; +cpp_quote("#ifdef WINE_NO_UNICODE_MACROS") +cpp_quote("#undef GetUserName") +cpp_quote("#endif") + interface IInternetProtocolSink; /***************************************************************************** @@ -1363,6 +1367,147 @@ typedef enum _tagINTERNETFEATURELIST FEATURE_ENTRY_COUNT } INTERNETFEATURELIST; +/***************************************************************************** + * IUri interface + */ +[ + local, + object, + uuid(a39ee748-6a27-4817-a6f2-13914bef5890), + pointer_default(unique) +] +interface IUri : IUnknown +{ + typedef enum + { + Uri_PROPERTY_ABSOLUTE_URI = 0, + Uri_PROPERTY_STRING_START = Uri_PROPERTY_ABSOLUTE_URI, + Uri_PROPERTY_AUTHORITY = 1, + Uri_PROPERTY_DISPLAY_URI = 2, + Uri_PROPERTY_DOMAIN = 3, + Uri_PROPERTY_EXTENSION = 4, + Uri_PROPERTY_FRAGMENT = 5, + Uri_PROPERTY_HOST = 6, + Uri_PROPERTY_PASSWORD = 7, + Uri_PROPERTY_PATH = 8, + Uri_PROPERTY_PATH_AND_QUERY = 9, + Uri_PROPERTY_QUERY = 10, + Uri_PROPERTY_RAW_URI = 11, + Uri_PROPERTY_SCHEME_NAME = 12, + Uri_PROPERTY_USER_INFO = 13, + Uri_PROPERTY_USER_NAME = 14, + Uri_PROPERTY_STRING_LAST = Uri_PROPERTY_USER_NAME, + Uri_PROPERTY_HOST_TYPE = 15, + Uri_PROPERTY_DWORD_START = Uri_PROPERTY_HOST_TYPE, + Uri_PROPERTY_PORT = 16, + Uri_PROPERTY_SCHEME = 17, + Uri_PROPERTY_ZONE = 18, + Uri_PROPERTY_DWORD_LAST = Uri_PROPERTY_ZONE + } Uri_PROPERTY; + + HRESULT GetPropertyBSTR( + [in] Uri_PROPERTY uriProp, + [out] BSTR *pbstrProperty, + [in] DWORD dwFlags); + + HRESULT GetPropertyLength( + [in] Uri_PROPERTY uriProp, + [out] DWORD *pcchProperty, + [in] DWORD dwFlags); + + HRESULT GetPropertyDWORD( + [in] Uri_PROPERTY uriProp, + [out] DWORD *pdwProperty, + [in] DWORD dwFlags); + + HRESULT HasProperty( + [in] Uri_PROPERTY uriProp, + [out] BOOL *pfHasProperty); + + HRESULT GetAbsoluteUri( + [out] BSTR *pbstrAbsoluteUri); + + HRESULT GetAuthority( + [out] BSTR *pbstrAuthority); + + HRESULT GetDisplayUri( + [out] BSTR *pbstrDisplayString); + + HRESULT GetDomain( + [out] BSTR *pbstrDomain); + + HRESULT GetExtension( + [out] BSTR *pbstrExtension); + + HRESULT GetFragment( + [out] BSTR *pbstrFragment); + + HRESULT GetHost( + [out] BSTR *pbstrHost); + + HRESULT GetPassword( + [out] BSTR *pbstrPassword); + + HRESULT GetPath( + [out] BSTR *pbstrPath); + + HRESULT GetPathAndQuery( + [out] BSTR *pbstrPathAndQuery); + + HRESULT GetQuery( + [out] BSTR *pbstrQuery); + + HRESULT GetRawUri( + [out] BSTR *pbstrRawUri); + + HRESULT GetSchemeName( + [out] BSTR *pbstrSchemeName); + + HRESULT GetUserInfo( + [out] BSTR *pbstrUserInfo); + + HRESULT GetUserName( + [out] BSTR *pbstrUserName); + + HRESULT GetHostType( + [out] DWORD *pdwHostType); + + HRESULT GetPort( + [out] DWORD *pdwPort); + + HRESULT GetScheme( + [out] DWORD *pdwScheme); + + HRESULT GetZone( + [out] DWORD *pdwZone); + + HRESULT GetProperties( + [out] LPDWORD pdwFlags); + + HRESULT IsEqual( + [in] IUri *pUri, + [out] BOOL *pfEqual); +} + +/***************************************************************************** + * IInternetProtocolEx interface + */ +[ + local, + object, + uuid(c7a98e66-1010-492c-a1c8-c809e1f75905), + pointer_default(unique) +] +interface IInternetProtocolEx : IInternetProtocol +{ + HRESULT StartEx( + [in] IUri *pUri, + [in] IInternetProtocolSink *pOIProtSink, + [in] IInternetBindInfo *pOIBindInfo, + [in] DWORD grfPI, + [in] HANDLE *dwReserved); +} + cpp_quote("DEFINE_GUID(CLSID_InternetSecurityManager, 0x7b8a2d94, 0x0ac9, 0x11d1, 0x89, 0x6c, 0x00, 0xc0, 0x4f, 0xB6, 0xbf, 0xc4);") cpp_quote("DEFINE_GUID(CLSID_InternetZoneManager, 0x7B8A2D95, 0x0AC9, 0x11D1, 0x89, 0x6C, 0x00, 0xC0, 0x4F, 0xB6, 0xBF, 0xC4);") cpp_quote("DEFINE_GUID(IID_IAsyncMoniker, 0x79EAC9D3, 0xBAF9, 0x11CE, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B);")
1
0
0
0
David Adam : d3dx8: Change the debug channel of d3dx8 into the generic d3dx .
by Alexandre Julliard
14 Nov '08
14 Nov '08
Module: wine Branch: master Commit: 5aa32e84c377286acbfeb7b18273329f4535a9dc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5aa32e84c377286acbfeb7b18…
Author: David Adam <david.adam.cnrs(a)gmail.com> Date: Thu Nov 13 23:44:22 2008 +0100 d3dx8: Change the debug channel of d3dx8 into the generic d3dx. --- dlls/d3dx8/d3dx8_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx8/d3dx8_main.c b/dlls/d3dx8/d3dx8_main.c index aa186a0..dbb6dcd 100644 --- a/dlls/d3dx8/d3dx8_main.c +++ b/dlls/d3dx8/d3dx8_main.c @@ -32,7 +32,7 @@ #include "wine/unicode.h" #include "d3dx8_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d); +WINE_DEFAULT_DEBUG_CHANNEL(d3dx); HRESULT WINAPI D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer) { ID3DXBufferImpl *object;
1
0
0
0
Alexander Morozov : kernel32: NT drivers can handle IOCTL codes with HIWORD == 0.
by Alexandre Julliard
14 Nov '08
14 Nov '08
Module: wine Branch: master Commit: f52402e71a121ef967d046143087b9b5650b6ecd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f52402e71a121ef967d046143…
Author: Alexander Morozov <amorozov(a)etersoft.ru> Date: Thu Nov 13 13:15:10 2008 +0300 kernel32: NT drivers can handle IOCTL codes with HIWORD == 0. --- dlls/kernel32/vxd.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/vxd.c b/dlls/kernel32/vxd.c index 9227bad..1ce1060 100644 --- a/dlls/kernel32/vxd.c +++ b/dlls/kernel32/vxd.c @@ -339,12 +339,11 @@ BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, /* Check if this is a user defined control code for a VxD */ - if( HIWORD( dwIoControlCode ) == 0 ) + if (HIWORD( dwIoControlCode ) == 0 && (GetVersion() & 0x80000000)) { DeviceIoProc proc = get_vxd_proc( hDevice ); if (proc) return proc( dwIoControlCode, lpvInBuffer, cbInBuffer, lpvOutBuffer, cbOutBuffer, lpcbBytesReturned, lpOverlapped ); - return FALSE; } /* Not a VxD, let ntdll handle it */
1
0
0
0
Alexandre Julliard : shell32/tests: Properly cleanup the created favorites shell folder.
by Alexandre Julliard
14 Nov '08
14 Nov '08
Module: wine Branch: master Commit: c22e49740a0ac337efc93648d1399028c5ec0383 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c22e49740a0ac337efc93648d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Nov 14 11:18:34 2008 +0100 shell32/tests: Properly cleanup the created favorites shell folder. --- dlls/shell32/tests/shellpath.c | 49 +++++++++++++++------------------------ 1 files changed, 19 insertions(+), 30 deletions(-) diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index e62b695..d3f85b9 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -188,9 +188,8 @@ static void loadShell32(void) { shellVersion.cbSize = sizeof(shellVersion); pDllGetVersion(&shellVersion); - if (winetest_interactive) - printf("shell32 version is %d.%d\n", - shellVersion.dwMajorVersion, shellVersion.dwMinorVersion); + trace("shell32 version is %d.%d\n", + shellVersion.dwMajorVersion, shellVersion.dwMinorVersion); } #undef GET_PROC } @@ -730,7 +729,7 @@ static void testNonExistentPath1(void) { HRESULT hr; LPITEMIDLIST pidl; - char path[MAX_PATH]; + char *p, path[MAX_PATH]; /* test some failure cases first: */ hr = pSHGetFolderPathA(NULL, CSIDL_FAVORITES, NULL, @@ -740,16 +739,16 @@ static void testNonExistentPath1(void) pidl = NULL; hr = pSHGetFolderLocation(NULL, CSIDL_FAVORITES, NULL, 0, &pidl); - ok(hr == E_FAIL, - "SHGetFolderLocation returned 0x%08x, expected E_FAIL\n", hr); + ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), + "SHGetFolderLocation returned 0x%08x\n", hr); if (SUCCEEDED(hr) && pidl) IMalloc_Free(pMalloc, pidl); ok(!pSHGetSpecialFolderPathA(NULL, path, CSIDL_FAVORITES, FALSE), "SHGetSpecialFolderPath succeeded, expected failure\n"); pidl = NULL; hr = pSHGetSpecialFolderLocation(NULL, CSIDL_FAVORITES, &pidl); - ok(hr == E_FAIL, "SHGetFolderLocation returned 0x%08x, expected E_FAIL\n", - hr); + ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), + "SHGetFolderLocation returned 0x%08x\n", hr); if (SUCCEEDED(hr) && pidl) IMalloc_Free(pMalloc, pidl); /* now test success: */ @@ -759,8 +758,7 @@ static void testNonExistentPath1(void) { BOOL ret; - if (winetest_interactive) - printf("CSIDL_FAVORITES was changed to %s\n", path); + trace("CSIDL_FAVORITES was changed to %s\n", path); ret = CreateDirectoryA(path, NULL); ok(!ret, "CreateDirectoryA succeeded but should have failed " @@ -770,6 +768,13 @@ static void testNonExistentPath1(void) "CreateDirectoryA failed with %d, " "expected ERROR_ALREADY_EXISTS\n", GetLastError()); + p = path + strlen(path); + strcpy(p, "\\desktop.ini"); + DeleteFileA(path); + *p = 0; + SetFileAttributesA( path, FILE_ATTRIBUTE_NORMAL ); + ret = RemoveDirectoryA(path); + ok( ret, "failed to remove %s error %u\n", path, GetLastError() ); } ok(SUCCEEDED(hr), "SHGetFolderPath(NULL, CSIDL_FAVORITES | CSIDL_FLAG_CREATE, " @@ -838,15 +843,13 @@ static void testNonExistentPath(void) memcpy(modifiedPath, originalPath, len); modifiedPath[len++] = '2'; modifiedPath[len++] = '\0'; - if (winetest_interactive) - printf("Changing CSIDL_FAVORITES to %s\n", modifiedPath); + trace("Changing CSIDL_FAVORITES to %s\n", modifiedPath); if (!RegSetValueExA(key, "Favorites", 0, type, (LPBYTE)modifiedPath, len)) { char buffer[MAX_PATH+20]; STARTUPINFOA startup; PROCESS_INFORMATION info; - HRESULT hr; sprintf(buffer, "%s tests/shellpath.c 1", selfname); memset(&startup, 0, sizeof(startup)); @@ -857,14 +860,8 @@ static void testNonExistentPath(void) &startup, &info); winetest_wait_child_process( info.hProcess ); - /* Query the path to be able to delete it below */ - hr = pSHGetFolderPathA(NULL, CSIDL_FAVORITES, NULL, - SHGFP_TYPE_CURRENT, modifiedPath); - ok(SUCCEEDED(hr), "SHGetFolderPathA failed: 0x%08x\n", hr); - /* restore original values: */ - if (winetest_interactive) - printf("Restoring CSIDL_FAVORITES to %s\n", originalPath); + trace("Restoring CSIDL_FAVORITES to %s\n", originalPath); RegSetValueExA(key, "Favorites", 0, type, (LPBYTE) originalPath, strlen(originalPath) + 1); RegFlushKey(key); @@ -878,21 +875,13 @@ static void testNonExistentPath(void) &startup, &info); ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "child process termination\n"); - - strcpy(buffer, modifiedPath); - strcat(buffer, "\\desktop.ini"); - DeleteFileA(buffer); - RemoveDirectoryA(modifiedPath); } } - else if (winetest_interactive) - printf("RegQueryValueExA(key, Favorites, ...) failed\n"); + else skip("RegQueryValueExA(key, Favorites, ...) failed\n"); if (key) RegCloseKey(key); } - else if (winetest_interactive) - printf("RegOpenKeyExA(HKEY_CURRENT_USER, %s, ...) failed\n", - userShellFolders); + else skip("RegOpenKeyExA(HKEY_CURRENT_USER, %s, ...) failed\n", userShellFolders); } START_TEST(shellpath)
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
74
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
Results per page:
10
25
50
100
200