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
March 2011
----- 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
849 discussions
Start a n
N
ew thread
Jacek Caban : appwiz.cpl: Get rid of installing addons from cab file support.
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: 84fbe5db0e41e2dd3c7b4ca2588d867e29721a72 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=84fbe5db0e41e2dd3c7b4ca25…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Mar 16 14:27:29 2011 +0100 appwiz.cpl: Get rid of installing addons from cab file support. --- dlls/appwiz.cpl/addons.c | 115 +--------------------------------------------- 1 files changed, 1 insertions(+), 114 deletions(-) diff --git a/dlls/appwiz.cpl/addons.c b/dlls/appwiz.cpl/addons.c index e4080e3..dbfd3b9 100644 --- a/dlls/appwiz.cpl/addons.c +++ b/dlls/appwiz.cpl/addons.c @@ -157,93 +157,7 @@ static void set_status(DWORD id) SendMessageW(status, WM_SETTEXT, 0, (LPARAM)buf); } -static void set_registry(const WCHAR *install_dir) -{ - WCHAR mshtml_key[100]; - LPWSTR gecko_path; - HKEY hkey; - DWORD res, len; - - static const WCHAR wszGeckoPath[] = {'G','e','c','k','o','P','a','t','h',0}; - static const WCHAR wszWineGecko[] = {'w','i','n','e','_','g','e','c','k','o',0}; - - memcpy(mshtml_key, mshtml_keyW, sizeof(mshtml_keyW)); - mshtml_key[sizeof(mshtml_keyW)/sizeof(WCHAR)-1] = '\\'; - MultiByteToWideChar(CP_ACP, 0, GECKO_VERSION, sizeof(GECKO_VERSION), - mshtml_key+sizeof(mshtml_keyW)/sizeof(WCHAR), - (sizeof(mshtml_key)-sizeof(mshtml_keyW))/sizeof(WCHAR)); - - /* @@ Wine registry key: HKCU\Software\Wine\MSHTML\<version> */ - res = RegCreateKeyW(HKEY_CURRENT_USER, mshtml_key, &hkey); - if(res != ERROR_SUCCESS) { - ERR("Faild to create MSHTML key: %d\n", res); - return; - } - - len = strlenW(install_dir); - gecko_path = heap_alloc((len+1)*sizeof(WCHAR)+sizeof(wszWineGecko)); - memcpy(gecko_path, install_dir, len*sizeof(WCHAR)); - - if (len && gecko_path[len-1] != '\\') - gecko_path[len++] = '\\'; - - memcpy(gecko_path+len, wszWineGecko, sizeof(wszWineGecko)); - - res = RegSetValueExW(hkey, wszGeckoPath, 0, REG_SZ, (LPVOID)gecko_path, - len*sizeof(WCHAR)+sizeof(wszWineGecko)); - heap_free(gecko_path); - RegCloseKey(hkey); - if(res != ERROR_SUCCESS) - ERR("Failed to set GeckoPath value: %08x\n", res); -} - -static BOOL install_cab(LPCWSTR file_name) -{ - char *install_dir_a, *file_name_a; - WCHAR install_dir[MAX_PATH]; - DWORD res, len; - HRESULT hres; - - static const WCHAR gecko_subdirW[] = {'\\','g','e','c','k','o','\\',0}; - - TRACE("(%s)\n", debugstr_w(file_name)); - - GetSystemDirectoryW(install_dir, sizeof(install_dir)/sizeof(WCHAR)); - strcatW(install_dir, gecko_subdirW); - res = CreateDirectoryW(install_dir, NULL); - if(!res && GetLastError() != ERROR_ALREADY_EXISTS) { - ERR("Could not create directory: %08u\n", GetLastError()); - return FALSE; - } - - len = strlenW(install_dir); - MultiByteToWideChar(CP_ACP, 0, GECKO_VERSION, -1, install_dir+len, sizeof(install_dir)/sizeof(WCHAR)-len); - res = CreateDirectoryW(install_dir, NULL); - if(!res && GetLastError() != ERROR_ALREADY_EXISTS) { - ERR("Could not create directory: %08u\n", GetLastError()); - return FALSE; - } - - - /* FIXME: Use ExtractFilesW once it's implemented */ - file_name_a = heap_strdupWtoA(file_name); - install_dir_a = heap_strdupWtoA(install_dir); - if(file_name_a && install_dir_a) - hres = ExtractFilesA(file_name_a, install_dir_a, 0, NULL, NULL, 0); - else - hres = E_OUTOFMEMORY; - heap_free(file_name_a); - heap_free(install_dir_a); - if(FAILED(hres)) { - ERR("Could not extract package: %08x\n", hres); - return FALSE; - } - - set_registry(install_dir); - return TRUE; -} - -static BOOL install_msi_file(const WCHAR *file_name) +static BOOL install_file(const WCHAR *file_name) { ULONG res; @@ -256,33 +170,6 @@ static BOOL install_msi_file(const WCHAR *file_name) return TRUE; } -static BOOL install_file(const WCHAR *file_name) -{ - BYTE magic[4]; - HANDLE file; - DWORD size; - BOOL res; - - static const BYTE msi_magic[] = {0xd0,0xcf,0x11,0xe0}; - - file = CreateFileW(file_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL); - if(file == INVALID_HANDLE_VALUE) - return FALSE; - - res = ReadFile(file, magic, sizeof(magic), &size, NULL); - CloseHandle(file); - if(!res || size != sizeof(magic)) - return INET_E_DOWNLOAD_FAILURE; - - if(!memcmp(magic, "MSCF", sizeof(magic))) - return install_cab(file_name); - else if(!memcmp(magic, msi_magic, sizeof(magic))) - return install_msi_file(file_name); - - ERR("Unknown file magic\n"); - return FALSE; -} - static BOOL install_from_unix_file(const char *file_name) { LPWSTR dos_file_name;
1
0
0
0
Dmitry Timoshkov : server: Explicitly add FILE_DELETE_CHILD permission when file write access is allowed .
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: da077956e1f0f5adb457ff47f0cfd51203373c2e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=da077956e1f0f5adb457ff47f…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Wed Mar 16 18:46:00 2011 +0800 server: Explicitly add FILE_DELETE_CHILD permission when file write access is allowed. --- dlls/advapi32/tests/security.c | 3 +-- server/file.c | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 14e8300..43406eb 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -889,10 +889,9 @@ todo_wine { SetLastError(0xdeadbeef); rc = AccessCheck(sd, token, FILE_DELETE_CHILD, &mapping, &priv_set, &priv_set_len, &granted, &status); ok(rc, "AccessCheck error %d\n", GetLastError()); -todo_wine { ok(status == 1, "expected 1, got %d\n", status); ok(granted == FILE_DELETE_CHILD, "expected FILE_DELETE_CHILD, got %#x\n", granted); -} + granted = 0xdeadbeef; status = 0xdeadbeef; SetLastError(0xdeadbeef); diff --git a/server/file.c b/server/file.c index d17b25b..cca2633 100644 --- a/server/file.c +++ b/server/file.c @@ -360,7 +360,7 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID if (mode & S_IRUSR) aaa->Mask |= FILE_GENERIC_READ; if (mode & S_IWUSR) - aaa->Mask |= FILE_GENERIC_WRITE | DELETE; + aaa->Mask |= FILE_GENERIC_WRITE | DELETE | FILE_DELETE_CHILD; if (mode & S_IXUSR) aaa->Mask |= FILE_GENERIC_EXECUTE; sid = (SID *)&aaa->SidStart; @@ -381,7 +381,7 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID if (!(mode & S_IRUSR) && (mode & (S_IRGRP|S_IROTH))) ada->Mask |= FILE_GENERIC_READ; if (!(mode & S_IWUSR) && (mode & (S_IWGRP|S_IROTH))) - ada->Mask |= FILE_GENERIC_WRITE | DELETE; + ada->Mask |= FILE_GENERIC_WRITE | DELETE | FILE_DELETE_CHILD; if (!(mode & S_IXUSR) && (mode & (S_IXGRP|S_IXOTH))) ada->Mask |= FILE_GENERIC_EXECUTE; ada->Mask &= ~STANDARD_RIGHTS_ALL; /* never deny standard rights */ @@ -401,7 +401,7 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID if (mode & S_IROTH) aaa->Mask |= FILE_GENERIC_READ; if (mode & S_IWOTH) - aaa->Mask |= FILE_GENERIC_WRITE | DELETE; + aaa->Mask |= FILE_GENERIC_WRITE | DELETE | FILE_DELETE_CHILD; if (mode & S_IXOTH) aaa->Mask |= FILE_GENERIC_EXECUTE; sid = (SID *)&aaa->SidStart;
1
0
0
0
Dmitry Timoshkov : advapi32: Add a bunch of file access tests.
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: 19c4331d61428b39227b677b9609a05488997241 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=19c4331d61428b39227b677b9…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Wed Mar 16 18:45:43 2011 +0800 advapi32: Add a bunch of file access tests. --- dlls/advapi32/tests/security.c | 117 ++++++++++++++++++++++++++++++++++++++-- 1 files changed, 113 insertions(+), 4 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index e292e96..14e8300 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -2,6 +2,7 @@ * Unit tests for security functions * * Copyright (c) 2004 Mike McCormack + * Copyright (c) 2011 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -691,11 +692,12 @@ static void test_FileSecurity(void) char wintmpdir [MAX_PATH]; char path [MAX_PATH]; char file [MAX_PATH]; - BOOL rc; - HANDLE fh; - DWORD sdSize; - DWORD retSize; + HANDLE fh, token; + DWORD sdSize, retSize, rc, granted, priv_set_len; + PRIVILEGE_SET priv_set; + BOOL status; BYTE *sd; + GENERIC_MAPPING mapping = { FILE_READ_DATA, FILE_WRITE_DATA, FILE_EXECUTE, FILE_ALL_ACCESS }; const SECURITY_INFORMATION request = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION; @@ -810,6 +812,113 @@ cleanup: /* Remove temporary file and directory */ DeleteFileA(file); RemoveDirectoryA(path); + + + SetLastError(0xdeadbeef); + rc = GetTempPath(sizeof(wintmpdir), wintmpdir); + ok(rc, "GetTempPath error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + rc = GetTempFileName(wintmpdir, "tmp", 0, file); + ok(rc, "GetTempFileName error %d\n", GetLastError()); + + rc = GetFileAttributes(file); + rc &= ~FILE_ATTRIBUTE_NOT_CONTENT_INDEXED; + ok(rc == FILE_ATTRIBUTE_ARCHIVE, "expected FILE_ATTRIBUTE_ARCHIVE got %#x\n", rc); + + retSize = 0xdeadbeef; + rc = GetFileSecurity(file, OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, + NULL, 0, &sdSize); + ok(!rc, "GetFileSecurity should fail\n"); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "expected ERROR_INSUFFICIENT_BUFFER got %d\n", GetLastError()); + ok(sdSize > sizeof(SECURITY_DESCRIPTOR), "got sd size %d\n", sdSize); + + sd = HeapAlloc(GetProcessHeap (), 0, sdSize); + retSize = 0xdeadbeef; + SetLastError(0xdeadbeef); + rc = GetFileSecurity(file, OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, + sd, sdSize, &retSize); + ok(rc, "GetFileSecurity error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + rc = OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, &token); + ok(!rc, "OpenThreadToken should fail\n"); + ok(GetLastError() == ERROR_NO_TOKEN, "expected ERROR_NO_TOKEN, got %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + rc = ImpersonateSelf(SecurityIdentification); + ok(rc, "ImpersonateSelf error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + rc = OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, &token); + ok(rc, "OpenThreadToken error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + rc = RevertToSelf(); + ok(rc, "RevertToSelf error %d\n", GetLastError()); + + priv_set_len = sizeof(priv_set); + granted = 0xdeadbeef; + status = 0xdeadbeef; + SetLastError(0xdeadbeef); + rc = AccessCheck(sd, token, FILE_READ_DATA, &mapping, &priv_set, &priv_set_len, &granted, &status); + ok(rc, "AccessCheck error %d\n", GetLastError()); + ok(status == 1, "expected 1, got %d\n", status); + ok(granted == FILE_READ_DATA, "expected FILE_READ_DATA, got %#x\n", granted); + + granted = 0xdeadbeef; + status = 0xdeadbeef; + SetLastError(0xdeadbeef); + rc = AccessCheck(sd, token, FILE_WRITE_DATA, &mapping, &priv_set, &priv_set_len, &granted, &status); + ok(rc, "AccessCheck error %d\n", GetLastError()); + ok(status == 1, "expected 1, got %d\n", status); + ok(granted == FILE_WRITE_DATA, "expected FILE_WRITE_DATA, got %#x\n", granted); + + granted = 0xdeadbeef; + status = 0xdeadbeef; + SetLastError(0xdeadbeef); + rc = AccessCheck(sd, token, FILE_EXECUTE, &mapping, &priv_set, &priv_set_len, &granted, &status); + ok(rc, "AccessCheck error %d\n", GetLastError()); +todo_wine { + ok(status == 1, "expected 1, got %d\n", status); + ok(granted == FILE_EXECUTE, "expected FILE_EXECUTE, got %#x\n", granted); +} + granted = 0xdeadbeef; + status = 0xdeadbeef; + SetLastError(0xdeadbeef); + rc = AccessCheck(sd, token, FILE_DELETE_CHILD, &mapping, &priv_set, &priv_set_len, &granted, &status); + ok(rc, "AccessCheck error %d\n", GetLastError()); +todo_wine { + ok(status == 1, "expected 1, got %d\n", status); + ok(granted == FILE_DELETE_CHILD, "expected FILE_DELETE_CHILD, got %#x\n", granted); +} + granted = 0xdeadbeef; + status = 0xdeadbeef; + SetLastError(0xdeadbeef); + rc = AccessCheck(sd, token, 0x1ff, &mapping, &priv_set, &priv_set_len, &granted, &status); + ok(rc, "AccessCheck error %d\n", GetLastError()); +todo_wine { + ok(status == 1, "expected 1, got %d\n", status); + ok(granted == 0x1ff, "expected 0x1ff, got %#x\n", granted); +} + granted = 0xdeadbeef; + status = 0xdeadbeef; + SetLastError(0xdeadbeef); + rc = AccessCheck(sd, token, FILE_ALL_ACCESS, &mapping, &priv_set, &priv_set_len, &granted, &status); + ok(rc, "AccessCheck error %d\n", GetLastError()); +todo_wine { + ok(status == 1, "expected 1, got %d\n", status); + ok(granted == FILE_ALL_ACCESS, "expected FILE_ALL_ACCESS, got %#x\n", granted); +} + SetLastError(0xdeadbeef); + rc = AccessCheck(sd, token, 0xffffffff, &mapping, &priv_set, &priv_set_len, &granted, &status); + ok(!rc, "AccessCheck should fail\n"); + ok(GetLastError() == ERROR_GENERIC_NOT_MAPPED, "expected ERROR_GENERIC_NOT_MAPPED, got %d\n", GetLastError()); + + CloseHandle(token); + HeapFree(GetProcessHeap (), 0, sd); + DeleteFile(file); } static void test_AccessCheck(void)
1
0
0
0
Dmitry Timoshkov : advapi32: Fix the English language check.
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: 58bff4e3f88b342bcb3934802e9a227c1b15ae66 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=58bff4e3f88b342bcb3934802…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Wed Mar 16 18:45:34 2011 +0800 advapi32: Fix the English language check. --- dlls/advapi32/tests/security.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 74afc7b..e292e96 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -1917,7 +1917,7 @@ static void test_LookupAccountName(void) domain_size = domain_save; sid_size = sid_save; - if (GetSystemDefaultLangID() != LANG_ENGLISH) + if (PRIMARYLANGID(GetSystemDefaultLangID()) != LANG_ENGLISH) { skip("Non-english locale (test with hardcoded 'Everyone')\n"); } @@ -2055,7 +2055,7 @@ static void test_LookupAccountName(void) return; } - if (GetSystemDefaultLangID() != LANG_ENGLISH) + if (PRIMARYLANGID(GetSystemDefaultLangID()) != LANG_ENGLISH) { skip("Non-english locale (skipping well known name creation tests)\n"); return; @@ -2542,7 +2542,7 @@ static void test_SetEntriesInAclW(void) ok(NewAcl != NULL, "returned acl was NULL\n"); LocalFree(NewAcl); - if (GetSystemDefaultLangID() != LANG_ENGLISH) + if (PRIMARYLANGID(GetSystemDefaultLangID()) != LANG_ENGLISH) { skip("Non-english locale (test with hardcoded 'Everyone')\n"); } @@ -2673,7 +2673,7 @@ static void test_SetEntriesInAclA(void) ok(NewAcl != NULL, "returned acl was NULL\n"); LocalFree(NewAcl); - if (GetSystemDefaultLangID() != LANG_ENGLISH) + if (PRIMARYLANGID(GetSystemDefaultLangID()) != LANG_ENGLISH) { skip("Non-english locale (test with hardcoded 'Everyone')\n"); }
1
0
0
0
Hans Leidekker : msvcrt: Implement _set_security_error_handler.
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: b25e0068ac03e931e692bb8027f77a6c239b1219 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b25e0068ac03e931e692bb802…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Mar 16 09:22:24 2011 +0100 msvcrt: Implement _set_security_error_handler. --- dlls/msvcr70/msvcr70.spec | 2 +- dlls/msvcr71/msvcr71.spec | 2 +- dlls/msvcrt/except.c | 14 ++++++++++++++ dlls/msvcrt/msvcrt.h | 1 + dlls/msvcrt/msvcrt.spec | 1 + 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/msvcr70/msvcr70.spec b/dlls/msvcr70/msvcr70.spec index b83ce7f..dc97084 100644 --- a/dlls/msvcr70/msvcr70.spec +++ b/dlls/msvcr70/msvcr70.spec @@ -516,7 +516,7 @@ @ cdecl _set_SSE2_enable(long) msvcrt._set_SSE2_enable @ cdecl _set_error_mode(long) msvcrt._set_error_mode @ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold -@ stub _set_security_error_handler +@ cdecl _set_security_error_handler(ptr) msvcrt._set_security_error_handler @ cdecl _seterrormode(long) msvcrt._seterrormode @ cdecl -arch=i386,x86_64 -norelay _setjmp(ptr) msvcrt._setjmp @ cdecl -i386 -norelay _setjmp3(ptr long) msvcrt._setjmp3 diff --git a/dlls/msvcr71/msvcr71.spec b/dlls/msvcr71/msvcr71.spec index 648802a..7959334 100644 --- a/dlls/msvcr71/msvcr71.spec +++ b/dlls/msvcr71/msvcr71.spec @@ -512,7 +512,7 @@ @ cdecl _set_error_mode(long) msvcrt._set_error_mode @ cdecl _set_purecall_handler(ptr) msvcrt._set_purecall_handler @ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold -@ stub _set_security_error_handler +@ cdecl _set_security_error_handler(ptr) msvcrt._set_security_error_handler @ cdecl _seterrormode(long) msvcrt._seterrormode @ cdecl -arch=i386,x86_64 _setjmp(ptr) msvcrt._setjmp @ cdecl -i386 _setjmp3(ptr long) msvcrt._setjmp3 diff --git a/dlls/msvcrt/except.c b/dlls/msvcrt/except.c index 1ca6544..7404089 100644 --- a/dlls/msvcrt/except.c +++ b/dlls/msvcrt/except.c @@ -39,6 +39,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(seh); +static MSVCRT_security_error_handler security_error_handler; + /* VC++ extensions to Win32 SEH */ typedef struct _SCOPETABLE { @@ -820,3 +822,15 @@ BOOL CDECL MSVCRT___uncaught_exception(void) { return FALSE; } + +/* _set_security_error_handler - not exported in native msvcrt, added in msvcr70 */ +MSVCRT_security_error_handler CDECL _set_security_error_handler( + MSVCRT_security_error_handler handler ) +{ + MSVCRT_security_error_handler old = security_error_handler; + + TRACE("(%p)\n", handler); + + security_error_handler = handler; + return old; +} diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 311437a..69d3668 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -85,6 +85,7 @@ typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *); typedef int (*__cdecl MSVCRT__onexit_t)(void); typedef void (__cdecl *MSVCRT_invalid_parameter_handler)(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, unsigned, MSVCRT_uintptr_t); typedef void (__cdecl *MSVCRT_purecall_handler)(void); +typedef void (__cdecl *MSVCRT_security_error_handler)(int, void *); typedef struct {ULONG x80[3];} MSVCRT__LDOUBLE; /* Intel 80 bit FP format has sizeof() 12 */ diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 2ac0804..1438dfa 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -1487,6 +1487,7 @@ @ cdecl _set_abort_behavior(long long) MSVCRT__set_abort_behavior @ cdecl _set_invalid_parameter_handler(ptr) @ cdecl _set_purecall_handler(ptr) +@ cdecl _set_security_error_handler(ptr) @ cdecl -arch=i386 _statusfp2(ptr ptr) @ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l @ cdecl _wdupenv_s(ptr ptr str)
1
0
0
0
Erich Hoover : user32: Add a convenience function for retrieving the number of steps in a cursor.
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: ee8cb4f728951fdf7081bdfa88cb018d7933676e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ee8cb4f728951fdf7081bdfa8…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Fri Mar 11 19:22:40 2011 -0700 user32: Add a convenience function for retrieving the number of steps in a cursor. --- dlls/user32/cursoricon.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 38068e9..0b09b6e 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -145,6 +145,11 @@ static void release_icon_frame( struct cursoricon_object *obj, int istep, struct /* placeholder */ } +static UINT get_icon_steps( struct cursoricon_object *obj ) +{ + return obj->num_steps; +} + static BOOL free_icon_handle( HICON handle ) { struct cursoricon_object *obj = free_user_handle( handle, USER_ICON ); @@ -1794,7 +1799,7 @@ HCURSOR WINAPI GetCursorFrameInfo(HCURSOR hCursor, DWORD unk1, DWORD istep, DWOR /* Important Note: Sequences are not currently supported, so this implementation * will not properly handle all cases. */ - if (istep < ptr->num_steps || ptr->num_frames == 1) + if (istep < get_icon_steps(ptr) || ptr->num_frames == 1) { ret = hCursor; if (ptr->num_frames == 1) @@ -1807,10 +1812,10 @@ HCURSOR WINAPI GetCursorFrameInfo(HCURSOR hCursor, DWORD unk1, DWORD istep, DWOR struct cursoricon_frame *frame; frame = get_icon_frame( ptr, istep ); - if (ptr->num_steps == 1) + if (get_icon_steps(ptr) == 1) *num_steps = ~0; else - *num_steps = ptr->num_steps; + *num_steps = get_icon_steps(ptr); /* If this specific frame does not have a delay then use the global delay */ if (frame->delay == ~0) *rate_jiffies = ptr->delay; @@ -2092,7 +2097,7 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon, hdc,x0,y0,hIcon,cxWidth,cyWidth,istep,hbr,flags ); if (!(ptr = get_icon_ptr( hIcon ))) return FALSE; - if (istep >= ptr->num_steps) + if (istep >= get_icon_steps( ptr )) { TRACE_(icon)("Stepped past end of animated frames=%d\n", istep); release_icon_ptr( hIcon, ptr );
1
0
0
0
Erich Hoover : user32: Add get/release routines for accessing cursor frames .
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: 0bb1aadb8fc1db91241ab742421590b32abd4398 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0bb1aadb8fc1db91241ab7424…
Author: Erich Hoover <ehoover(a)mines.edu> Date: Fri Mar 11 19:21:26 2011 -0700 user32: Add get/release routines for accessing cursor frames. --- dlls/user32/cursoricon.c | 178 ++++++++++++++++++++++++++++++++------------- 1 files changed, 126 insertions(+), 52 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=0bb1aadb8fc1db91241ab…
1
0
0
0
Andrew Eikum : oleaut32: Convert ITypeLibImpl to use standard linked list.
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: 22cc5471564a2d5edc2e77e7b823fceb2aafa271 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=22cc5471564a2d5edc2e77e7b…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Tue Mar 15 15:52:49 2011 -0500 oleaut32: Convert ITypeLibImpl to use standard linked list. --- dlls/oleaut32/typelib.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 7d5b85a..2e286b4 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -1010,7 +1010,7 @@ typedef struct tagITypeLibImpl /* typelibs are cached, keyed by path and index, so store the linked list info within them */ - struct tagITypeLibImpl *next, *prev; + struct list entry; WCHAR *path; INT index; } ITypeLibImpl; @@ -2443,7 +2443,7 @@ static ITypeInfoImpl * MSFT_DoTypeInfo( * place. This will cause a deliberate memory leak, but generally losing RAM for cycles is an acceptable * tradeoff here. */ -static ITypeLibImpl *tlb_cache_first; +static struct list tlb_cache = LIST_INIT(tlb_cache); static CRITICAL_SECTION cache_section; static CRITICAL_SECTION_DEBUG cache_section_debug = { @@ -2905,7 +2905,7 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath /* We look the path up in the typelib cache. If found, we just addref it, and return the pointer. */ EnterCriticalSection(&cache_section); - for (entry = tlb_cache_first; entry != NULL; entry = entry->next) + LIST_FOR_EACH_ENTRY(entry, &tlb_cache, ITypeLibImpl, entry) { if (!strcmpiW(entry->path, pszPath) && entry->index == index) { @@ -2956,9 +2956,7 @@ static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath /* FIXME: check if it has added already in the meantime */ EnterCriticalSection(&cache_section); - if ((impl->next = tlb_cache_first) != NULL) impl->next->prev = impl; - impl->prev = NULL; - tlb_cache_first = impl; + list_add_head(&tlb_cache, &impl->entry); LeaveCriticalSection(&cache_section); ret = S_OK; } else @@ -4255,9 +4253,8 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface) { TRACE("removing from cache list\n"); EnterCriticalSection(&cache_section); - if (This->next) This->next->prev = This->prev; - if (This->prev) This->prev->next = This->next; - else tlb_cache_first = This->next; + if(This->entry.next) + list_remove(&This->entry); LeaveCriticalSection(&cache_section); heap_free(This->path); }
1
0
0
0
Andrew Eikum : oleaut32: Convert TLBImpLib to use standard linked list.
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: 3d03a5e23975e11ee4600e194ad70f92cc73b2d8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3d03a5e23975e11ee4600e194…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Tue Mar 15 15:52:46 2011 -0500 oleaut32: Convert TLBImpLib to use standard linked list. --- dlls/oleaut32/typelib.c | 72 ++++++++++++++++++++++++----------------------- 1 files changed, 37 insertions(+), 35 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 4637bf2..7d5b85a 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -977,7 +977,7 @@ typedef struct tagTLBImpLib struct tagITypeLibImpl *pImpTypeLib; /* pointer to loaded typelib, or NULL if not yet loaded */ - struct tagTLBImpLib * next; + struct list entry; } TLBImpLib; /* internal ITypeLib data */ @@ -1000,7 +1000,7 @@ typedef struct tagITypeLibImpl int TypeInfoCount; /* nr of typeinfo's in librarry */ struct tagITypeInfoImpl **typeinfos; struct list custdata_list; - TLBImpLib * pImpLibs; /* linked list to all imported typelibs */ + struct list implib_list; int ctTypeDesc; /* number of items in type desc array */ TYPEDESC * pTypeDesc; /* array of TypeDescriptions found in the library. Only used while reading MSFT @@ -2275,17 +2275,18 @@ static void MSFT_DoRefType(TLBContext *pcx, ITypeLibImpl *pTL, if(!MSFT_HREFTYPE_INTHISFILE( offset)) { /* external typelib */ MSFT_ImpInfo impinfo; - TLBImpLib *pImpLib=(pcx->pLibInfo->pImpLibs); + TLBImpLib *pImpLib; TRACE_(typelib)("offset %x, masked offset %x\n", offset, offset + (offset & 0xfffffffc)); MSFT_ReadLEDWords(&impinfo, sizeof(impinfo), pcx, pcx->pTblDir->pImpInfo.offset + (offset & 0xfffffffc)); - while (pImpLib){ /* search the known offsets of all import libraries */ - if(pImpLib->offset==impinfo.oImpFile) break; - pImpLib=pImpLib->next; - } - if(pImpLib){ + + LIST_FOR_EACH_ENTRY(pImpLib, &pcx->pLibInfo->implib_list, TLBImpLib, entry) + if(pImpLib->offset==impinfo.oImpFile) + break; + + if(&pImpLib->entry != &pcx->pLibInfo->implib_list){ ref->reference = offset; ref->pImpTLInfo = pImpLib; if(impinfo.flags & MSFT_IMPINFO_OFFSET_IS_GUID) { @@ -2979,6 +2980,7 @@ static ITypeLibImpl* TypeLibImpl_Constructor(void) pTypeLibImpl->lpVtblTypeComp = &tlbtcvt; pTypeLibImpl->ref = 1; + list_init(&pTypeLibImpl->implib_list); list_init(&pTypeLibImpl->custdata_list); list_init(&pTypeLibImpl->ref_list); pTypeLibImpl->dispatch_href = -1; @@ -3140,7 +3142,7 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength) /* imported type libs */ if(tlbSegDir.pImpFiles.offset>0) { - TLBImpLib **ppImpLib = &(pTypeLibImpl->pImpLibs); + TLBImpLib *pImpLib; int oGuid, offset = tlbSegDir.pImpFiles.offset; UINT16 size; @@ -3148,25 +3150,25 @@ static ITypeLib2* ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength) { char *name; - *ppImpLib = heap_alloc_zero(sizeof(TLBImpLib)); - (*ppImpLib)->offset = offset - tlbSegDir.pImpFiles.offset; + pImpLib = heap_alloc_zero(sizeof(TLBImpLib)); + pImpLib->offset = offset - tlbSegDir.pImpFiles.offset; MSFT_ReadLEDWords(&oGuid, sizeof(INT), &cx, offset); - MSFT_ReadLEDWords(&(*ppImpLib)->lcid, sizeof(LCID), &cx, DO_NOT_SEEK); - MSFT_ReadLEWords(&(*ppImpLib)->wVersionMajor, sizeof(WORD), &cx, DO_NOT_SEEK); - MSFT_ReadLEWords(&(*ppImpLib)->wVersionMinor, sizeof(WORD), &cx, DO_NOT_SEEK); + MSFT_ReadLEDWords(&pImpLib->lcid, sizeof(LCID), &cx, DO_NOT_SEEK); + MSFT_ReadLEWords(&pImpLib->wVersionMajor, sizeof(WORD), &cx, DO_NOT_SEEK); + MSFT_ReadLEWords(&pImpLib->wVersionMinor, sizeof(WORD), &cx, DO_NOT_SEEK); MSFT_ReadLEWords(& size, sizeof(UINT16), &cx, DO_NOT_SEEK); size >>= 2; name = heap_alloc_zero(size+1); MSFT_Read(name, size, &cx, DO_NOT_SEEK); - (*ppImpLib)->name = TLB_MultiByteToBSTR(name); + pImpLib->name = TLB_MultiByteToBSTR(name); heap_free(name); - MSFT_ReadGuid(&(*ppImpLib)->guid, oGuid, &cx); + MSFT_ReadGuid(&pImpLib->guid, oGuid, &cx); offset = (offset + sizeof(INT) + sizeof(DWORD) + sizeof(LCID) + sizeof(UINT16) + size + 3) & ~3; - ppImpLib = &(*ppImpLib)->next; + list_add_tail(&pTypeLibImpl->implib_list, &pImpLib->entry); } } @@ -3434,25 +3436,24 @@ static sltg_ref_lookup_t *SLTG_DoRefs(SLTG_RefInfo *pRef, ITypeLibImpl *pTL, if(sscanf(refname, "*\\R%x*#%x", &lib_offs, &type_num) != 2) FIXME_(typelib)("Can't sscanf ref\n"); if(lib_offs != 0xffff) { - TLBImpLib **import = &pTL->pImpLibs; + TLBImpLib *import; - while(*import) { - if((*import)->offset == lib_offs) - break; - import = &(*import)->next; - } - if(!*import) { + LIST_FOR_EACH_ENTRY(import, &pTL->implib_list, TLBImpLib, entry) + if(import->offset == lib_offs) + break; + + if(&import->entry == &pTL->implib_list) { char fname[MAX_PATH+1]; int len; - *import = heap_alloc_zero(sizeof(**import)); - (*import)->offset = lib_offs; + import = heap_alloc_zero(sizeof(*import)); + import->offset = lib_offs; TLB_GUIDFromString( pNameTable + lib_offs + 4, - &(*import)->guid); + &import->guid); if(sscanf(pNameTable + lib_offs + 40, "}#%hd.%hd#%x#%s", - &(*import)->wVersionMajor, - &(*import)->wVersionMinor, - &(*import)->lcid, fname) != 4) { + &import->wVersionMajor, + &import->wVersionMinor, + &import->lcid, fname) != 4) { FIXME_(typelib)("can't sscanf ref %s\n", pNameTable + lib_offs + 40); } @@ -3460,12 +3461,13 @@ static sltg_ref_lookup_t *SLTG_DoRefs(SLTG_RefInfo *pRef, ITypeLibImpl *pTL, if(fname[len-1] != '#') FIXME("fname = %s\n", fname); fname[len-1] = '\0'; - (*import)->name = TLB_MultiByteToBSTR(fname); + import->name = TLB_MultiByteToBSTR(fname); + list_add_tail(&pTL->implib_list, &import->entry); } - ref_type->pImpTLInfo = *import; + ref_type->pImpTLInfo = import; /* Store a reference to IDispatch */ - if(pTL->dispatch_href == -1 && IsEqualGUID(&(*import)->guid, &IID_StdOle) && type_num == 4) + if(pTL->dispatch_href == -1 && IsEqualGUID(&import->guid, &IID_StdOle) && type_num == 4) pTL->dispatch_href = typelib_ref; } else { /* internal ref */ @@ -4281,13 +4283,13 @@ static ULONG WINAPI ITypeLib2_fnRelease( ITypeLib2 *iface) heap_free(This->pTypeDesc); - for (pImpLib = This->pImpLibs; pImpLib; pImpLib = pImpLibNext) + LIST_FOR_EACH_ENTRY_SAFE(pImpLib, pImpLibNext, &This->implib_list, TLBImpLib, entry) { if (pImpLib->pImpTypeLib) ITypeLib_Release((ITypeLib *)pImpLib->pImpTypeLib); SysFreeString(pImpLib->name); - pImpLibNext = pImpLib->next; + list_remove(&pImpLib->entry); heap_free(pImpLib); }
1
0
0
0
Stefan Dösinger : d3d9: Test depth stencil size mismatches.
by Alexandre Julliard
16 Mar '11
16 Mar '11
Module: wine Branch: master Commit: 5e9884a48861962f93ce1ca37f3b67c009cd1ae2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5e9884a48861962f93ce1ca37…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Thu Mar 10 20:11:50 2011 +0100 d3d9: Test depth stencil size mismatches. --- dlls/d3d9/tests/visual.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 106 insertions(+), 0 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 9a40891..54aa586 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -11661,6 +11661,111 @@ static void srgbwrite_format_test(IDirect3DDevice9 *device) IDirect3DSurface9_Release(backbuffer); } +static void ds_size_test(IDirect3DDevice9 *device) +{ + IDirect3DSurface9 *ds, *rt, *old_rt, *old_ds, *readback; + HRESULT hr; + DWORD color; + DWORD num_passes; + struct + { + float x, y, z; + } + quad[] = + { + {-1.0, -1.0, 0.0 }, + {-1.0, 1.0, 0.0 }, + { 1.0, -1.0, 0.0 }, + { 1.0, 1.0, 0.0 } + }; + + hr = IDirect3DDevice9_CreateRenderTarget(device, 64, 64, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, FALSE, &rt, NULL); + ok(SUCCEEDED(hr), "IDirect3DDevice9_CreateRenderTarget failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateDepthStencilSurface(device, 32, 32, D3DFMT_D24X8, D3DMULTISAMPLE_NONE, 0, TRUE, &ds, NULL); + ok(SUCCEEDED(hr), "IDirect3DDevice9_CreateDepthStencilSurface failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 64, 64, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &readback, NULL); + ok(SUCCEEDED(hr), "IDirect3DDevice9_CreateOffscreenPlainSurface failed, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, FALSE); + ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILENABLE, FALSE); + ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZWRITEENABLE, FALSE); + ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_ValidateDevice(device, &num_passes); + ok(SUCCEEDED(hr), "IDirect3DDevice9_ValidateDevice failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetRenderTarget(device, 0, &old_rt); + ok(SUCCEEDED(hr), "IDirect3DDevice9_GetRenderTarget failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetDepthStencilSurface(device, &old_ds); + ok(SUCCEEDED(hr), "IDirect3DDevice9_GetDepthStencilSurface failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderTarget(device, 0, rt); + ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderTarget failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetDepthStencilSurface(device, ds); + ok(SUCCEEDED(hr), "IDirect3DDevice9_SetDepthStencilSurface failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_ValidateDevice(device, &num_passes); + ok(SUCCEEDED(hr), "IDirect3DDevice9_ValidateDevice failed, hr %#x.\n", hr); + + /* The D3DCLEAR_TARGET clear works. D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER returns OK, + * but does not change the surface's contents. */ + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x000000FF, 0.0f, 0); + ok(SUCCEEDED(hr), "Target clear failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_ZBUFFER, 0x00000000, 0.2f, 0); + ok(SUCCEEDED(hr), "Z Buffer clear failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff0000, 0.5f, 0); + ok(SUCCEEDED(hr), "Target and Z Buffer clear failed, hr %#x.\n", hr); + + hr = IDirect3DDevice9_GetRenderTargetData(device, rt, readback); + ok(SUCCEEDED(hr), "IDirect3DDevice9_GetRenderTargetData failed, hr %#x.\n", hr); + color = getPixelColorFromSurface(readback, 2, 2); + ok(color == 0x000000FF, "DS size test: Pixel (2, 2) after clear is %#x, expected 0x000000FF\n", color); + color = getPixelColorFromSurface(readback, 31, 31); + ok(color == 0x000000FF, "DS size test: Pixel (31, 31) after clear is %#x, expected 0x000000FF\n", color); + color = getPixelColorFromSurface(readback, 32, 32); + ok(color == 0x000000FF, "DS size test: Pixel (32, 32) after clear is %#x, expected 0x000000FF\n", color); + color = getPixelColorFromSurface(readback, 63, 63); + ok(color == 0x000000FF, "DS size test: Pixel (63, 63) after clear is %#x, expected 0x000000FF\n", color); + + /* Turning on any depth-related state results in a ValidateDevice failure */ + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_TRUE); + ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_ValidateDevice(device, &num_passes); + ok(hr == D3DERR_CONFLICTINGRENDERSTATE, "IDirect3DDevice9_ValidateDevice returned %#x, expected " + "D3DERR_CONFLICTINGRENDERSTATE.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE); + ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZWRITEENABLE, TRUE); + ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_ValidateDevice(device, &num_passes); + ok(hr == D3DERR_CONFLICTINGRENDERSTATE, "IDirect3DDevice9_ValidateDevice returned %#x, expected " + "D3DERR_CONFLICTINGRENDERSTATE.\n", hr); + + /* Try to draw with the device in an invalid state */ + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); + ok(SUCCEEDED(hr), "IDirect3DDevice9_SetFVF failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "IDirect3DDevice9_BeginScene failed, hr %#x.\n", hr); + if(SUCCEEDED(hr)) + { + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawPrimitiveUP failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "IDirect3DDevice9_EndScene failed, hr %#x.\n", hr); + } + + hr = IDirect3DDevice9_SetRenderTarget(device, 0, old_rt); + ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderTarget failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetDepthStencilSurface(device, old_ds); + ok(SUCCEEDED(hr), "IDirect3DDevice9_SetDepthStencilSurface failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_ValidateDevice(device, &num_passes); + ok(SUCCEEDED(hr), "IDirect3DDevice9_ValidateDevice failed, hr %#x.\n", hr); + + IDirect3DSurface9_Release(readback); + IDirect3DSurface9_Release(ds); + IDirect3DSurface9_Release(rt); + IDirect3DSurface9_Release(old_rt); + IDirect3DSurface9_Release(old_ds); +} + START_TEST(visual) { IDirect3DDevice9 *device_ptr; @@ -11738,6 +11843,7 @@ START_TEST(visual) skip("No mipmap support\n"); } offscreen_test(device_ptr); + ds_size_test(device_ptr); alpha_test(device_ptr); shademode_test(device_ptr); srgbtexture_test(device_ptr);
1
0
0
0
← Newer
1
...
30
31
32
33
34
35
36
...
85
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
Results per page:
10
25
50
100
200