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
August 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
2 participants
884 discussions
Start a n
N
ew thread
Thomas Mullaly : urlmon: Implemented a function which removes dot segments from paths of hierarchical URIs .
by Alexandre Julliard
03 Aug '10
03 Aug '10
Module: wine Branch: master Commit: 5758b068aedbdd97e83e1fa2848d0f601b257234 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5758b068aedbdd97e83e1fa28…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Thu Jul 22 22:49:44 2010 -0400 urlmon: Implemented a function which removes dot segments from paths of hierarchical URIs. --- dlls/urlmon/tests/uri.c | 205 +++++++++++++++++++++++++++++++++++++++++++++++ dlls/urlmon/uri.c | 94 +++++++++++++++++++++ 2 files changed, 299 insertions(+), 0 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=5758b068aedbdd97e83e1…
1
0
0
0
Thomas Mullaly : urlmon: Implemented canonicalization function for hierarchical URI paths.
by Alexandre Julliard
03 Aug '10
03 Aug '10
Module: wine Branch: master Commit: 300d0e1ad4aff3895c3c8db06c1c4bdd72892641 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=300d0e1ad4aff3895c3c8db06…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Mon Jul 19 21:05:30 2010 -0400 urlmon: Implemented canonicalization function for hierarchical URI paths. --- dlls/urlmon/tests/uri.c | 181 +++++++++++++++++++++++++++++++++++++++++++++++ dlls/urlmon/uri.c | 116 ++++++++++++++++++++++++++++++- 2 files changed, 296 insertions(+), 1 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=300d0e1ad4aff3895c3c8…
1
0
0
0
Thomas Mullaly : urlmon: Implemented a path parser for opaque URIs.
by Alexandre Julliard
03 Aug '10
03 Aug '10
Module: wine Branch: master Commit: 93d79ee18ee6bd7ebda63dc8c0557fd62c042e1b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=93d79ee18ee6bd7ebda63dc8c…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Sun Jul 18 20:50:12 2010 -0400 urlmon: Implemented a path parser for opaque URIs. --- dlls/urlmon/tests/uri.c | 33 ++++++++++++++++++++++++++++++++- dlls/urlmon/uri.c | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 2 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index 7cd11ff..acf6905 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -2245,6 +2245,34 @@ static const uri_properties uri_tests[] = { {URL_SCHEME_UNKNOWN,S_OK,FALSE}, {URLZONE_INVALID,E_NOTIMPL,FALSE} } + }, + { "urn:excepts:bad:%XY:encoded", 0, S_OK, FALSE, + Uri_HAS_ABSOLUTE_URI|Uri_HAS_DISPLAY_URI|Uri_HAS_PATH|Uri_HAS_PATH_AND_QUERY| + Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME, + TRUE, + { + {"urn:excepts:bad:%XY:encoded",S_OK,TRUE}, + {"",S_FALSE,FALSE}, + {"urn:excepts:bad:%XY:encoded",S_OK,TRUE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,TRUE}, + {"",S_FALSE,TRUE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE}, + {"excepts:bad:%XY:encoded",S_OK,TRUE}, + {"excepts:bad:%XY:encoded",S_OK,TRUE}, + {"",S_FALSE,TRUE}, + {"urn:excepts:bad:%XY:encoded",S_OK,FALSE}, + {"urn",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {Uri_HOST_UNKNOWN,S_OK,FALSE}, + {0,S_FALSE,FALSE}, + {URL_SCHEME_UNKNOWN,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } } }; @@ -2294,7 +2322,10 @@ static const invalid_uri invalid_uri_tests[] = { /* Invalid port with IPv6 address. */ {"http://[::ffff]:32xy",0,FALSE}, /* Not allowed to have backslashes with NO_CANONICALIZE. */ - {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE,FALSE} + {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE,FALSE}, + /* Not allowed to have invalid % encoded data in opaque URI path. */ + {"news:test%XX",0,FALSE}, + {"mailto:wine@winehq%G8.com",0,FALSE} }; typedef struct _uri_equality { diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 9ab1dda..1b98b1a 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -1553,6 +1553,37 @@ static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD f return TRUE; } +/* Parses the path of a opaque URI (much less strict then the parser + * for a hierarchical URI). + * + * NOTE: + * Windows allows invalid % encoded data to appear in opaque URI paths + * for unknown scheme types. + */ +static BOOL parse_path_opaque(const WCHAR **ptr, parse_data *data, DWORD flags) { + const BOOL known_scheme = data->scheme_type != URL_SCHEME_UNKNOWN; + + data->path = *ptr; + + while(!is_path_delim(**ptr)) { + if(**ptr == '%' && known_scheme) { + if(!check_pct_encoded(ptr)) { + *ptr = data->path; + data->path = NULL; + return FALSE; + } else + continue; + } + + ++(*ptr); + } + + data->path_len = *ptr - data->path; + TRACE("(%p %p %x): Parsed opaque URI path %s len=%d\n", ptr, data, flags, + debugstr_wn(data->path, data->path_len), data->path_len); + return TRUE; +} + /* Determines how the URI should be parsed after the scheme information. * * If the scheme is followed, by "//" then, it is treated as an hierarchical URI @@ -1615,7 +1646,9 @@ static BOOL parse_hierpart(const WCHAR **ptr, parse_data *data, DWORD flags) { TRACE("(%p %p %x): Treating URI as an opaque URI.\n", ptr, data, flags); data->is_opaque = TRUE; - /* TODO: Handle opaque URI's, parse path. */ + if(!parse_path_opaque(ptr, data, flags)) + return FALSE; + return TRUE; }
1
0
0
0
Thomas Mullaly : urlmon: Implemented a path parser for hierarchical URIs.
by Alexandre Julliard
03 Aug '10
03 Aug '10
Module: wine Branch: master Commit: 0ecec6d7c01050ac5b97a8bab7b9d4177f934b98 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0ecec6d7c01050ac5b97a8bab…
Author: Thomas Mullaly <thomas.mullaly(a)gmail.com> Date: Sun Jul 18 10:27:21 2010 -0400 urlmon: Implemented a path parser for hierarchical URIs. --- dlls/urlmon/tests/uri.c | 32 ++++++++++++++++++- dlls/urlmon/uri.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 109 insertions(+), 2 deletions(-) diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c index b87b9a3..7cd11ff 100644 --- a/dlls/urlmon/tests/uri.c +++ b/dlls/urlmon/tests/uri.c @@ -2217,6 +2217,34 @@ static const uri_properties uri_tests[] = { {URL_SCHEME_HTTP,S_OK,FALSE}, {URLZONE_INVALID,E_NOTIMPL,FALSE} } + }, + { "zip://www.google.com\\test", Uri_CREATE_NO_CANONICALIZE, S_OK, FALSE, + Uri_HAS_ABSOLUTE_URI|Uri_HAS_AUTHORITY|Uri_HAS_DISPLAY_URI|Uri_HAS_DOMAIN| + Uri_HAS_HOST|Uri_HAS_RAW_URI|Uri_HAS_SCHEME_NAME|Uri_HAS_HOST_TYPE|Uri_HAS_SCHEME, + TRUE, + { + {"zip://www.google.com\\test",S_OK,TRUE}, + {"
www.google.com\\test
",S_OK,FALSE}, + {"zip://www.google.com\\test",S_OK,TRUE}, + {"google.com\\test",S_OK,FALSE}, + {"",S_FALSE,TRUE}, + {"",S_FALSE,TRUE}, + {"
www.google.com\\test
",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,TRUE}, + {"",S_FALSE,TRUE}, + {"",S_FALSE,TRUE}, + {"zip://www.google.com\\test",S_OK,FALSE}, + {"zip",S_OK,FALSE}, + {"",S_FALSE,FALSE}, + {"",S_FALSE,FALSE} + }, + { + {Uri_HOST_DNS,S_OK,FALSE}, + {0,S_FALSE,FALSE}, + {URL_SCHEME_UNKNOWN,S_OK,FALSE}, + {URLZONE_INVALID,E_NOTIMPL,FALSE} + } } }; @@ -2264,7 +2292,9 @@ static const invalid_uri invalid_uri_tests[] = { /* Invalid port with IPv4 address. */ {"
http://www.winehq.org:1abcd
",0,FALSE}, /* Invalid port with IPv6 address. */ - {"http://[::ffff]:32xy",0,FALSE} + {"http://[::ffff]:32xy",0,FALSE}, + /* Not allowed to have backslashes with NO_CANONICALIZE. */ + {"gopher://www.google.com\\test",Uri_CREATE_NO_CANONICALIZE,FALSE} }; typedef struct _uri_equality { diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c index 20d8bb1..9ab1dda 100644 --- a/dlls/urlmon/uri.c +++ b/dlls/urlmon/uri.c @@ -113,6 +113,9 @@ typedef struct { const WCHAR *port; DWORD port_len; USHORT port_value; + + const WCHAR *path; + DWORD path_len; } parse_data; static const CHAR hexDigits[] = "0123456789ABCDEF"; @@ -257,6 +260,10 @@ static inline BOOL is_hexdigit(WCHAR val) { (val >= '0' && val <= '9')); } +static inline BOOL is_path_delim(WCHAR val) { + return (!val || val == '#' || val == '?'); +} + /* Computes the size of the given IPv6 address. * Each h16 component is 16bits, if there is an IPv4 address, it's * 32bits. If there's an elision it can be 16bits to 128bits, depending @@ -1482,6 +1489,70 @@ static BOOL parse_authority(const WCHAR **ptr, parse_data *data, DWORD flags) { return TRUE; } +/* Attempts to parse the path information of a hierarchical URI. */ +static BOOL parse_path_hierarchical(const WCHAR **ptr, parse_data *data, DWORD flags) { + const WCHAR *start = *ptr; + static const WCHAR slash[] = {'/',0}; + + if(is_path_delim(**ptr)) { + if(data->scheme_type == URL_SCHEME_WILDCARD) { + /* Wildcard schemes don't get a '/' attached if their path is + * empty. + */ + data->path = NULL; + data->path_len = 0; + } else if(!(flags & Uri_CREATE_NO_CANONICALIZE)) { + /* If the path component is empty, then a '/' is added. */ + data->path = slash; + data->path_len = 1; + } + } else { + while(!is_path_delim(**ptr)) { + if(**ptr == '%' && data->scheme_type != URL_SCHEME_UNKNOWN && + data->scheme_type != URL_SCHEME_FILE) { + if(!check_pct_encoded(ptr)) { + *ptr = start; + return FALSE; + } else + continue; + } else if(**ptr == '\\') { + /* Not allowed to have a backslash if NO_CANONICALIZE is set + * and the scheme is known type (but not a file scheme). + */ + if(flags & Uri_CREATE_NO_CANONICALIZE) { + if(data->scheme_type != URL_SCHEME_FILE && + data->scheme_type != URL_SCHEME_UNKNOWN) { + *ptr = start; + return FALSE; + } + } + } + + ++(*ptr); + } + + /* The only time a URI doesn't have a path is when + * the NO_CANONICALIZE flag is set and the raw URI + * didn't contain one. + */ + if(*ptr == start) { + data->path = NULL; + data->path_len = 0; + } else { + data->path = start; + data->path_len = *ptr - start; + } + } + + if(data->path) + TRACE("(%p %p %x): Parsed path %s len=%d\n", ptr, data, flags, + debugstr_wn(data->path, data->path_len), data->path_len); + else + TRACE("(%p %p %x): The URI contained no path\n", ptr, data, flags); + + return TRUE; +} + /* Determines how the URI should be parsed after the scheme information. * * If the scheme is followed, by "//" then, it is treated as an hierarchical URI @@ -1525,11 +1596,15 @@ static BOOL parse_hierpart(const WCHAR **ptr, parse_data *data, DWORD flags) { TRACE("(%p %p %x): Treating URI as an hierarchical URI.\n", ptr, data, flags); data->is_opaque = FALSE; + if(data->scheme_type == URL_SCHEME_FILE) + /* Skip past the "//" after the scheme (if any). */ + check_hierarchical(ptr); + /* TODO: Handle hierarchical URI's, parse authority then parse the path. */ if(!parse_authority(ptr, data, flags)) return FALSE; - return TRUE; + return parse_path_hierarchical(ptr, data, flags); } } @@ -1564,6 +1639,8 @@ static BOOL parse_uri(parse_data *data, DWORD flags) { if(!parse_hierpart(pptr, data, flags)) return FALSE; + /* TODO: Parse query and fragment (if the URI has one). */ + TRACE("(%p %x): FINISHED PARSING URI.\n", data, flags); return TRUE; }
1
0
0
0
Alexandre Julliard : winemenubuilder: Rename some variables to reflect the fact that we no longer use XPM format .
by Alexandre Julliard
03 Aug '10
03 Aug '10
Module: wine Branch: master Commit: e446a7c7bf146f82460f5d898b0ff309e3daadb2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e446a7c7bf146f82460f5d898…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Aug 2 20:28:58 2010 +0200 winemenubuilder: Rename some variables to reflect the fact that we no longer use XPM format. --- programs/winemenubuilder/winemenubuilder.c | 58 ++++++++++++---------------- 1 files changed, 25 insertions(+), 33 deletions(-) diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index 7a77358..b7971e4 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -372,7 +372,7 @@ static BOOL CALLBACK EnumResNameProc(HMODULE hModule, LPCWSTR lpszType, LPWSTR l return TRUE; } -static BOOL extract_icon32(LPCWSTR szFileName, int nIndex, char *szXPMFileName) +static BOOL extract_icon_from_module(LPCWSTR szFileName, int nIndex, const char *icon_name) { HMODULE hModule; HRSRC hResInfo; @@ -452,7 +452,7 @@ static BOOL extract_icon32(LPCWSTR szFileName, int nIndex, char *szXPMFileName) { if ((pIcon = LockResource(hResData))) { - if (reassemble_and_save_to_png(&iconDirEntry, pIcon, szXPMFileName, szFileName)) + if (reassemble_and_save_to_png(&iconDirEntry, pIcon, icon_name, szFileName)) ret = TRUE; else ret = FALSE; @@ -466,24 +466,16 @@ static BOOL extract_icon32(LPCWSTR szFileName, int nIndex, char *szXPMFileName) return ret; } -static BOOL ExtractFromEXEDLL(LPCWSTR szFileName, int nIndex, char *szXPMFileName) +static int ExtractFromICO(LPCWSTR szFileName, const char *icon_name) { - if (!extract_icon32(szFileName, nIndex, szXPMFileName) /*&& - !extract_icon16(szFileName, szXPMFileName)*/) - return FALSE; - return TRUE; -} - -static int ExtractFromICO(LPCWSTR szFileName, char *szXPMFileName) -{ - FILE *fICOFile = NULL; + FILE *fICOFile; ICONDIR iconDir; ICONDIRENTRY *pIconDirEntry = NULL; int nMax = 0, nMaxBits = 0; int nIndex = 0; void *pIcon = NULL; int i; - char *filename = NULL; + char *filename; IStream *icoStream = NULL; HRESULT hr; @@ -536,7 +528,7 @@ static int ExtractFromICO(LPCWSTR szFileName, char *szXPMFileName) goto error; } - if (!SaveIconStreamAsPNG(icoStream, nIndex, szXPMFileName, szFileName)) + if (!SaveIconStreamAsPNG(icoStream, nIndex, icon_name, szFileName)) goto error; HeapFree(GetProcessHeap(), 0, pIcon); @@ -556,7 +548,7 @@ static int ExtractFromICO(LPCWSTR szFileName, char *szXPMFileName) return 0; } -static int ExtractFromFileType(LPCWSTR szFileName, char *szXPMFileName) +static int ExtractFromFileType(LPCWSTR szFileName, const char *icon_name) { int ret = 0; WCHAR *extension; @@ -590,7 +582,7 @@ static int ExtractFromFileType(LPCWSTR szFileName, char *szXPMFileName) WINE_TRACE("executable %s -> icon %s\n", wine_dbgstr_w(executable), wine_dbgstr_a(output_path)); } if (output_path) - ret = (rename(output_path, szXPMFileName) == 0); + ret = (rename(output_path, icon_name) == 0); end: HeapFree(GetProcessHeap(), 0, icon); @@ -599,11 +591,11 @@ end: return ret; } -static BOOL create_default_icon( char *filename ) +static BOOL create_default_icon( const char *filename ) { static const WCHAR user32W[] = {'u','s','e','r','3','2',0}; - return extract_icon32( user32W, -(INT_PTR)IDI_WINLOGO, filename ); + return extract_icon_from_module( user32W, -(INT_PTR)IDI_WINLOGO, filename ); } static unsigned short crc16(const char* string) @@ -737,7 +729,7 @@ static WCHAR* utf8_chars_to_wchars(LPCSTR string) static char *extract_icon( LPCWSTR path, int index, const char *destFilename, BOOL bWait ) { unsigned short crc; - char *iconsdir = NULL, *ico_path = NULL, *ico_name, *xpm_path = NULL; + char *iconsdir = NULL, *ico_path = NULL, *ico_name, *png_path = NULL; char* s; int n; @@ -781,37 +773,37 @@ static char *extract_icon( LPCWSTR path, int index, const char *destFilename, BO /* Try to treat the source file as an exe */ if (destFilename) - xpm_path=heap_printf("%s/%s.png",iconsdir,destFilename); + png_path=heap_printf("%s/%s.png",iconsdir,destFilename); else - xpm_path=heap_printf("%s/%04x_%s.%d.png",iconsdir,crc,ico_name,index); - if (xpm_path == NULL) + png_path=heap_printf("%s/%04x_%s.%d.png",iconsdir,crc,ico_name,index); + if (png_path == NULL) { WINE_ERR("could not extract icon %s, out of memory\n", wine_dbgstr_a(ico_name)); return NULL; } - if (ExtractFromEXEDLL( path, index, xpm_path )) + if (extract_icon_from_module( path, index, png_path )) goto end; /* Must be something else, ignore the index in that case */ if (destFilename) - sprintf(xpm_path,"%s/%s.png",iconsdir,destFilename); + sprintf(png_path,"%s/%s.png",iconsdir,destFilename); else - sprintf(xpm_path,"%s/%04x_%s.png",iconsdir,crc,ico_name); - if (ExtractFromICO( path, xpm_path)) + sprintf(png_path,"%s/%04x_%s.png",iconsdir,crc,ico_name); + if (ExtractFromICO( path, png_path)) goto end; - if (ExtractFromFileType( path, xpm_path )) + if (ExtractFromFileType( path, png_path )) goto end; - if (!bWait && create_default_icon( xpm_path )) + if (!bWait && create_default_icon( png_path )) goto end; - HeapFree( GetProcessHeap(), 0, xpm_path ); - xpm_path=NULL; + HeapFree( GetProcessHeap(), 0, png_path ); + png_path=NULL; end: HeapFree(GetProcessHeap(), 0, iconsdir); HeapFree(GetProcessHeap(), 0, ico_path); - return xpm_path; + return png_path; } static HKEY open_menus_reg_key(void) @@ -2815,12 +2807,12 @@ static void thumbnail_lnk(LPCWSTR lnkPath, LPCWSTR outputPath) if (szIconPath[0]) { - if (!ExtractFromEXEDLL(szIconPath, iconId, utf8OutputPath)) + if (!extract_icon_from_module(szIconPath, iconId, utf8OutputPath)) ExtractFromICO(szIconPath, utf8OutputPath); } else { - if (!ExtractFromEXEDLL(szPath, iconId, utf8OutputPath)) + if (!extract_icon_from_module(szPath, iconId, utf8OutputPath)) ExtractFromICO(szPath, utf8OutputPath); }
1
0
0
0
Huw Davies : rpcrt4: Add a missing STUBLESS_INITOUT case.
by Alexandre Julliard
02 Aug '10
02 Aug '10
Module: wine Branch: master Commit: 300536d88e0370d66391759fde414aa3accbc467 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=300536d88e0370d66391759fd…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Aug 2 15:24:53 2010 +0100 rpcrt4: Add a missing STUBLESS_INITOUT case. --- dlls/rpcrt4/ndr_stubless.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index ed7912f..243c55a 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -1258,6 +1258,8 @@ static LONG_PTR *stub_do_old_args(MIDL_STUB_MESSAGE *pStubMsg, if (pParam->param_direction == RPC_FC_IN_PARAM_BASETYPE) call_freer(pStubMsg, pArg, pTypeFormat); break; + case STUBLESS_INITOUT: + break; case STUBLESS_UNMARSHAL: if (pParam->param_direction == RPC_FC_IN_PARAM_BASETYPE) call_unmarshaller(pStubMsg, &pArg, pTypeFormat, 0); @@ -1512,13 +1514,6 @@ LONG WINAPI NdrStubCall2( if (pThis) *(void **)args = ((CStdStubBuffer *)pThis)->pvServerObject; - /* order of phases: - * 1. STUBLESS_UNMARHSAL - unmarshal [in] params from buffer - * 2. STUBLESS_CALLSERVER - send/receive buffer - * 3. STUBLESS_CALCSIZE - get [out] buffer size - * 4. STUBLESS_GETBUFFER - allocate [out] buffer - * 5. STUBLESS_MARHSAL - marshal [out] params to buffer - */ for (phase = STUBLESS_UNMARSHAL; phase <= STUBLESS_FREE; phase++) { TRACE("phase = %d\n", phase);
1
0
0
0
Uwe Bonnes : wininet: Add const qualifier after openssl version check.
by Alexandre Julliard
02 Aug '10
02 Aug '10
Module: wine Branch: master Commit: 53391a344546b3e71a302ae2985b03f73756ad4d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=53391a344546b3e71a302ae29…
Author: Uwe Bonnes <bon(a)elektron.ikp.physik.tu-darmstadt.de> Date: Mon Jul 26 18:41:00 2010 +0200 wininet: Add const qualifier after openssl version check. --- dlls/winhttp/net.c | 5 +++++ dlls/wininet/netconnection.c | 5 +++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index e60bd16..573f108 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -38,6 +38,7 @@ #endif #ifdef HAVE_OPENSSL_SSL_H # include <openssl/ssl.h> +# include <openssl/opensslv.h> #undef FAR #undef DSA #endif @@ -91,7 +92,11 @@ static CRITICAL_SECTION init_ssl_cs = { &init_ssl_cs_debug, -1, 0, 0, 0, 0 }; static void *libssl_handle; static void *libcrypto_handle; +#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER> 0x1000000) +static const SSL_METHOD *method; +#else static SSL_METHOD *method; +#endif static SSL_CTX *ctx; static int hostname_idx; static int error_idx; diff --git a/dlls/wininet/netconnection.c b/dlls/wininet/netconnection.c index abd7415..54ca51b 100644 --- a/dlls/wininet/netconnection.c +++ b/dlls/wininet/netconnection.c @@ -60,6 +60,7 @@ #endif #ifdef HAVE_OPENSSL_SSL_H # include <openssl/ssl.h> +# include <openssl/opensslv.h> #undef FAR #undef DSA #endif @@ -113,7 +114,11 @@ static CRITICAL_SECTION init_ssl_cs = { &init_ssl_cs_debug, -1, 0, 0, 0, 0 }; static void *OpenSSL_ssl_handle; static void *OpenSSL_crypto_handle; +#if defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER> 0x1000000) +static const SSL_METHOD *meth; +#else static SSL_METHOD *meth; +#endif static SSL_CTX *ctx; static int hostname_idx; static int error_idx;
1
0
0
0
Jeff Latimer : msvcirt: Add some stubs.
by Alexandre Julliard
02 Aug '10
02 Aug '10
Module: wine Branch: master Commit: 1510698b5656e74c37c70c7630c9896c1434a0ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1510698b5656e74c37c70c763…
Author: Jeff Latimer <lats(a)yless4u.com.au> Date: Sat Jul 31 18:11:44 2010 +1000 msvcirt: Add some stubs. --- dlls/msvcirt/msvcirt.c | 62 +++++++++++++++++++++++++++++++++++++++++++++ dlls/msvcirt/msvcirt.spec | 12 ++++---- 2 files changed, 68 insertions(+), 6 deletions(-) diff --git a/dlls/msvcirt/msvcirt.c b/dlls/msvcirt/msvcirt.c index 924e84c..b15f410 100644 --- a/dlls/msvcirt/msvcirt.c +++ b/dlls/msvcirt/msvcirt.c @@ -29,8 +29,16 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcirt); typedef struct { LPVOID VTable; +} class_ios; + +typedef struct { + LPVOID VTable; } class_ostream; +typedef struct { + LPVOID VTable; +} class_strstreambuf; + #ifdef __i386__ /* thiscall functions are i386-specific */ #define THISCALL(func) __thiscall_ ## func @@ -51,6 +59,39 @@ typedef struct { #endif /* __i386__ */ /****************************************************************** + * ??1ios@@UAE@XZ (MSVCRTI.@) + * class ios & __thiscall ios::-ios<<(void) + */ +DEFINE_THISCALL_WRAPPER(MSVCIRT_ios_sl_void,4) +void * __stdcall MSVCIRT_ios_sl_void(class_ios * _this) +{ + FIXME("(%p) stub\n", _this); + return _this; +} + +/****************************************************************** + * ??0ostrstream@@QAE@XZ (MSVCRTI.@) + * class ostream & __thiscall ostrstream::ostrstream<<(void) + */ +DEFINE_THISCALL_WRAPPER(MSVCIRT_ostrstream_sl_void,4) +void * __stdcall MSVCIRT_ostrstream_sl_void(class_ostream * _this) +{ + FIXME("(%p) stub\n", _this); + return _this; +} + +/****************************************************************** + * ??6ostream@@QAEAAV0@E@Z (MSVCRTI.@) + * class ostream & __thiscall ostream::operator<<(unsigned char) + */ +DEFINE_THISCALL_WRAPPER(MSVCIRT_operator_sl_uchar,8) +void * __stdcall MSVCIRT_operator_sl_uchar(class_ostream * _this, unsigned char ch) +{ + FIXME("(%p)->(%c) stub\n", _this, ch); + return _this; +} + +/****************************************************************** * ??6ostream@@QAEAAV0@H@Z (MSVCRTI.@) * class ostream & __thiscall ostream::operator<<(int) */ @@ -93,6 +134,27 @@ void * CDECL MSVCIRT_endl(class_ostream * _this) return _this; } +/****************************************************************** + * ?ends@@YAAAVostream@@AAV1@@Z (MSVCRTI.@) + * class ostream & __cdecl ends(class ostream &) + */ +void * CDECL MSVCIRT_ends(class_ostream * _this) +{ + FIXME("(%p)->() stub\n", _this); + return _this; +} + +/****************************************************************** + * ?str@strstreambuf@@QAEPADXZ (MSVCRTI.@) + * class strstreambuf & __thiscall strstreambuf::str(class strstreambuf &) + */ +DEFINE_THISCALL_WRAPPER(MSVCIRT_str_sl_void,4) +char * __stdcall MSVCIRT_str_sl_void(class_strstreambuf * _this) +{ + FIXME("(%p)->() stub\n", _this); + return 0; +} + BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) { switch (reason) diff --git a/dlls/msvcirt/msvcirt.spec b/dlls/msvcirt/msvcirt.spec index 0efae20..d3618b2 100644 --- a/dlls/msvcirt/msvcirt.spec +++ b/dlls/msvcirt/msvcirt.spec @@ -47,7 +47,7 @@ @ stub ??0ostream_withassign@@QAE@XZ # __thiscall ostream_withassign::ostream_withassign(void) @ stub ??0ostrstream@@QAE@ABV0@@Z # __thiscall ostrstream::ostrstream(class ostrstream const &) @ stub ??0ostrstream@@QAE@PADHH@Z # __thiscall ostrstream::ostrstream(char *,int,int) -@ stub ??0ostrstream@@QAE@XZ # __thiscall ostrstream::ostrstream(void) +@ cdecl -i386 -norelay ??0ostrstream@@QAE@XZ(ptr) __thiscall_MSVCIRT_ostrstream_sl_void # __thiscall ostrstream::ostrstream(void) @ stub ??0stdiobuf@@QAE@ABV0@@Z # __thiscall stdiobuf::stdiobuf(class stdiobuf const &) @ stub ??0stdiobuf@@QAE@PAU_iobuf@@@Z # __thiscall stdiobuf::stdiobuf(struct _iobuf *) @ stub ??0stdiostream@@QAE@ABV0@@Z # __thiscall stdiostream::stdiostream(class stdiostream const &) @@ -69,7 +69,7 @@ @ stub ??1filebuf@@UAE@XZ # virtual __thiscall filebuf::~filebuf(void) @ stub ??1fstream@@UAE@XZ # virtual __thiscall fstream::~fstream(void) @ stub ??1ifstream@@UAE@XZ # virtual __thiscall ifstream::~ifstream(void) -@ stub ??1ios@@UAE@XZ # virtual __thiscall ios::~ios(void) +@ cdecl -i386 -norelay ??1ios@@UAE@XZ(ptr) __thiscall_MSVCIRT_ios_sl_void # virtual __thiscall ios::~ios(void) @ stub ??1iostream@@UAE@XZ # virtual __thiscall iostream::~iostream(void) @ stub ??1istream@@UAE@XZ # virtual __thiscall istream::~istream(void) @ stub ??1istream_withassign@@UAE@XZ # virtual __thiscall istream_withassign::~istream_withassign(void) @@ -78,7 +78,7 @@ @ stub ??1ofstream@@UAE@XZ # virtual __thiscall ofstream::~ofstream(void) @ stub ??1ostream@@UAE@XZ # virtual __thiscall ostream::~ostream(void) @ stub ??1ostream_withassign@@UAE@XZ # virtual __thiscall ostream_withassign::~ostream_withassign(void) -@ stub ??1ostrstream@@UAE@XZ # virtual __thiscall ostrstream::~ostrstream(void) +@ cdecl -i386 -norelay ??1ostrstream@@UAE@XZ(ptr) __thiscall_MSVCIRT_ostrstream_sl_void # virtual __thiscall ostrstream::~ostrstream(void) @ stub ??1stdiobuf@@UAE@XZ # virtual __thiscall stdiobuf::~stdiobuf(void) @ stub ??1stdiostream@@UAE@XZ # virtual __thiscall stdiostream::~stdiostream(void) @ stub ??1streambuf@@UAE@XZ # virtual __thiscall streambuf::~streambuf(void) @@ -131,7 +131,7 @@ @ stub ??5istream@@QAEAAV0@PAVstreambuf@@@Z # class istream & __thiscall istream::operator>>(class streambuf *) @ stub ??6ostream@@QAEAAV0@C@Z # class ostream & __thiscall ostream::operator<<(signed char) @ stub ??6ostream@@QAEAAV0@D@Z # class ostream & __thiscall ostream::operator<<(char) -@ stub ??6ostream@@QAEAAV0@E@Z # class ostream & __thiscall ostream::operator<<(unsigned char) +@ cdecl -i386 -norelay ??6ostream@@QAEAAV0@E@Z(ptr long) __thiscall_MSVCIRT_operator_sl_uchar # class ostream & __thiscall ostream::operator<<(unsigned char) @ stub ??6ostream@@QAEAAV0@F@Z # class ostream & __thiscall ostream::operator<<(short) @ stub ??6ostream@@QAEAAV0@G@Z # class ostream & __thiscall ostream::operator<<(unsigned short) @ cdecl -i386 -norelay ??6ostream@@QAEAAV0@H@Z(ptr long) __thiscall_MSVCIRT_operator_sl_int # class ostream & __thiscall ostream::operator<<(int) @@ -269,7 +269,7 @@ @ stub ?ebuf@streambuf@@IBEPADXZ # char * __thiscall streambuf::ebuf(void)const @ stub ?egptr@streambuf@@IBEPADXZ # char * __thiscall streambuf::egptr(void)const @ cdecl ?endl@@YAAAVostream@@AAV1@@Z(ptr) MSVCIRT_endl # class ostream & __cdecl endl(class ostream &) -@ stub ?ends@@YAAAVostream@@AAV1@@Z # class ostream & __cdecl ends(class ostream &) +@ cdecl ?ends@@YAAAVostream@@AAV1@@Z(ptr) MSVCIRT_ends # class ostream & __cdecl ends(class ostream &) @ stub ?eof@ios@@QBEHXZ # int __thiscall ios::eof(void)const @ stub ?epptr@streambuf@@IBEPADXZ # char * __thiscall streambuf::epptr(void)const # @ extern ?fLockcInit@ios@@0HA # static int ios::fLockcInit @@ -402,7 +402,7 @@ @ stub ?str@istrstream@@QAEPADXZ # char * __thiscall istrstream::str(void) @ stub ?str@ostrstream@@QAEPADXZ # char * __thiscall ostrstream::str(void) @ stub ?str@strstream@@QAEPADXZ # char * __thiscall strstream::str(void) -@ stub ?str@strstreambuf@@QAEPADXZ # char * __thiscall strstreambuf::str(void) +@ cdecl -i386 -norelay ?str@strstreambuf@@QAEPADXZ(ptr) __thiscall_MSVCIRT_str_sl_void # char * __thiscall strstreambuf::str(void) # @ extern ?sunk_with_stdio@ios@@0HA # static int ios::sunk_with_stdio @ stub ?sync@filebuf@@UAEHXZ # virtual int __thiscall filebuf::sync(void) @ stub ?sync@istream@@QAEHXZ # int __thiscall istream::sync(void)
1
0
0
0
Dmitry Timoshkov : gdi32: Do not crash on an invalid pointer passed to AddFontMemResourceEx.
by Alexandre Julliard
02 Aug '10
02 Aug '10
Module: wine Branch: master Commit: 81557b5e21551150296b811f7617bca4a75a0c70 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=81557b5e21551150296b811f7…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Mon Aug 2 15:35:04 2010 +0900 gdi32: Do not crash on an invalid pointer passed to AddFontMemResourceEx. --- dlls/gdi32/font.c | 21 +++++++++++- dlls/gdi32/freetype.c | 2 +- dlls/gdi32/tests/font.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++ include/wingdi.h | 1 + 4 files changed, 105 insertions(+), 2 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 29281f9..9ebf7b3 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -33,6 +33,7 @@ #include "winnls.h" #include "wownt32.h" #include "gdi_private.h" +#include "wine/exception.h" #include "wine/unicode.h" #include "wine/debug.h" @@ -3184,7 +3185,25 @@ BOOL WINAPI RemoveFontResourceW( LPCWSTR str ) */ HANDLE WINAPI AddFontMemResourceEx( PVOID pbFont, DWORD cbFont, PVOID pdv, DWORD *pcFonts) { - return WineEngAddFontMemResourceEx(pbFont, cbFont, pdv, pcFonts); + HANDLE ret; + DWORD num_fonts; + + ret = WineEngAddFontMemResourceEx(pbFont, cbFont, pdv, &num_fonts); + if (ret) + { + __TRY + { + *pcFonts = num_fonts; + } + __EXCEPT_PAGE_FAULT + { + WARN("page fault while writing to *pcFonts (%p)\n", pcFonts); + RemoveFontMemResourceEx(ret); + ret = 0; + } + __ENDTRY + } + return ret; } /*********************************************************************** diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 532278c..e2db1aa 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -2151,7 +2151,7 @@ HANDLE WineEngAddFontMemResourceEx(PVOID pbFont, DWORD cbFont, PVOID pdv, DWORD { TRACE("AddFontToList failed\n"); HeapFree(GetProcessHeap(), 0, pFontCopy); - return NULL; + return 0; } /* FIXME: is the handle only for use in RemoveFontMemResourceEx or should it be a true handle? * For now return something unique but quite random diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index d89132d..bbb54cd 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -44,6 +44,8 @@ DWORD (WINAPI *pGetGlyphIndicesA)(HDC hdc, LPCSTR lpstr, INT count, LPWORD pgi, DWORD (WINAPI *pGetGlyphIndicesW)(HDC hdc, LPCWSTR lpstr, INT count, LPWORD pgi, DWORD flags); BOOL (WINAPI *pGdiRealizationInfo)(HDC hdc, DWORD *); HFONT (WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDV *); +HANDLE (WINAPI *pAddFontMemResourceEx)(PVOID, DWORD, PVOID, DWORD *); +BOOL (WINAPI *pRemoveFontMemResourceEx)(HANDLE); static HMODULE hgdi32 = 0; @@ -59,6 +61,8 @@ static void init(void) pGetGlyphIndicesW = (void *)GetProcAddress(hgdi32, "GetGlyphIndicesW"); pGdiRealizationInfo = (void *)GetProcAddress(hgdi32, "GdiRealizationInfo"); pCreateFontIndirectExA = (void *)GetProcAddress(hgdi32, "CreateFontIndirectExA"); + pAddFontMemResourceEx = (void *)GetProcAddress(hgdi32, "AddFontMemResourceEx"); + pRemoveFontMemResourceEx = (void *)GetProcAddress(hgdi32, "RemoveFontMemResourceEx"); } static INT CALLBACK is_truetype_font_installed_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam) @@ -3142,6 +3146,84 @@ static void test_CreateFontIndirectEx(void) DeleteObject(hfont); } +static void free_font(void *font) +{ + UnmapViewOfFile(font); +} + +static void *load_font(const char *font_name, DWORD *font_size) +{ + char file_name[MAX_PATH]; + HANDLE file, mapping; + void *font; + + if (!GetWindowsDirectory(file_name, sizeof(file_name))) return NULL; + strcat(file_name, "\\fonts\\"); + strcat(file_name, font_name); + + file = CreateFile(file_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); + if (file == INVALID_HANDLE_VALUE) return NULL; + + *font_size = GetFileSize(file, NULL); + + mapping = CreateFileMapping(file, NULL, PAGE_READONLY, 0, 0, NULL); + if (!mapping) + { + CloseHandle(file); + return NULL; + } + + font = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0); + + CloseHandle(file); + CloseHandle(mapping); + return font; +} + +static void test_AddFontMemResource(void) +{ + void *font; + DWORD font_size, num_fonts; + HANDLE ret; + + if (!pAddFontMemResourceEx || !pRemoveFontMemResourceEx) + { + win_skip("AddFontMemResourceEx is not available on this platform\n"); + return; + } + + font = load_font("sserife.fon", &font_size); + if (!font) + { + skip("Unable to locate and load font sserife.fon\n"); + return; + } + + num_fonts = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = pAddFontMemResourceEx(font, font_size, NULL, &num_fonts); + ok(ret != 0, "AddFontMemResourceEx error %d\n", GetLastError()); + ok(num_fonts != 0xdeadbeef, "number of loaded fonts should not be 0xdeadbeef\n"); + ok(num_fonts != 0, "number of loaded fonts should not be 0\n"); + + free_font(font); + + SetLastError(0xdeadbeef); + ok(pRemoveFontMemResourceEx(ret), "RemoveFontMemResourceEx error %d\n", GetLastError()); + + /* test invalid pointer to number of loaded fonts */ + font = load_font("sserife.fon", &font_size); + ok(font != NULL, "Unable to locate and load font sserife.fon\n"); + + ret = pAddFontMemResourceEx(font, font_size, NULL, (void *)0xdeadbeef); + ok(!ret, "AddFontMemResourceEx should fail\n"); + + ret = pAddFontMemResourceEx(font, font_size, NULL, NULL); + ok(!ret, "AddFontMemResourceEx should fail\n"); + + free_font(font); +} + START_TEST(font) { init(); @@ -3162,6 +3244,7 @@ START_TEST(font) test_nonexistent_font(); test_orientation(); test_height_selection(); + test_AddFontMemResource(); /* On Windows Arial has a lot of default charset aliases such as Arial Cyr, * I'd like to avoid them in this test. diff --git a/include/wingdi.h b/include/wingdi.h index 3f5058f..fa68c23 100644 --- a/include/wingdi.h +++ b/include/wingdi.h @@ -3630,6 +3630,7 @@ WINGDIAPI UINT WINAPI RealizePalette(HDC); WINGDIAPI BOOL WINAPI Rectangle(HDC,INT,INT,INT,INT); WINGDIAPI BOOL WINAPI RectInRegion(HRGN,const RECT *); WINGDIAPI BOOL WINAPI RectVisible(HDC,const RECT*); +WINGDIAPI BOOL WINAPI RemoveFontMemResourceEx(HANDLE); WINGDIAPI BOOL WINAPI RemoveFontResourceA(LPCSTR); WINGDIAPI BOOL WINAPI RemoveFontResourceW(LPCWSTR); #define RemoveFontResource WINELIB_NAME_AW(RemoveFontResource)
1
0
0
0
David Hedberg : shell32: Replace some checks with calls to _ILIsEmpty().
by Alexandre Julliard
02 Aug '10
02 Aug '10
Module: wine Branch: master Commit: a690db9f1e78219d09d4a0771556bed3483fda6c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a690db9f1e78219d09d4a0771…
Author: David Hedberg <david.hedberg(a)gmail.com> Date: Mon Aug 2 14:33:40 2010 +0200 shell32: Replace some checks with calls to _ILIsEmpty(). --- dlls/shell32/brsfolder.c | 4 ++-- dlls/shell32/pidl.c | 4 ++-- dlls/shell32/shfldr_unixfs.c | 12 ++++++------ dlls/shell32/shlfolder.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c index 83ed1dd..77c55c8 100644 --- a/dlls/shell32/brsfolder.c +++ b/dlls/shell32/brsfolder.c @@ -239,7 +239,7 @@ static void InitializeTreeView( browse_info *info ) return; } - if (pidlChild && pidlChild->mkid.cb) { + if (!_ILIsEmpty(pidlChild)) { hr = IShellFolder_BindToObject(lpsfParent, pidlChild, 0, &IID_IShellFolder, (LPVOID*)&lpsfRoot); } else { lpsfRoot = lpsfParent; @@ -519,7 +519,7 @@ static LRESULT BrsFolder_Treeview_Expand( browse_info *info, NMTREEVIEWW *pnmtv if ((pnmtv->itemNew.state & TVIS_EXPANDEDONCE)) return 0; - if (lptvid->lpi && lptvid->lpi->mkid.cb) { + if (!_ILIsEmpty(lptvid->lpi)) { r = IShellFolder_BindToObject( lptvid->lpsfParent, lptvid->lpi, 0, &IID_IShellFolder, (LPVOID *)&lpsf2 ); } else { diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index a596ebf..1c9cf22 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -217,7 +217,7 @@ BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl) { TRACE_(shell)("pidl=%p\n",pidl); - if (!pidl || !pidl->mkid.cb) + if (_ILIsEmpty(pidl)) return FALSE; ILFindLastID(pidl)->mkid.cb = 0; return TRUE; @@ -2062,7 +2062,7 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR szOut, UINT uOutSize) */ LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl) { - if(pidl && pidl->mkid.cb != 0x00) + if(!_ILIsEmpty(pidl)) return (LPPIDLDATA)pidl->mkid.abID; return NULL; } diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index 9ae030f..35eb8e3 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -716,7 +716,7 @@ static HRESULT UNIXFS_initialize_target_folder(UnixFolder *This, const char *szB WCHAR *dos_name; /* Determine the path's length bytes */ - while (current && current->mkid.cb) { + while (!_ILIsEmpty(current)) { dwPathLen += UNIXFS_filename_from_shitemid(current, NULL) + 1; /* For the '/' */ current = ILGetNext(current); }; @@ -734,7 +734,7 @@ static HRESULT UNIXFS_initialize_target_folder(UnixFolder *This, const char *szB pNextDir += strlen(szBasePath); if (This->m_dwPathMode == PATHMODE_UNIX || IsEqualCLSID(&CLSID_MyDocuments, This->m_pCLSID)) This->m_dwAttributes |= SFGAO_FILESYSTEM; - while (current && current->mkid.cb) { + while (!_ILIsEmpty(current)) { pNextDir += UNIXFS_filename_from_shitemid(current, pNextDir); *pNextDir++ = '/'; current = ILGetNext(current); @@ -948,7 +948,7 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_BindToObject(IShellFolder2* iface TRACE("(iface=%p, pidl=%p, pbcReserver=%p, riid=%p, ppvOut=%p)\n", iface, pidl, pbcReserved, riid, ppvOut); - if (!pidl || !pidl->mkid.cb) + if (_ILIsEmpty(pidl)) return E_INVALIDARG; if (IsEqualCLSID(This->m_pCLSID, &CLSID_FolderShortcut)) { @@ -993,8 +993,8 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_CompareIDs(IShellFolder2* iface, TRACE("(iface=%p, lParam=%ld, pidl1=%p, pidl2=%p)\n", iface, lParam, pidl1, pidl2); - isEmpty1 = !pidl1 || !pidl1->mkid.cb; - isEmpty2 = !pidl2 || !pidl2->mkid.cb; + isEmpty1 = _ILIsEmpty(pidl1); + isEmpty2 = _ILIsEmpty(pidl2); if (isEmpty1 && isEmpty2) return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0); @@ -1160,7 +1160,7 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_GetDisplayNameOf(IShellFolder2* i if ((GET_SHGDN_FOR(uFlags) & SHGDN_FORPARSING) && (GET_SHGDN_RELATION(uFlags) != SHGDN_INFOLDER)) { - if (!pidl || !pidl->mkid.cb) { + if (_ILIsEmpty(pidl)) { lpName->uType = STRRET_WSTR; if (This->m_dwPathMode == PATHMODE_UNIX) { UINT len = MultiByteToWideChar(CP_UNIXCP, 0, This->m_pszPath, -1, NULL, 0); diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c index 230d7c6..9ab34a9 100644 --- a/dlls/shell32/shlfolder.c +++ b/dlls/shell32/shlfolder.c @@ -271,7 +271,7 @@ HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot, TRACE("(%p %s %p %s %p)\n", pidlRoot, debugstr_w(pathRoot), pidlComplete, debugstr_guid(riid), ppvOut); - if (!pidlRoot || !ppvOut || !pidlComplete || !pidlComplete->mkid.cb) + if (!pidlRoot || !ppvOut || _ILIsEmpty(pidlComplete)) return E_INVALIDARG; *ppvOut = NULL;
1
0
0
0
← Newer
1
...
80
81
82
83
84
85
86
...
89
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
Results per page:
10
25
50
100
200