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
December 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
1225 discussions
Start a n
N
ew thread
Hans Leidekker : winhttp: Validate parameters per component in WinHttpCrackUrl.
by Alexandre Julliard
11 Dec '08
11 Dec '08
Module: wine Branch: master Commit: b527d9905c7772984beb68728becfcae6be306b8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b527d9905c7772984beb68728…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Dec 11 13:56:40 2008 +0100 winhttp: Validate parameters per component in WinHttpCrackUrl. --- dlls/winhttp/url.c | 43 +++++++++++++++++++++---------------------- 1 files changed, 21 insertions(+), 22 deletions(-) diff --git a/dlls/winhttp/url.c b/dlls/winhttp/url.c index 41a46b7..f8c1972 100644 --- a/dlls/winhttp/url.c +++ b/dlls/winhttp/url.c @@ -34,10 +34,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(winhttp); static const WCHAR scheme_http[] = {'h','t','t','p',0}; static const WCHAR scheme_https[] = {'h','t','t','p','s',0}; -static BOOL set_component( WCHAR **str, DWORD *str_len, WCHAR *value, DWORD len ) +static BOOL set_component( WCHAR **str, DWORD *str_len, WCHAR *value, DWORD len, DWORD flags ) { if (!*str) { + if (len && (flags & ICU_DECODE)) + { + set_last_error( ERROR_INVALID_PARAMETER ); + return FALSE; + } *str = value; *str_len = len; } @@ -89,12 +94,6 @@ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONEN WCHAR *url_tmp; DWORD url_len = len + 1; - if (!uc->lpszScheme || !uc->lpszUserName || !uc->lpszPassword || - !uc->lpszHostName || !uc->lpszUrlPath || !uc-> lpszExtraInfo) - { - set_last_error( ERROR_INVALID_PARAMETER ); - return FALSE; - } if (!(url_tmp = HeapAlloc( GetProcessHeap(), 0, url_len * sizeof(WCHAR) ))) { set_last_error( ERROR_OUTOFMEMORY ); @@ -121,7 +120,7 @@ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONEN else if (p - url == 5 && !strncmpiW( url, scheme_https, 5 )) uc->nScheme = INTERNET_SCHEME_HTTPS; else goto exit; - if (!(set_component( &uc->lpszScheme, &uc->dwSchemeLength, (WCHAR *)url, p - url ))) goto exit; + if (!(set_component( &uc->lpszScheme, &uc->dwSchemeLength, (WCHAR *)url, p - url, flags ))) goto exit; p++; /* skip ':' */ if (!p[0] || p[0] != '/' || p[1] != '/') goto exit; @@ -132,42 +131,42 @@ BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONEN { if ((r = memchrW( p, ':', q - p ))) { - if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, r - p ))) goto exit; + if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, r - p, flags ))) goto exit; r++; - if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, r, q - r ))) goto exit; + if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, r, q - r, flags ))) goto exit; } else { - if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, q - p ))) goto exit; - if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0 ))) goto exit; + if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, q - p, flags ))) goto exit; + if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0, flags ))) goto exit; } p = q + 1; } else { - if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, NULL, 0 ))) goto exit; - if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0 ))) goto exit; + if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, NULL, 0, flags ))) goto exit; + if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0, flags ))) goto exit; } if ((q = memchrW( p, '/', len - (p - url) ))) { - if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, q - p ))) goto exit; + if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, q - p, flags ))) goto exit; if ((r = memchrW( q, '?', len - (q - url) ))) { - if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, r - q ))) goto exit; - if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, r, len - (r - url) ))) goto exit; + if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, r - q, flags ))) goto exit; + if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, r, len - (r - url), flags ))) goto exit; } else { - if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, len - (q - url) ))) goto exit; - if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0 ))) goto exit; + if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, len - (q - url), flags ))) goto exit; + if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0, flags ))) goto exit; } } else { - if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, len - (p - url) ))) goto exit; - if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, (WCHAR *)url + len, 0 ))) goto exit; - if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0 ))) goto exit; + if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, len - (p - url), flags ))) goto exit; + if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, (WCHAR *)url + len, 0, flags ))) goto exit; + if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0, flags ))) goto exit; } ret = TRUE;
1
0
0
0
Andrew Talbot : ws2_32: Sign-compare warnings fix.
by Alexandre Julliard
11 Dec '08
11 Dec '08
Module: wine Branch: master Commit: 8ee1634f41d4bdb4279d4b03ec28de49031d3e38 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8ee1634f41d4bdb4279d4b03e…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Wed Dec 10 21:55:35 2008 +0000 ws2_32: Sign-compare warnings fix. --- dlls/ws2_32/socket.c | 35 +++++++++++++++++++---------------- 1 files changed, 19 insertions(+), 16 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index b0caab6..b05067a 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -543,7 +543,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad) */ static int convert_sockopt(INT *level, INT *optname) { - int i; + unsigned int i; switch (*level) { case WS_SOL_SOCKET: @@ -659,7 +659,7 @@ static inline int do_block( int fd, int events, int timeout ) static int convert_af_w2u(int windowsaf) { - int i; + unsigned int i; for (i=0;i<sizeof(ws_af_map)/sizeof(ws_af_map[0]);i++) if (ws_af_map[i][0] == windowsaf) @@ -670,7 +670,7 @@ convert_af_w2u(int windowsaf) { static int convert_af_u2w(int unixaf) { - int i; + unsigned int i; for (i=0;i<sizeof(ws_af_map)/sizeof(ws_af_map[0]);i++) if (ws_af_map[i][1] == unixaf) @@ -681,7 +681,7 @@ convert_af_u2w(int unixaf) { static int convert_proto_w2u(int windowsproto) { - int i; + unsigned int i; for (i=0;i<sizeof(ws_proto_map)/sizeof(ws_proto_map[0]);i++) if (ws_proto_map[i][0] == windowsproto) @@ -692,7 +692,7 @@ convert_proto_w2u(int windowsproto) { static int convert_proto_u2w(int unixproto) { - int i; + unsigned int i; for (i=0;i<sizeof(ws_proto_map)/sizeof(ws_proto_map[0]);i++) if (ws_proto_map[i][1] == unixproto) @@ -703,7 +703,7 @@ convert_proto_u2w(int unixproto) { static int convert_socktype_w2u(int windowssocktype) { - int i; + unsigned int i; for (i=0;i<sizeof(ws_socktype_map)/sizeof(ws_socktype_map[0]);i++) if (ws_socktype_map[i][0] == windowssocktype) @@ -714,7 +714,7 @@ convert_socktype_w2u(int windowssocktype) { static int convert_socktype_u2w(int unixsocktype) { - int i; + unsigned int i; for (i=0;i<sizeof(ws_socktype_map)/sizeof(ws_socktype_map[0]);i++) if (ws_socktype_map[i][1] == unixsocktype) @@ -2523,7 +2523,7 @@ int WINAPI WS_recvfrom(SOCKET s, char *buf, INT len, int flags, static struct pollfd *fd_sets_to_poll( const WS_fd_set *readfds, const WS_fd_set *writefds, const WS_fd_set *exceptfds, int *count_ptr ) { - int i, j = 0, count = 0; + unsigned int i, j = 0, count = 0; struct pollfd *fds; if (readfds) count += readfds->fd_count; @@ -2561,7 +2561,7 @@ static struct pollfd *fd_sets_to_poll( const WS_fd_set *readfds, const WS_fd_set static void release_poll_fds( const WS_fd_set *readfds, const WS_fd_set *writefds, const WS_fd_set *exceptfds, struct pollfd *fds ) { - int i, j = 0; + unsigned int i, j = 0; if (readfds) { @@ -2589,7 +2589,7 @@ static void release_poll_fds( const WS_fd_set *readfds, const WS_fd_set *writefd static int get_poll_results( WS_fd_set *readfds, WS_fd_set *writefds, WS_fd_set *exceptfds, const struct pollfd *fds ) { - int i, j = 0, k, total = 0; + unsigned int i, j = 0, k, total = 0; if (readfds) { @@ -3418,7 +3418,8 @@ void WINAPI WS_freeaddrinfo(struct WS_addrinfo *res) /* helper functions for getaddrinfo()/getnameinfo() */ static int convert_aiflag_w2u(int winflags) { - int i, unixflags = 0; + unsigned int i; + int unixflags = 0; for (i=0;i<sizeof(ws_aiflag_map)/sizeof(ws_aiflag_map[0]);i++) if (ws_aiflag_map[i][0] & winflags) { @@ -3431,7 +3432,8 @@ static int convert_aiflag_w2u(int winflags) { } static int convert_niflag_w2u(int winflags) { - int i, unixflags = 0; + unsigned int i; + int unixflags = 0; for (i=0;i<sizeof(ws_niflag_map)/sizeof(ws_niflag_map[0]);i++) if (ws_niflag_map[i][0] & winflags) { @@ -3444,7 +3446,8 @@ static int convert_niflag_w2u(int winflags) { } static int convert_aiflag_u2w(int unixflags) { - int i, winflags = 0; + unsigned int i; + int winflags = 0; for (i=0;i<sizeof(ws_aiflag_map)/sizeof(ws_aiflag_map[0]);i++) if (ws_aiflag_map[i][1] & unixflags) { @@ -4752,7 +4755,7 @@ INT WINAPI WSAAddressToStringA( LPSOCKADDR sockaddr, DWORD len, LPWSAPROTOCOL_INFOA info, LPSTR string, LPDWORD lenstr ) { - INT size; + DWORD size; CHAR buffer[22]; /* 12 digits + 3 dots + ':' + 5 digits + '\0' */ CHAR *p; @@ -4813,7 +4816,7 @@ INT WINAPI WSAAddressToStringW( LPSOCKADDR sockaddr, DWORD len, LPWSAPROTOCOL_INFOW info, LPWSTR string, LPDWORD lenstr ) { - INT size; + DWORD size; WCHAR buffer[22]; /* 12 digits + 3 dots + ':' + 5 digits + '\0' */ static const WCHAR format[] = { '%','u','.','%','u','.','%','u','.','%','u',':','%','u',0 }; WCHAR *p; @@ -4836,7 +4839,7 @@ INT WINAPI WSAAddressToStringW( LPSOCKADDR sockaddr, DWORD len, p = strchrW( buffer, ':' ); if (!((SOCKADDR_IN *)sockaddr)->sin_port) *p = 0; - size = lstrlenW( buffer ); + size = strlenW( buffer ); if (*lenstr < size) {
1
0
0
0
Andrew Talbot : wintrust: Sign-compare warnings fix.
by Alexandre Julliard
11 Dec '08
11 Dec '08
Module: wine Branch: master Commit: 79ab433946494965942d99aecf2d008c9b681848 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=79ab433946494965942d99aec…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com> Date: Wed Dec 10 21:55:31 2008 +0000 wintrust: Sign-compare warnings fix. --- dlls/wintrust/asn.c | 3 ++- dlls/wintrust/crypt.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/wintrust/asn.c b/dlls/wintrust/asn.c index 3a51c91..4799a68 100644 --- a/dlls/wintrust/asn.c +++ b/dlls/wintrust/asn.c @@ -2195,7 +2195,8 @@ static BOOL WINAPI CRYPT_AsnDecodeInt(DWORD dwCertEncodingType, } else { - int val, i; + int val; + DWORD i; *pcbStructInfo = sizeof(int); if (blob->pbData[blob->cbData - 1] & 0x80) diff --git a/dlls/wintrust/crypt.c b/dlls/wintrust/crypt.c index 136f795..33cc6de 100644 --- a/dlls/wintrust/crypt.c +++ b/dlls/wintrust/crypt.c @@ -349,7 +349,7 @@ static BOOL WINTRUST_GetSignedMsgFromCabFile(SIP_SUBJECTINFO *pSubjectInfo, /* get basic offset & size info */ base_offset = SetFilePointer(pSubjectInfo->hFile, 0L, NULL, SEEK_CUR); - if (SetFilePointer(pSubjectInfo->hFile, 0, NULL, SEEK_END) == -1) + if (SetFilePointer(pSubjectInfo->hFile, 0, NULL, SEEK_END) == INVALID_SET_FILE_POINTER) { TRACE("seek error\n"); return FALSE; @@ -357,7 +357,7 @@ static BOOL WINTRUST_GetSignedMsgFromCabFile(SIP_SUBJECTINFO *pSubjectInfo, cabsize = SetFilePointer(pSubjectInfo->hFile, 0L, NULL, SEEK_CUR); if ((cabsize == -1) || (base_offset == -1) || - (SetFilePointer(pSubjectInfo->hFile, base_offset, NULL, SEEK_SET) == -1)) + (SetFilePointer(pSubjectInfo->hFile, base_offset, NULL, SEEK_SET) == INVALID_SET_FILE_POINTER)) { TRACE("seek error\n"); return FALSE; @@ -453,7 +453,7 @@ static BOOL WINTRUST_GetSignedMsgFromCabFile(SIP_SUBJECTINFO *pSubjectInfo, SetLastError(ERROR_INSUFFICIENT_BUFFER); return FALSE; } - if (SetFilePointer(pSubjectInfo->hFile, cert_offset, NULL, SEEK_SET) == -1) + if (SetFilePointer(pSubjectInfo->hFile, cert_offset, NULL, SEEK_SET) == INVALID_SET_FILE_POINTER) { ERR("couldn't seek to cert location\n"); return FALSE;
1
0
0
0
Nikolay Sivov : oleaut32: Added PICTYPE_NONE and PICTYPE_UNINITIALIZED to IPicture::Render.
by Alexandre Julliard
11 Dec '08
11 Dec '08
Module: wine Branch: master Commit: b6d50aed419a9390aa6b840de6a17b7c2698d1f9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b6d50aed419a9390aa6b840de…
Author: Nikolay Sivov <bunglehead(a)gmail.com> Date: Wed Dec 10 15:08:47 2008 +0300 oleaut32: Added PICTYPE_NONE and PICTYPE_UNINITIALIZED to IPicture::Render. --- dlls/oleaut32/olepicture.c | 8 +++++ dlls/oleaut32/tests/olepicture.c | 65 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 0 deletions(-) diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index 498ee53..bdce729 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -637,6 +637,10 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc, TRACE("prcWBounds (%d,%d) - (%d,%d)\n", prcWBounds->left, prcWBounds->top, prcWBounds->right, prcWBounds->bottom); + if(cx == 0 || cy == 0 || cxSrc == 0 || cySrc == 0){ + return CTL_E_INVALIDPROPERTYVALUE; + } + /* * While the documentation suggests this to be here (or after rendering?) * it does cause an endless recursion in my sample app. -MM 20010804 @@ -644,6 +648,10 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc, */ switch(This->desc.picType) { + case PICTYPE_UNINITIALIZED: + case PICTYPE_NONE: + /* nothing to do */ + return S_OK; case PICTYPE_BITMAP: { HBITMAP hbmpOld; diff --git a/dlls/oleaut32/tests/olepicture.c b/dlls/oleaut32/tests/olepicture.c index f81c419..89e99dd 100644 --- a/dlls/oleaut32/tests/olepicture.c +++ b/dlls/oleaut32/tests/olepicture.c @@ -25,6 +25,7 @@ #include <float.h> #define COBJMACROS +#define NONAMELESSUNION #include "wine/test.h" #include <windef.h> @@ -587,6 +588,69 @@ static void test_enhmetafile(void) GlobalFree(hglob); } +static void test_Render(void) +{ + IPicture *pic; + HRESULT hres; + short type; + PICTDESC desc; + HDC hdc = GetDC(0); + + /* test IPicture::Render return code on uninitialized picture */ + OleCreatePictureIndirect(NULL, &IID_IPicture, TRUE, (VOID**)&pic); + hres = IPicture_get_Type(pic, &type); + ok(hres == S_OK, "IPicture_get_Type does not return S_OK, but 0x%08x\n", hres); + ok(type == PICTYPE_UNINITIALIZED, "Expected type = PICTYPE_UNINITIALIZED, got = %d\n", type); + /* zero dimensions */ + hres = IPicture_Render(pic, hdc, 0, 0, 0, 0, 0, 0, 0, 0, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + hres = IPicture_Render(pic, hdc, 0, 0, 10, 10, 0, 0, 10, 0, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + hres = IPicture_Render(pic, hdc, 0, 0, 10, 10, 0, 0, 0, 10, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + hres = IPicture_Render(pic, hdc, 0, 0, 10, 10, 0, 0, 0, 0, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + hres = IPicture_Render(pic, hdc, 0, 0, 0, 10, 0, 0, 10, 10, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + hres = IPicture_Render(pic, hdc, 0, 0, 10, 0, 0, 0, 10, 10, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + hres = IPicture_Render(pic, hdc, 0, 0, 0, 0, 0, 0, 10, 10, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + /* nonzero dimensions, PICTYPE_UNINITIALIZED */ + hres = IPicture_Render(pic, hdc, 0, 0, 10, 10, 0, 0, 10, 10, NULL); + ole_expect(hres, S_OK); + IPicture_Release(pic); + + desc.cbSizeofstruct = sizeof(PICTDESC); + desc.picType = PICTYPE_ICON; + desc.u.icon.hicon = LoadIcon(NULL, IDI_APPLICATION); + if(!desc.u.icon.hicon){ + win_skip("LoadIcon failed. Skipping...\n"); + ReleaseDC(NULL, hdc); + return; + } + + OleCreatePictureIndirect(&desc, &IID_IPicture, TRUE, (VOID**)&pic); + /* zero dimensions, PICTYPE_ICON */ + hres = IPicture_Render(pic, hdc, 0, 0, 0, 0, 0, 0, 0, 0, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + hres = IPicture_Render(pic, hdc, 0, 0, 10, 10, 0, 0, 10, 0, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + hres = IPicture_Render(pic, hdc, 0, 0, 10, 10, 0, 0, 0, 10, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + hres = IPicture_Render(pic, hdc, 0, 0, 10, 10, 0, 0, 0, 0, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + hres = IPicture_Render(pic, hdc, 0, 0, 0, 10, 0, 0, 10, 10, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + hres = IPicture_Render(pic, hdc, 0, 0, 10, 0, 0, 0, 10, 10, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + hres = IPicture_Render(pic, hdc, 0, 0, 0, 0, 0, 0, 10, 10, NULL); + ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE); + IPicture_Release(pic); + + ReleaseDC(NULL, hdc); +} + START_TEST(olepicture) { hOleaut32 = GetModuleHandleA("oleaut32.dll"); @@ -613,6 +677,7 @@ START_TEST(olepicture) test_Invoke(); test_OleCreatePictureIndirect(); + test_Render(); }
1
0
0
0
Ricardo Filipe : advapi32: Add stub for UnregisterTraceGuids.
by Alexandre Julliard
11 Dec '08
11 Dec '08
Module: wine Branch: master Commit: a19051b9ae4ac0e35b94d74921925eedabc59739 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a19051b9ae4ac0e35b94d7492…
Author: Ricardo Filipe <ricardo_barbano(a)hotmail.com> Date: Fri Dec 5 18:02:05 2008 +0000 advapi32: Add stub for UnregisterTraceGuids. --- dlls/advapi32/advapi32.spec | 2 +- dlls/advapi32/eventlog.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletions(-) diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec index ec924ff..972ea7b 100644 --- a/dlls/advapi32/advapi32.spec +++ b/dlls/advapi32/advapi32.spec @@ -646,7 +646,7 @@ # @ stub UninstallApplication @ stdcall UnlockServiceDatabase (ptr) # @ stub UnregisterIdleTask -@ stub UnregisterTraceGuids +@ stdcall UnregisterTraceGuids(double) @ stub UpdateTraceA @ stub UpdateTraceW @ stub WdmWmiServiceMain diff --git a/dlls/advapi32/eventlog.c b/dlls/advapi32/eventlog.c index 03bb4f3..d7f50a5 100644 --- a/dlls/advapi32/eventlog.c +++ b/dlls/advapi32/eventlog.c @@ -490,3 +490,17 @@ ULONG WINAPI RegisterTraceGuidsA( WMIDPREQUEST RequestAddress, debugstr_a(MofResourceName), RegistrationHandle); return ERROR_CALL_NOT_IMPLEMENTED; } + +/****************************************************************************** + * UnregisterTraceGuids [ADVAPI32.@] + * + * See RegisterTraceGuids + * + * FIXME + * Stub. + */ +ULONG WINAPI UnregisterTraceGuids( TRACEHANDLE RegistrationHandle ) +{ + FIXME("%s: stub\n", wine_dbgstr_longlong(RegistrationHandle)); + return ERROR_CALL_NOT_IMPLEMENTED; +}
1
0
0
0
Ricardo Filipe : hal: Add stubs for ExAcquireFastMutex and ExReleaseFastMutex.
by Alexandre Julliard
11 Dec '08
11 Dec '08
Module: wine Branch: master Commit: bad677d58ac6a5ce1d7b448522527405aba11289 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bad677d58ac6a5ce1d7b44852…
Author: Ricardo Filipe <ricardo_barbano(a)hotmail.com> Date: Tue Dec 9 03:19:34 2008 +0000 hal: Add stubs for ExAcquireFastMutex and ExReleaseFastMutex. --- dlls/hal/hal.c | 20 ++++++++++++++++++++ dlls/hal/hal.spec | 4 ++-- include/ddk/wdm.h | 9 +++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/dlls/hal/hal.c b/dlls/hal/hal.c index 6390edf..5fce05e 100644 --- a/dlls/hal/hal.c +++ b/dlls/hal/hal.c @@ -54,6 +54,26 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntoskrnl); #ifdef DEFINE_FASTCALL1_ENTRYPOINT +DEFINE_FASTCALL1_ENTRYPOINT( ExAcquireFastMutex ) +VOID __regs_ExAcquireFastMutex(PFAST_MUTEX FastMutex) +#else +VOID ExAcquireFastMutex(PFAST_MUTEX FastMutex) +#endif +{ + FIXME("%p: stub\n", FastMutex); +} + +#ifdef DEFINE_FASTCALL1_ENTRYPOINT +DEFINE_FASTCALL1_ENTRYPOINT( ExReleaseFastMutex ) +VOID __regs_ExReleaseFastMutex(PFAST_MUTEX FastMutex) +#else +VOID ExReleaseFastMutex(PFAST_MUTEX FastMutex) +#endif +{ + FIXME("%p: stub\n", FastMutex); +} + +#ifdef DEFINE_FASTCALL1_ENTRYPOINT DEFINE_FASTCALL1_ENTRYPOINT( KfAcquireSpinLock ) KIRQL WINAPI __regs_KfAcquireSpinLock(PKSPIN_LOCK SpinLock) #else diff --git a/dlls/hal/hal.spec b/dlls/hal/hal.spec index 5afbee0..83eedea 100644 --- a/dlls/hal/hal.spec +++ b/dlls/hal/hal.spec @@ -1,5 +1,5 @@ -@ stub ExAcquireFastMutex -@ stub ExReleaseFastMutex +@ stdcall -norelay ExAcquireFastMutex(ptr) +@ stdcall -norelay ExReleaseFastMutex(ptr) @ stub ExTryToAcquireFastMutex @ stub HalClearSoftwareInterrupt @ stub HalRequestSoftwareInterrupt diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index 3e4528b..efc3f6a 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -132,6 +132,15 @@ typedef struct _IO_WORKITEM *PIO_WORKITEM; typedef struct _OBJECT_TYPE *POBJECT_TYPE; typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION; +typedef struct _FAST_MUTEX +{ + LONG Count; + PKTHREAD Owner; + ULONG Contention; + KEVENT Gate; + ULONG OldIrql; +} FAST_MUTEX, *PFAST_MUTEX; + #define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR)) typedef struct _VPB {
1
0
0
0
Stefan Dösinger : wined3d: Fix ARG_UNUSED and use it properly.
by Alexandre Julliard
11 Dec '08
11 Dec '08
Module: wine Branch: master Commit: f2f90b6965df8c8d14595960e75390fb6a6d50c2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f2f90b6965df8c8d14595960e…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue Dec 9 20:02:18 2008 +0100 wined3d: Fix ARG_UNUSED and use it properly. That bug was uncovered by Henri's change of the bitfield sizes. --- dlls/wined3d/utils.c | 20 ++++++++++---------- dlls/wined3d/wined3d_private.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 0eb5337..4e46013 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -1957,14 +1957,14 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting cop = stateblock->textureState[i][WINED3DTSS_COLOROP]; aop = stateblock->textureState[i][WINED3DTSS_ALPHAOP]; - carg1 = (args[cop] & ARG1) ? stateblock->textureState[i][WINED3DTSS_COLORARG1] : 0xffffffff; - carg2 = (args[cop] & ARG2) ? stateblock->textureState[i][WINED3DTSS_COLORARG2] : 0xffffffff; - carg0 = (args[cop] & ARG0) ? stateblock->textureState[i][WINED3DTSS_COLORARG0] : 0xffffffff; + carg1 = (args[cop] & ARG1) ? stateblock->textureState[i][WINED3DTSS_COLORARG1] : ARG_UNUSED; + carg2 = (args[cop] & ARG2) ? stateblock->textureState[i][WINED3DTSS_COLORARG2] : ARG_UNUSED; + carg0 = (args[cop] & ARG0) ? stateblock->textureState[i][WINED3DTSS_COLORARG0] : ARG_UNUSED; if(is_invalid_op(stateblock->wineD3DDevice, i, cop, carg1, carg2, carg0)) { - carg0 = 0xffffffff; - carg2 = 0xffffffff; + carg0 = ARG_UNUSED; + carg2 = ARG_UNUSED; carg1 = WINED3DTA_CURRENT; cop = WINED3DTOP_SELECTARG1; } @@ -1978,9 +1978,9 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting aarg2 = carg2; aarg0 = carg0; } else { - aarg1 = (args[aop] & ARG1) ? stateblock->textureState[i][WINED3DTSS_ALPHAARG1] : 0xffffffff; - aarg2 = (args[aop] & ARG2) ? stateblock->textureState[i][WINED3DTSS_ALPHAARG2] : 0xffffffff; - aarg0 = (args[aop] & ARG0) ? stateblock->textureState[i][WINED3DTSS_ALPHAARG0] : 0xffffffff; + aarg1 = (args[aop] & ARG1) ? stateblock->textureState[i][WINED3DTSS_ALPHAARG1] : ARG_UNUSED; + aarg2 = (args[aop] & ARG2) ? stateblock->textureState[i][WINED3DTSS_ALPHAARG2] : ARG_UNUSED; + aarg0 = (args[aop] & ARG0) ? stateblock->textureState[i][WINED3DTSS_ALPHAARG0] : ARG_UNUSED; } if(i == 0 && stateblock->textures[0] && @@ -2015,8 +2015,8 @@ void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_setting if(is_invalid_op(stateblock->wineD3DDevice, i, aop, aarg1, aarg2, aarg0)) { - aarg0 = 0xffffffff; - aarg2 = 0xffffffff; + aarg0 = ARG_UNUSED; + aarg2 = ARG_UNUSED; aarg1 = WINED3DTA_CURRENT; aop = WINED3DTOP_SELECTARG1; } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index b10b644..fe5569a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -922,7 +922,7 @@ enum dst_arg /***************************************************************************** * Fixed function pipeline replacements */ -#define ARG_UNUSED 0x3f +#define ARG_UNUSED 0xff struct texture_stage_op { unsigned cop : 8;
1
0
0
0
Stefan Dösinger : WineD3D: Abstract some ATIfs op debug TRACEs.
by Alexandre Julliard
11 Dec '08
11 Dec '08
Module: wine Branch: master Commit: fef73782ceb34c039e7d1fe92a200edf9a86aa35 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fef73782ceb34c039e7d1fe92…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Tue Dec 9 18:16:14 2008 +0100 WineD3D: Abstract some ATIfs op debug TRACEs. It makes the code more readable and will help us to merge the ALPHAOP and COLOROP code. --- dlls/wined3d/ati_fragment_shader.c | 382 +++++++++++++++++------------------- 1 files changed, 183 insertions(+), 199 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=fef73782ceb34c039e7d1…
1
0
0
0
Stefan Dösinger : wined3d: Don' t load INT and BOOL constants needlessly.
by Alexandre Julliard
11 Dec '08
11 Dec '08
Module: wine Branch: master Commit: 4916cd5478ff6fcf212eae3707bc5be063498040 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4916cd5478ff6fcf212eae370…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Thu Nov 27 01:21:36 2008 +0100 wined3d: Don't load INT and BOOL constants needlessly. --- dlls/wined3d/baseshader.c | 8 ++++++++ dlls/wined3d/glsl_shader.c | 24 ++++++++++++++++-------- dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/dlls/wined3d/baseshader.c b/dlls/wined3d/baseshader.c index 65dcf2a..8d6c28c 100644 --- a/dlls/wined3d/baseshader.c +++ b/dlls/wined3d/baseshader.c @@ -349,6 +349,8 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m max_loop_depth = cur_loop_depth; pToken += curOpcode->num_params; + /* Rep and Loop always use an integer constant for the control parameters */ + This->baseShader.uses_int_consts = TRUE; } else if (WINED3DSIO_ENDLOOP == curOpcode->opcode || WINED3DSIO_ENDREP == curOpcode->opcode) { cur_loop_depth--; @@ -494,6 +496,12 @@ HRESULT shader_get_registers_used(IWineD3DBaseShader *iface, struct shader_reg_m reg_maps->usesrelconstF = TRUE; } } + else if(WINED3DSPR_CONSTINT == regtype) { + This->baseShader.uses_int_consts = TRUE; + } + else if(WINED3DSPR_CONSTBOOL == regtype) { + This->baseShader.uses_bool_consts = TRUE; + } /* WINED3DSPR_TEXCRDOUT is the same as WINED3DSPR_OUTPUT. _OUTPUT can be > MAX_REG_TEXCRD and is used * in >= 3.0 shaders. Filter 3.0 shaders to prevent overflows, and also filter pixel shaders because TECRDOUT diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 6ec2591..3f54170 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -418,12 +418,16 @@ static void shader_glsl_load_constants( stateBlock->vertexShaderConstantF, constant_locations, constant_list); /* Load DirectX 9 integer constants/uniforms for vertex shader */ - shader_glsl_load_constantsI(vshader, gl_info, prog->vuniformI_locations, - stateBlock->vertexShaderConstantI, stateBlock->changed.vertexShaderConstantsI); + if(vshader->baseShader.uses_int_consts) { + shader_glsl_load_constantsI(vshader, gl_info, prog->vuniformI_locations, + stateBlock->vertexShaderConstantI, stateBlock->changed.vertexShaderConstantsI); + } /* Load DirectX 9 boolean constants/uniforms for vertex shader */ - shader_glsl_load_constantsB(vshader, gl_info, programId, - stateBlock->vertexShaderConstantB, stateBlock->changed.vertexShaderConstantsB); + if(vshader->baseShader.uses_bool_consts) { + shader_glsl_load_constantsB(vshader, gl_info, programId, + stateBlock->vertexShaderConstantB, stateBlock->changed.vertexShaderConstantsB); + } /* Upload the position fixup params */ GL_EXTCALL(glUniform4fvARB(prog->posFixup_location, 1, &deviceImpl->posFixup[0])); @@ -442,12 +446,16 @@ static void shader_glsl_load_constants( stateBlock->pixelShaderConstantF, constant_locations, constant_list); /* Load DirectX 9 integer constants/uniforms for pixel shader */ - shader_glsl_load_constantsI(pshader, gl_info, prog->puniformI_locations, - stateBlock->pixelShaderConstantI, stateBlock->changed.pixelShaderConstantsI); + if(pshader->baseShader.uses_int_consts) { + shader_glsl_load_constantsI(pshader, gl_info, prog->puniformI_locations, + stateBlock->pixelShaderConstantI, stateBlock->changed.pixelShaderConstantsI); + } /* Load DirectX 9 boolean constants/uniforms for pixel shader */ - shader_glsl_load_constantsB(pshader, gl_info, programId, - stateBlock->pixelShaderConstantB, stateBlock->changed.pixelShaderConstantsB); + if(pshader->baseShader.uses_bool_consts) { + shader_glsl_load_constantsB(pshader, gl_info, programId, + stateBlock->pixelShaderConstantB, stateBlock->changed.pixelShaderConstantsB); + } /* Upload the environment bump map matrix if needed. The needsbumpmat member specifies the texture stage to load the matrix from. * It can't be 0 for a valid texbem instruction. diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 5ac771f..b10b644 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2194,6 +2194,7 @@ typedef struct IWineD3DBaseShaderClass BOOL is_compiled; UINT cur_loop_depth, cur_loop_regno; BOOL load_local_constsF; + BOOL uses_bool_consts, uses_int_consts; /* Type of shader backend */ int shader_mode;
1
0
0
0
Alexandre Julliard : ntdll: Enforce correct protection values in virtual memory functions.
by Alexandre Julliard
11 Dec '08
11 Dec '08
Module: wine Branch: master Commit: a2089abd948564ff4aa930ebac8f8894b49a6f39 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a2089abd948564ff4aa930eba…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 11 14:05:42 2008 +0100 ntdll: Enforce correct protection values in virtual memory functions. --- dlls/kernel32/tests/virtual.c | 26 +++++++++++++++++++++++ dlls/ntdll/loader.c | 2 +- dlls/ntdll/virtual.c | 46 ++++++++++++++++++++++------------------ 3 files changed, 52 insertions(+), 22 deletions(-) diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 0e53a1c..0fdd69e 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -255,6 +255,32 @@ static void test_VirtualAlloc(void) ok(old_prot == PAGE_READONLY, "wrong old protection: got %04x instead of PAGE_READONLY\n", old_prot); + /* invalid protection values */ + SetLastError(0xdeadbeef); + addr2 = VirtualAlloc(NULL, 0x1000, MEM_RESERVE, 0); + ok(!addr2, "VirtualAlloc succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + addr2 = VirtualAlloc(NULL, 0x1000, MEM_COMMIT, 0); + ok(!addr2, "VirtualAlloc succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + addr2 = VirtualAlloc(addr1, 0x1000, MEM_COMMIT, PAGE_READONLY | PAGE_EXECUTE); + ok(!addr2, "VirtualAlloc succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ok(!VirtualProtect(addr1, 0x1000, PAGE_READWRITE | PAGE_EXECUTE_WRITECOPY, &old_prot), + "VirtualProtect succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + ok(!VirtualProtect(addr1, 0x1000, 0, &old_prot), "VirtualProtect succeeded\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError()); + + SetLastError(0xdeadbeef); ok(!VirtualFree(addr1, 0x10000, 0), "VirtualFree should fail with type 0\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %d, expected ERROR_INVALID_PARAMETER\n", GetLastError()); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 7526465..d3a0067 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1464,7 +1464,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file, size.QuadPart = 0; status = NtCreateSection( &mapping, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ, - &attr, &size, 0, SEC_IMAGE, file ); + &attr, &size, PAGE_READONLY, SEC_IMAGE, file ); if (status != STATUS_SUCCESS) return status; module = NULL; diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 9616477..da08e2f 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -503,7 +503,7 @@ static DWORD VIRTUAL_GetWin32Prot( BYTE vprot ) /*********************************************************************** - * VIRTUAL_GetProt + * get_vprot_flags * * Build page protections from Win32 flags. * @@ -513,41 +513,40 @@ static DWORD VIRTUAL_GetWin32Prot( BYTE vprot ) * RETURNS * Value of page protection flags */ -static BYTE VIRTUAL_GetProt( DWORD protect ) +static NTSTATUS get_vprot_flags( DWORD protect, unsigned int *vprot ) { - BYTE vprot; - switch(protect & 0xff) { case PAGE_READONLY: - vprot = VPROT_READ; + *vprot = VPROT_READ; break; case PAGE_READWRITE: - vprot = VPROT_READ | VPROT_WRITE; + *vprot = VPROT_READ | VPROT_WRITE; break; case PAGE_WRITECOPY: - vprot = VPROT_READ | VPROT_WRITECOPY; + *vprot = VPROT_READ | VPROT_WRITECOPY; break; case PAGE_EXECUTE: - vprot = VPROT_EXEC; + *vprot = VPROT_EXEC; break; case PAGE_EXECUTE_READ: - vprot = VPROT_EXEC | VPROT_READ; + *vprot = VPROT_EXEC | VPROT_READ; break; case PAGE_EXECUTE_READWRITE: - vprot = VPROT_EXEC | VPROT_READ | VPROT_WRITE; + *vprot = VPROT_EXEC | VPROT_READ | VPROT_WRITE; break; case PAGE_EXECUTE_WRITECOPY: - vprot = VPROT_EXEC | VPROT_READ | VPROT_WRITECOPY; + *vprot = VPROT_EXEC | VPROT_READ | VPROT_WRITECOPY; break; case PAGE_NOACCESS: - default: - vprot = 0; + *vprot = 0; break; + default: + return STATUS_INVALID_PARAMETER; } - if (protect & PAGE_GUARD) vprot |= VPROT_GUARD; - if (protect & PAGE_NOCACHE) vprot |= VPROT_NOCACHE; - return vprot; + if (protect & PAGE_GUARD) *vprot |= VPROT_GUARD; + if (protect & PAGE_NOCACHE) *vprot |= VPROT_NOCACHE; + return STATUS_SUCCESS; } @@ -1632,7 +1631,8 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_ if (is_beyond_limit( 0, size, working_set_limit )) return STATUS_WORKING_SET_LIMIT_RANGE; - vprot = VIRTUAL_GetProt( protect ) | VPROT_VALLOC; + if ((status = get_vprot_flags( protect, &vprot ))) return status; + vprot |= VPROT_VALLOC; if (type & MEM_COMMIT) vprot |= VPROT_COMMITTED; if (*ret) @@ -1811,6 +1811,7 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T NTSTATUS status = STATUS_SUCCESS; char *base; BYTE vprot; + unsigned int new_vprot; SIZE_T size = *size_ptr; LPVOID addr = *addr_ptr; @@ -1843,6 +1844,8 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T size = ROUND_SIZE( addr, size ); base = ROUND_ADDR( addr, page_mask ); + if ((status = get_vprot_flags( new_prot, &new_vprot ))) return status; + new_vprot |= VPROT_COMMITTED; server_enter_uninterrupted_section( &csVirtual, &sigset ); @@ -1856,8 +1859,7 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T if (get_committed_size( view, base, &vprot ) >= size && (vprot & VPROT_COMMITTED)) { if (old_prot) *old_prot = VIRTUAL_GetWin32Prot( vprot ); - vprot = VIRTUAL_GetProt( new_prot ) | VPROT_COMMITTED; - if (!VIRTUAL_SetProt( view, base, size, vprot )) status = STATUS_ACCESS_DENIED; + if (!VIRTUAL_SetProt( view, base, size, new_vprot )) status = STATUS_ACCESS_DENIED; } else status = STATUS_NOT_COMMITTED; } @@ -2135,6 +2137,8 @@ NTSTATUS WINAPI NtCreateSection( HANDLE *handle, ACCESS_MASK access, const OBJEC if (len > MAX_PATH*sizeof(WCHAR)) return STATUS_NAME_TOO_LONG; + if ((ret = get_vprot_flags( protect, &vprot ))) return ret; + objattr.rootdir = wine_server_obj_handle( attr ? attr->RootDirectory : 0 ); objattr.sd_len = 0; objattr.name_len = len; @@ -2144,7 +2148,6 @@ NTSTATUS WINAPI NtCreateSection( HANDLE *handle, ACCESS_MASK access, const OBJEC if (ret != STATUS_SUCCESS) return ret; } - vprot = VIRTUAL_GetProt( protect ); if (!(sec_flags & SEC_RESERVE)) vprot |= VPROT_COMMITTED; if (sec_flags & SEC_NOCACHE) vprot |= VPROT_NOCACHE; if (sec_flags & SEC_IMAGE) vprot |= VPROT_IMAGE; @@ -2331,7 +2334,8 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p server_enter_uninterrupted_section( &csVirtual, &sigset ); - vprot = VIRTUAL_GetProt( protect ) | (map_vprot & VPROT_COMMITTED); + get_vprot_flags( protect, &vprot ); + vprot |= (map_vprot & VPROT_COMMITTED); res = map_view( &view, *addr_ptr, size, mask, FALSE, vprot ); if (res) {
1
0
0
0
← Newer
1
...
68
69
70
71
72
73
74
...
123
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Results per page:
10
25
50
100
200