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
June 2007
----- 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
5 participants
856 discussions
Start a n
N
ew thread
Francois Gouget : regedit: Remove cruft and make functions static, reordering where necessary to avoid forward declarations.
by Alexandre Julliard
14 Jun '07
14 Jun '07
Module: wine Branch: master Commit: 0d2d994ecced21dc4f5465670c15a423872ea7b3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0d2d994ecced21dc4f5465670…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Thu Jun 14 11:42:41 2007 +0200 regedit: Remove cruft and make functions static, reordering where necessary to avoid forward declarations. Remove the command parameter of processRegLines() as it can only be used with processRegEntry(). --- programs/regedit/listview.c | 3 - programs/regedit/regedit.c | 2 +- programs/regedit/regproc.c | 402 +++++++++++++------------------------------ programs/regedit/regproc.h | 42 +----- 4 files changed, 127 insertions(+), 322 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=0d2d994ecced21dc4f546…
1
0
0
0
Francois Gouget : regedit: Remove setAppName() as the application name is hardcoded anyway.
by Alexandre Julliard
14 Jun '07
14 Jun '07
Module: wine Branch: master Commit: de2fc93b6bf624831a2896fc161e8dca93bffea8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=de2fc93b6bf624831a2896fc1…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Thu Jun 14 11:36:54 2007 +0200 regedit: Remove setAppName() as the application name is hardcoded anyway. --- programs/regedit/regedit.c | 6 +++++- programs/regedit/regproc.c | 16 ---------------- programs/regedit/regproc.h | 1 - 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/programs/regedit/regedit.c b/programs/regedit/regedit.c index 0c587d6..41ef204 100644 --- a/programs/regedit/regedit.c +++ b/programs/regedit/regedit.c @@ -59,6 +59,11 @@ typedef enum { } REGEDIT_ACTION; +const CHAR *getAppName(void) +{ + return "regedit"; +} + /****************************************************************************** * Copies file name from command line string to the buffer. * Rewinds the command line string pointer to the next non-space character @@ -229,7 +234,6 @@ BOOL ProcessCmdLine(LPSTR lpCmdLine) LPSTR s = lpCmdLine; /* command line pointer */ CHAR ch = *s; /* current character */ - setAppName("regedit"); while (ch && ((ch == '-') || (ch == '/'))) { char chu; char ch2; diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index 2718194..c796d0b 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -40,8 +40,6 @@ static HKEY currentKeyClass = 0; static HKEY currentKeyHandle = 0; static BOOL bTheKeyIsOpen = FALSE; -static const CHAR *app_name = "UNKNOWN"; - static const CHAR *reg_class_names[] = { "HKEY_LOCAL_MACHINE", "HKEY_USERS", "HKEY_CLASSES_ROOT", "HKEY_CURRENT_CONFIG", "HKEY_CURRENT_USER", "HKEY_DYN_DATA" @@ -1229,17 +1227,3 @@ void delete_registry_key(CHAR *reg_key_name) } HeapFree(GetProcessHeap(), 0, branch_name); } - -/****************************************************************************** - * Sets the application name. Then application name is used in the error - * reporting. - */ -void setAppName(const CHAR *name) -{ - app_name = name; -} - -const CHAR *getAppName(void) -{ - return app_name; -} diff --git a/programs/regedit/regproc.h b/programs/regedit/regproc.h index 0b23c6a..b462546 100644 --- a/programs/regedit/regproc.h +++ b/programs/regedit/regproc.h @@ -39,7 +39,6 @@ BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name); BOOL import_registry_file(LPTSTR filename); void delete_registry_key(CHAR *reg_key_name); -void setAppName(const CHAR *name); const CHAR *getAppName(void); void processRegLines(FILE *in, CommandAPI command);
1
0
0
0
Francois Gouget : crypt32: Add missing '\n' to ok() call.
by Alexandre Julliard
14 Jun '07
14 Jun '07
Module: wine Branch: master Commit: 021c4dba179d56c0c4d11e401bd679c1d330f026 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=021c4dba179d56c0c4d11e401…
Author: Francois Gouget <fgouget(a)free.fr> Date: Thu Jun 14 11:21:30 2007 +0200 crypt32: Add missing '\n' to ok() call. --- dlls/crypt32/tests/encode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index 387df64..5f79639 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -4846,7 +4846,7 @@ static void test_decodePKCSAttributes(DWORD dwEncoding) ok(attributes->rgAttr[0].cValue == 0, "Expected no attributes, got %d\n", attributes->rgAttr[0].cValue); ok(!strcmp(attributes->rgAttr[1].pszObjId, "1.5.6"), - "Expected 1.5.6, got %s", attributes->rgAttr[1].pszObjId); + "Expected 1.5.6, got %s\n", attributes->rgAttr[1].pszObjId); ok(attributes->rgAttr[1].cValue == 1, "Expected 1 attribute, got %d\n", attributes->rgAttr[1].cValue); ok(attributes->rgAttr[1].rgValue[0].cbData == ints[0].encoded[1] + 2,
1
0
0
0
Lei Zhang : comdlg32: Move file dialog resizing code into its own function.
by Alexandre Julliard
14 Jun '07
14 Jun '07
Module: wine Branch: master Commit: eef9e1ab882fe1f74f84c23b1d4a68b34b65d7fe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eef9e1ab882fe1f74f84c23b1…
Author: Lei Zhang <thestig(a)google.com> Date: Thu Jun 14 01:29:16 2007 -0700 comdlg32: Move file dialog resizing code into its own function. --- dlls/comdlg32/filedlg.c | 99 +++++++++++++++++++++++++++-------------------- 1 files changed, 57 insertions(+), 42 deletions(-) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 11c4502..e8e82f2 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -181,6 +181,7 @@ static const char LookInInfosStr[] = "LookInInfos"; /* LOOKIN combo box property */ /* Internal functions used by the dialog */ +static LRESULT FILEDLG95_ResizeControls(HWND hwnd, WPARAM wParam, LPARAM lParam); static LRESULT FILEDLG95_FillControls(HWND hwnd, WPARAM wParam, LPARAM lParam); static LRESULT FILEDLG95_OnWMCommand(HWND hwnd, WPARAM wParam, LPARAM lParam); static LRESULT FILEDLG95_OnWMGetIShellBrowser(HWND hwnd); @@ -1042,30 +1043,7 @@ INT_PTR CALLBACK FileOpenDlgProc95(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l fodInfos->DlgInfos.hwndCustomDlg = CreateTemplateDialog((FileOpenDlgInfos *)lParam, hwnd); - if (fodInfos->DlgInfos.hwndCustomDlg) - { - RECT rc; - UINT flags = SWP_NOACTIVATE; - - ArrangeCtrlPositions(fodInfos->DlgInfos.hwndCustomDlg, hwnd, - (fodInfos->ofnInfos->Flags & (OFN_HIDEREADONLY | OFN_SHOWHELP)) == OFN_HIDEREADONLY); - - /* resize the custom dialog to the parent size */ - if (fodInfos->ofnInfos->Flags & (OFN_ENABLETEMPLATE | OFN_ENABLETEMPLATEHANDLE)) - GetClientRect(hwnd, &rc); - else - { - /* our own fake template is zero sized and doesn't have - * children, so there is no need to resize it. - * Picasa depends on it. - */ - flags |= SWP_NOSIZE; - SetRectEmpty(&rc); - } - SetWindowPos(fodInfos->DlgInfos.hwndCustomDlg, HWND_BOTTOM, - 0, 0, rc.right, rc.bottom, flags); - } - + FILEDLG95_ResizeControls(hwnd, wParam, lParam); FILEDLG95_FillControls(hwnd, wParam, lParam); SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE); @@ -1440,24 +1418,6 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) EnableWindow(GetDlgItem(hwnd, pshHelp), FALSE); } - /* Resize the height, if open as read only checkbox ad help button - are hidden and we are not using a custom template nor a customDialog - */ - if ( (fodInfos->ofnInfos->Flags & OFN_HIDEREADONLY) && - (!(fodInfos->ofnInfos->Flags & - (OFN_SHOWHELP|OFN_ENABLETEMPLATE|OFN_ENABLETEMPLATEHANDLE))) && - (!fodInfos->DlgInfos.hwndCustomDlg )) - { - RECT rectDlg, rectHelp, rectCancel; - GetWindowRect(hwnd, &rectDlg); - GetWindowRect(GetDlgItem(hwnd, pshHelp), &rectHelp); - GetWindowRect(GetDlgItem(hwnd, IDCANCEL), &rectCancel); - /* subtract the height of the help button plus the space between - the help button and the cancel button to the height of the dialog */ - SetWindowPos(hwnd, 0, 0, 0, rectDlg.right-rectDlg.left, - (rectDlg.bottom-rectDlg.top) - (rectHelp.bottom - rectCancel.bottom), - SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER); - } /* change Open to Save */ if (fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) { @@ -1471,6 +1431,61 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) } /*********************************************************************** + * FILEDLG95_ResizeControls + * + * WM_INITDIALOG message handler (after hook notification) + */ +static LRESULT FILEDLG95_ResizeControls(HWND hwnd, WPARAM wParam, LPARAM lParam) +{ + FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) lParam; + + if (fodInfos->DlgInfos.hwndCustomDlg) + { + RECT rc; + UINT flags = SWP_NOACTIVATE; + + ArrangeCtrlPositions(fodInfos->DlgInfos.hwndCustomDlg, hwnd, + (fodInfos->ofnInfos->Flags & (OFN_HIDEREADONLY | OFN_SHOWHELP)) == OFN_HIDEREADONLY); + + /* resize the custom dialog to the parent size */ + if (fodInfos->ofnInfos->Flags & (OFN_ENABLETEMPLATE | OFN_ENABLETEMPLATEHANDLE)) + GetClientRect(hwnd, &rc); + else + { + /* our own fake template is zero sized and doesn't have children, so + * there is no need to resize it. Picasa depends on it. + */ + flags |= SWP_NOSIZE; + SetRectEmpty(&rc); + } + SetWindowPos(fodInfos->DlgInfos.hwndCustomDlg, HWND_BOTTOM, + 0, 0, rc.right, rc.bottom, flags); + } + else + { + /* Resize the height, if open as read only checkbox ad help button are + * hidden and we are not using a custom template nor a customDialog + */ + if ( (fodInfos->ofnInfos->Flags & OFN_HIDEREADONLY) && + (!(fodInfos->ofnInfos->Flags & + (OFN_SHOWHELP|OFN_ENABLETEMPLATE|OFN_ENABLETEMPLATEHANDLE)))) + { + RECT rectDlg, rectHelp, rectCancel; + GetWindowRect(hwnd, &rectDlg); + GetWindowRect(GetDlgItem(hwnd, pshHelp), &rectHelp); + GetWindowRect(GetDlgItem(hwnd, IDCANCEL), &rectCancel); + /* subtract the height of the help button plus the space between the help + * button and the cancel button to the height of the dialog + */ + SetWindowPos(hwnd, 0, 0, 0, rectDlg.right-rectDlg.left, + (rectDlg.bottom-rectDlg.top) - (rectHelp.bottom - rectCancel.bottom), + SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER); + } + } + return TRUE; +} + +/*********************************************************************** * FILEDLG95_FillControls * * WM_INITDIALOG message handler (after hook notification)
1
0
0
0
Lei Zhang : user32: Improve cut/copy/paste behavior of password edit boxes.
by Alexandre Julliard
14 Jun '07
14 Jun '07
Module: wine Branch: master Commit: 7dd98bb993b886922b07954a3956f32763ea58c1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7dd98bb993b886922b07954a3…
Author: Lei Zhang <thestig(a)google.com> Date: Wed Jun 13 17:22:49 2007 -0700 user32: Improve cut/copy/paste behavior of password edit boxes. --- dlls/user32/edit.c | 10 +++++++- dlls/user32/tests/edit.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 3f2282f..fbc5a00 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -4021,14 +4021,15 @@ static void EDIT_WM_Char(EDITSTATE *es, WCHAR c) } break; case 0x03: /* ^C */ - SendMessageW(es->hwndSelf, WM_COPY, 0, 0); + if (!(es->style & ES_PASSWORD)) + SendMessageW(es->hwndSelf, WM_COPY, 0, 0); break; case 0x16: /* ^V */ if (!(es->style & ES_READONLY)) SendMessageW(es->hwndSelf, WM_PASTE, 0, 0); break; case 0x18: /* ^X */ - if (!(es->style & ES_READONLY)) + if (!((es->style & ES_READONLY) || (es->style & ES_PASSWORD))) SendMessageW(es->hwndSelf, WM_CUT, 0, 0); break; @@ -4949,6 +4950,11 @@ static void EDIT_WM_Paste(EDITSTATE *es) EDIT_EM_ReplaceSel(es, TRUE, src, TRUE, TRUE); GlobalUnlock(hsrc); } + else if (es->style & ES_PASSWORD) { + /* clear selected text in password edit box even with empty clipboard */ + const WCHAR empty_strW[] = { 0 }; + EDIT_EM_ReplaceSel(es, TRUE, empty_strW, TRUE, TRUE); + } CloseClipboard(); } diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index ee61085..2bdf0ed 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -1003,6 +1003,53 @@ static void test_text_position(void) test_text_position_style(ES_MULTILINE | ES_AUTOHSCROLL | ES_AUTOVSCROLL); } +static void test_espassword(void) +{ + HWND hwEdit; + MSG msMessage; + LONG r; + char buffer[1024]; + const char* password = "secret"; + + msMessage.message = WM_KEYDOWN; + + hwEdit = create_editcontrol(ES_PASSWORD, 0); + r = get_edit_style(hwEdit); + ok(r == ES_PASSWORD, "Wrong style expected 0x%x got: 0x%x\n", ES_PASSWORD, r); + /* set text */ + r = SendMessage(hwEdit , WM_SETTEXT, 0, (LPARAM) password); + ok(r == TRUE, "Expected: %d, got: %d\n", TRUE, r); + + /* select all, cut (ctrl-x) */ + SendMessage(hwEdit, EM_SETSEL, 0, -1); + SendMessage(hwEdit, WM_CHAR, 24, 0); + + /* get text */ + r = SendMessage(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + ok(r == strlen(password), "Expected: %d, got: %d\n", strlen(password), r); + ok(strcmp(buffer, password) == 0, "expected %s, got %s\n", password, buffer); + + r = OpenClipboard(hwEdit); + ok(r == TRUE, "expected %d, got %d\n", TRUE, r); + r = EmptyClipboard(); + ok(r == TRUE, "expected %d, got %d\n", TRUE, r); + r = CloseClipboard(); + ok(r == TRUE, "expected %d, got %d\n", TRUE, r); + + /* select all, copy (ctrl-c) and paste (ctrl-v) */ + SendMessage(hwEdit, EM_SETSEL, 0, -1); + SendMessage(hwEdit, WM_CHAR, 3, 0); + SendMessage(hwEdit, WM_CHAR, 22, 0); + + /* get text */ + buffer[0] = 0; + r = SendMessage(hwEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + ok(r == 0, "Expected: 0, got: %d\n", r); + ok(strcmp(buffer, "") == 0, "expected empty string, got %s\n", buffer); + + DestroyWindow (hwEdit); +} + static BOOL RegisterWindowClasses (void) { WNDCLASSA test2; @@ -1068,6 +1115,7 @@ START_TEST(edit) test_margins(); test_margins_font_change(); test_text_position(); + test_espassword(); UnregisterWindowClasses(); }
1
0
0
0
James Hawkins : msi: Fixed the WriteEnvironmentStrings action.
by Alexandre Julliard
14 Jun '07
14 Jun '07
Module: wine Branch: master Commit: 881f59254a1d2e1fc0b8661c3f0f14d709e80007 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=881f59254a1d2e1fc0b8661c3…
Author: James Hawkins <truiken(a)gmail.com> Date: Wed Jun 13 17:46:09 2007 -0700 msi: Fixed the WriteEnvironmentStrings action. --- dlls/msi/action.c | 179 +++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 140 insertions(+), 39 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index d6f53d7..00ed572 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -4570,15 +4570,92 @@ static UINT ACTION_InstallODBC( MSIPACKAGE *package ) #define ENV_ACT_SETALWAYS 0x1 #define ENV_ACT_SETABSENT 0x2 #define ENV_ACT_REMOVE 0x4 +#define ENV_ACT_REMOVEMATCH 0x8 #define ENV_MOD_MACHINE 0x20000000 #define ENV_MOD_APPEND 0x40000000 #define ENV_MOD_PREFIX 0x80000000 +#define ENV_MOD_MASK 0xC0000000 + +#define check_flag_combo(x, y) ((x) & ~(y)) == (y) + +static LONG env_set_flags( LPCWSTR *name, LPWSTR *value, DWORD *flags ) +{ + LPCWSTR cptr = *name; + LPWSTR ptr = *value; + + static const WCHAR prefix[] = {'[','~',']',0}; + + *flags = 0; + while (*cptr && (*cptr == '=' || *cptr == '+' || + *cptr == '-' || *cptr == '!' || *cptr == '*')) + { + switch (*cptr) + { + case '=': + *flags |= ENV_ACT_SETALWAYS; + break; + case '+': + *flags |= ENV_ACT_SETABSENT; + break; + case '-': + *flags |= ENV_ACT_REMOVE; + break; + case '!': + *flags |= ENV_ACT_REMOVEMATCH; + break; + case '*': + *flags |= ENV_MOD_MACHINE; + break; + default: + ERR("Unknown Environment flag: %c\n", *cptr); + return ERROR_FUNCTION_FAILED; + } + + cptr++; + (*name)++; + } + + if (!*cptr) + { + ERR("Missing environment variable\n"); + return ERROR_FUNCTION_FAILED; + } + + if (!strncmpW(ptr, prefix, lstrlenW(prefix))) + { + *flags |= ENV_MOD_PREFIX; + *value += lstrlenW(prefix); + } + else + { + ptr += lstrlenW(ptr) - lstrlenW(prefix) - 1; + if (!lstrcmpW(ptr, prefix)) + { + *flags |= ENV_MOD_APPEND; + *ptr = '\0'; + } + } + + if (!*flags || + check_flag_combo(*flags, ENV_ACT_SETALWAYS | ENV_ACT_SETABSENT) || + check_flag_combo(*flags, ENV_ACT_REMOVEMATCH | ENV_ACT_SETABSENT) || + check_flag_combo(*flags, ENV_ACT_REMOVEMATCH | ENV_ACT_SETALWAYS) || + check_flag_combo(*flags, ENV_ACT_SETABSENT | ENV_MOD_MASK)) + { + ERR("Invalid flags: %08x\n", *flags); + return ERROR_FUNCTION_FAILED; + } + + return ERROR_SUCCESS; +} static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) { - LPCWSTR var, value; - LPWSTR val = NULL, ptr; + MSIPACKAGE *package = param; + LPCWSTR name, value, comp; + LPWSTR data = NULL, newval = NULL; + LPWSTR deformatted, ptr; DWORD flags, type, size; LONG res; HKEY env, root = HKEY_CURRENT_USER; @@ -4591,33 +4668,35 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) 'E','n','v','i','r','o','n','m','e','n','t',0}; static const WCHAR semicolon[] = {';',0}; - var = MSI_RecordGetString(rec, 1); - value = MSI_RecordGetString(rec, 2); - flags = MSI_RecordGetInteger(rec, 3); + name = MSI_RecordGetString(rec, 2); + value = MSI_RecordGetString(rec, 3); + comp = MSI_RecordGetString(rec, 4); + + deformat_string(package, value, &deformatted); + if (!deformatted) + return ERROR_OUTOFMEMORY; + + res = env_set_flags(&name, &deformatted, &flags); + if (res != ERROR_SUCCESS) + goto done; - TRACE("(%s, %s, %08x)\n", debugstr_w(var), debugstr_w(value), flags); + value = deformatted; if (flags & ENV_MOD_MACHINE) root = HKEY_LOCAL_MACHINE; res = RegOpenKeyExW(root, environment, 0, KEY_ALL_ACCESS, &env); if (res != ERROR_SUCCESS) - return res; + goto done; if (flags & ENV_ACT_REMOVE) - { - res = RegDeleteKeyW(env, var); - RegCloseKey(env); - return res; - } + FIXME("Not removing environment variable on uninstall!\n"); size = 0; - res = RegQueryValueExW(env, var, NULL, &type, NULL, &size); - if ((res != ERROR_MORE_DATA && res != ERROR_FILE_NOT_FOUND) || type != REG_SZ) - { - RegCloseKey(env); - return res; - } + res = RegQueryValueExW(env, name, NULL, &type, NULL, &size); + if ((res != ERROR_SUCCESS && res != ERROR_FILE_NOT_FOUND) || + (res == ERROR_SUCCESS && type != REG_SZ)) + goto done; if (res != ERROR_FILE_NOT_FOUND) { @@ -4627,51 +4706,73 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param ) goto done; } - /* oldvals;newval */ - size = (lstrlenW(value) + 1 + size) * sizeof(WCHAR); - val = msi_alloc(size); - ptr = val; - if (!val) + data = msi_alloc(size); + if (!data) { - res = ERROR_OUTOFMEMORY; - goto done; + RegCloseKey(env); + return ERROR_OUTOFMEMORY; } - if (flags & ENV_MOD_PREFIX) + res = RegQueryValueExW(env, name, NULL, &type, (LPVOID)data, &size); + if (res != ERROR_SUCCESS) + goto done; + + if (flags & ENV_ACT_REMOVEMATCH && (!value || !lstrcmpW(data, value))) { - lstrcpyW(val, value); - lstrcatW(val, semicolon); - ptr = val + lstrlenW(value) + 1; + res = RegDeleteKeyW(env, name); + goto done; } - res = RegQueryValueExW(env, var, NULL, &type, (LPVOID)ptr, &size); - if (res != ERROR_SUCCESS) + size = (lstrlenW(value) + 1 + size) * sizeof(WCHAR); + newval = msi_alloc(size); + ptr = newval; + if (!newval) + { + res = ERROR_OUTOFMEMORY; goto done; + } - if (!flags || flags & ENV_MOD_APPEND) + if (!(flags & ENV_MOD_MASK)) + lstrcpyW(newval, value); + else { - lstrcatW(val, semicolon); - lstrcatW(val, value); + if (flags & ENV_MOD_PREFIX) + { + lstrcpyW(newval, value); + lstrcatW(newval, semicolon); + ptr = newval + lstrlenW(value) + 1; + } + + lstrcpyW(ptr, data); + + if (flags & ENV_MOD_APPEND) + { + lstrcatW(newval, semicolon); + lstrcatW(newval, value); + } } } else { size = (lstrlenW(value) + 1) * sizeof(WCHAR); - val = msi_alloc(size); - if (!val) + newval = msi_alloc(size); + if (!newval) { res = ERROR_OUTOFMEMORY; goto done; } - lstrcpyW(val, value); + lstrcpyW(newval, value); } - res = RegSetValueExW(env, var, 0, type, (LPVOID)val, size); + TRACE("setting %s to %s\n", debugstr_w(name), debugstr_w(newval)); + res = RegSetValueExW(env, name, 0, type, (LPVOID)newval, size); done: RegCloseKey(env); - msi_free(val); + msi_free(deformatted); + msi_free(data); + msi_free(newval); return res; }
1
0
0
0
Stefan Dösinger : d3d9: Add a dll global critical section.
by Alexandre Julliard
14 Jun '07
14 Jun '07
Module: wine Branch: master Commit: c4b801b7d174f6be0f30134ef6071907b2a514eb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c4b801b7d174f6be0f30134ef…
Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Sun Jun 10 17:13:01 2007 +0200 d3d9: Add a dll global critical section. --- dlls/d3d9/d3d9_main.c | 11 +++++++++++ dlls/d3d9/d3d9_private.h | 1 + 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/dlls/d3d9/d3d9_main.c b/dlls/d3d9/d3d9_main.c index a5e1cef..ba4da66 100644 --- a/dlls/d3d9/d3d9_main.c +++ b/dlls/d3d9/d3d9_main.c @@ -25,6 +25,15 @@ #include "initguid.h" #include "d3d9_private.h" +static CRITICAL_SECTION_DEBUG d3d9_cs_debug = +{ + 0, 0, &d3d9_cs, + { &d3d9_cs_debug.ProcessLocksList, + &d3d9_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": d3d9_cs") } +}; +CRITICAL_SECTION d3d9_cs = { &d3d9_cs_debug, -1, 0, 0, 0, 0 }; + WINE_DEFAULT_DEBUG_CHANNEL(d3d9); static int D3DPERF_event_level = 0; @@ -43,7 +52,9 @@ IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion) { object->lpVtbl = &Direct3D9_Vtbl; object->ref = 1; + EnterCriticalSection(&d3d9_cs); object->WineD3D = WineDirect3DCreate(SDKVersion, 9, (IUnknown *)object); + LeaveCriticalSection(&d3d9_cs); TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D); diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index af308ac..9049777 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -44,6 +44,7 @@ extern HRESULT vdecl_convert_fvf( DWORD FVF, D3DVERTEXELEMENT9** ppVertexElements); +extern CRITICAL_SECTION d3d9_cs; /* =========================================================================== Macros
1
0
0
0
Stefan Dösinger : wined3d: DDraw surfaces are QWORD aligned.
by Alexandre Julliard
14 Jun '07
14 Jun '07
Module: wine Branch: master Commit: 6e5a5d2736922b7411668b5081e05b7a4100ebb6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6e5a5d2736922b7411668b508…
Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Fri Jun 8 22:28:04 2007 +0200 wined3d: DDraw surfaces are QWORD aligned. --- dlls/wined3d/context.c | 8 ++++---- dlls/wined3d/device.c | 2 +- dlls/wined3d/directx.c | 6 ++++++ dlls/wined3d/surface.c | 15 +++++++++------ dlls/wined3d/wined3d_private.h | 4 +--- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index ee9e96e..5570225 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -347,10 +347,10 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); checkGLcall("glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);"); - glPixelStorei(GL_PACK_ALIGNMENT, SURFACE_ALIGNMENT); - checkGLcall("glPixelStorei(GL_PACK_ALIGNMENT, SURFACE_ALIGNMENT);"); - glPixelStorei(GL_UNPACK_ALIGNMENT, SURFACE_ALIGNMENT); - checkGLcall("glPixelStorei(GL_UNPACK_ALIGNMENT, SURFACE_ALIGNMENT);"); + glPixelStorei(GL_PACK_ALIGNMENT, This->surface_alignment); + checkGLcall("glPixelStorei(GL_PACK_ALIGNMENT, This->surface_alignment);"); + glPixelStorei(GL_UNPACK_ALIGNMENT, This->surface_alignment); + checkGLcall("glPixelStorei(GL_UNPACK_ALIGNMENT, This->surface_alignment);"); if(GL_SUPPORT(APPLE_CLIENT_STORAGE)) { /* Most textures will use client storage if supported. Exceptions are non-native power of 2 textures diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 2703d7b..9dc7f28 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -674,7 +674,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U Size = ((max(Width,4) * tableEntry->bpp) * max(Height,4)); } else { /* The pitch is a multiple of 4 bytes */ - Size = ((Width * tableEntry->bpp) + SURFACE_ALIGNMENT - 1) & ~(SURFACE_ALIGNMENT - 1); + Size = ((Width * tableEntry->bpp) + This->surface_alignment - 1) & ~(This->surface_alignment - 1); Size *= Height; } diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 5d14fde..742e16b 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2462,6 +2462,12 @@ static HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter, IWineD3D_AddRef(object->wineD3D); object->parent = parent; + if(This->dxVersion == 7) { + object->surface_alignment = 8; + } else { + object->surface_alignment = 4; + } + /* Set the state up as invalid until the device is fully created */ object->state = WINED3DERR_DRIVERINTERNALERROR; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 6398e77..4640bef 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -79,9 +79,10 @@ static void surface_download_data(IWineD3DSurfaceImpl *This) { } if (This->Flags & SFLAG_NONPOW2) { + unsigned char alignment = This->resource.wineD3DDevice->surface_alignment; src_pitch = This->bytesPerPixel * This->pow2Width; dst_pitch = IWineD3DSurface_GetPitch((IWineD3DSurface *) This); - src_pitch = (src_pitch + SURFACE_ALIGNMENT - 1) & ~(SURFACE_ALIGNMENT - 1); + src_pitch = (src_pitch + alignment - 1) & ~(alignment - 1); mem = HeapAlloc(GetProcessHeap(), 0, src_pitch * This->pow2Height); } else { mem = This->resource.allocatedMemory; @@ -1320,7 +1321,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHDC) { } b_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - b_info->bmiHeader.biWidth = This->currentDesc.Width; + /* TODO: Is there a nicer way to force a specific alignment? (8 byte for ddraw) */ + b_info->bmiHeader.biWidth = IWineD3DSurface_GetPitch(iface) / This->bytesPerPixel; b_info->bmiHeader.biHeight = -This->currentDesc.Height -extraline; b_info->bmiHeader.biSizeImage = ( This->currentDesc.Height + extraline) * IWineD3DSurface_GetPitch(iface); b_info->bmiHeader.biPlanes = 1; @@ -1978,7 +1980,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, BO /* Stick to the alignment for the converted surface too, makes it easier to load the surface */ outpitch = width * bpp; - outpitch = (outpitch + SURFACE_ALIGNMENT - 1) & ~(SURFACE_ALIGNMENT - 1); + outpitch = (outpitch + device->surface_alignment - 1) & ~(device->surface_alignment - 1); mem = HeapAlloc(GetProcessHeap(), 0, outpitch * height); if(!mem) { @@ -2264,7 +2266,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORM format == WINED3DFMT_DXT4 || format == WINED3DFMT_DXT5) { This->resource.size = ((max(This->pow2Width, 4) * formatEntry->bpp) * max(This->pow2Height, 4)); } else { - This->resource.size = ((This->pow2Width * formatEntry->bpp) + SURFACE_ALIGNMENT - 1) & ~(SURFACE_ALIGNMENT - 1); + unsigned char alignment = This->resource.wineD3DDevice->surface_alignment; + This->resource.size = ((This->pow2Width * formatEntry->bpp) + alignment - 1) & ~(alignment - 1); This->resource.size *= This->pow2Height; } @@ -3483,9 +3486,9 @@ DWORD WINAPI IWineD3DSurfaceImpl_GetPitch(IWineD3DSurface *iface) { This->resource.format == WINED3DFMT_DXT4 || This->resource.format == WINED3DFMT_DXT5) /* DXT2/3/4/5 is 16 bytes per block */ ret = ((This->currentDesc.Width + 3) >> 2) << 4; else { + unsigned char alignment = This->resource.wineD3DDevice->surface_alignment; ret = This->bytesPerPixel * This->currentDesc.Width; /* Bytes / row */ - /* Surfaces are 32 bit aligned */ - ret = (ret + SURFACE_ALIGNMENT - 1) & ~(SURFACE_ALIGNMENT - 1); + ret = (ret + alignment - 1) & ~(alignment - 1); } TRACE("(%p) Returning %d\n", This, ret); return ret; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index de38042..8549232 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -647,6 +647,7 @@ struct IWineD3DDeviceImpl BOOL view_ident; /* true iff view matrix is identity */ BOOL untransformed; BOOL vertexBlendUsed; /* To avoid needless setting of the blend matrices */ + unsigned char surface_alignment; /* Line Alignment of surfaces */ /* State block related */ BOOL isRecordingState; @@ -1184,9 +1185,6 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetClipper(IWineD3DSurface *iface, IWineD3DCl BOOL CalculateTexRect(IWineD3DSurfaceImpl *This, RECT *Rect, float glTexCoord[4]); -/* Alignment of the pitch */ -#define SURFACE_ALIGNMENT 4 - /***************************************************************************** * IWineD3DVertexDeclaration implementation structure */
1
0
0
0
Stefan Dösinger : wined3d: Present does not clear the depth stencil.
by Alexandre Julliard
14 Jun '07
14 Jun '07
Module: wine Branch: master Commit: 078523f73e7b708dab06e888c24a1595bb5a63d8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=078523f73e7b708dab06e888c…
Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Thu Jun 14 11:18:03 2007 +0200 wined3d: Present does not clear the depth stencil. --- dlls/d3d8/tests/visual.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/d3d9/tests/visual.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/swapchain.c | 18 ++------------ 3 files changed, 113 insertions(+), 15 deletions(-) diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index f755679..e4178f2 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -116,6 +116,8 @@ static IDirect3DDevice8 *init_d3d8(void) present_parameters.BackBufferWidth = 640; present_parameters.BackBufferHeight = 480; present_parameters.BackBufferFormat = D3DFMT_X8R8G8B8; + present_parameters.EnableAutoDepthStencil = TRUE; + present_parameters.AutoDepthStencilFormat = D3DFMT_D16; hr = IDirect3D8_CreateDevice(d3d8_ptr, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, present_parameters.hDeviceWindow, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device_ptr); ok(hr == D3D_OK, "IDirect3D_CreateDevice returned: %s\n", DXGetErrorString8(hr)); @@ -441,6 +443,58 @@ static void fog_test(IDirect3DDevice8 *device) ok(hr == D3D_OK, "Turning off fog calculations returned %s\n", DXGetErrorString8(hr)); } +static void present_test(IDirect3DDevice8 *device) +{ + struct vertex quad[] = + { + {-1.0f, -1.0f, 0.9f, 0xffff0000}, + {-1.0f, 1.0f, 0.9f, 0xffff0000}, + { 1.0f, -1.0f, 0.1f, 0xffff0000}, + { 1.0f, 1.0f, 0.1f, 0xffff0000}, + }; + HRESULT hr; + DWORD color; + + /* Does the Present clear the depth stencil? Clear the depth buffer with some value != 0, + * then call Present. Then clear the color buffer to make sure it has some defined content + * after the Present with D3DSWAPEFFECT_DISCARD. After that draw a plane that is somewhere cut + * by the depth value. + */ + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 0.75, 0); + ok(hr == D3D_OK, "IDirect3DDevice8_Clear returned %s\n", DXGetErrorString8(hr)); + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.4, 0); + + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, D3DZB_TRUE); + ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState returned %s\n", DXGetErrorString8(hr)); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZFUNC, D3DCMP_GREATER); + ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState returned %s\n", DXGetErrorString8(hr)); + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(hr == D3D_OK, "IDirect3DDevice8_SetFVF returned %s\n", DXGetErrorString8(hr)); + + hr = IDirect3DDevice8_BeginScene(device); + ok(hr == D3D_OK, "IDirect3DDevice8_BeginScene failed with %s\n", DXGetErrorString8(hr)); + if(hr == D3D_OK) + { + /* No lights are defined... That means, lit vertices should be entirely black */ + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2 /*PrimCount */, quad, sizeof(quad[0])); + ok(hr == D3D_OK, "IDirect3DDevice8_DrawIndexedPrimitiveUP failed with %s\n", DXGetErrorString8(hr)); + + hr = IDirect3DDevice8_EndScene(device); + ok(hr == D3D_OK, "IDirect3DDevice8_EndScene failed with %s\n", DXGetErrorString8(hr)); + } + + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE); + ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState returned %s\n", DXGetErrorString8(hr)); + + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); + color = getPixelColor(device, 512, 240); + ok(color == 0x00ffffff, "Present failed: Got color 0x%08x, expected 0x00ffffff.\n", color); + color = getPixelColor(device, 64, 240); + ok(color == 0x00ff0000, "Present failed: Got color 0x%08x, expected 0x00ff0000.\n", color); +} + START_TEST(visual) { IDirect3DDevice8 *device_ptr; @@ -492,6 +546,7 @@ START_TEST(visual) lighting_test(device_ptr); clear_test(device_ptr); fog_test(device_ptr); + present_test(device_ptr); cleanup: if(device_ptr) IDirect3DDevice8_Release(device_ptr); diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index d961d80..3ab45e1 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -116,6 +116,8 @@ static IDirect3DDevice9 *init_d3d9(void) present_parameters.BackBufferWidth = 640; present_parameters.BackBufferHeight = 480; present_parameters.BackBufferFormat = D3DFMT_X8R8G8B8; + present_parameters.EnableAutoDepthStencil = TRUE; + present_parameters.AutoDepthStencilFormat = D3DFMT_D16; hr = IDirect3D9_CreateDevice(d3d9_ptr, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, present_parameters.hDeviceWindow, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device_ptr); ok(hr == D3D_OK, "IDirect3D_CreateDevice returned: %s\n", DXGetErrorString9(hr)); @@ -1114,6 +1116,58 @@ static void texbem_test(IDirect3DDevice9 *device) } } +static void present_test(IDirect3DDevice9 *device) +{ + struct vertex quad[] = + { + {-1.0f, -1.0f, 0.9f, 0xffff0000}, + {-1.0f, 1.0f, 0.9f, 0xffff0000}, + { 1.0f, -1.0f, 0.1f, 0xffff0000}, + { 1.0f, 1.0f, 0.1f, 0xffff0000}, + }; + HRESULT hr; + DWORD color; + + /* Does the Present clear the depth stencil? Clear the depth buffer with some value != 0, + * then call Present. Then clear the color buffer to make sure it has some defined content + * after the Present with D3DSWAPEFFECT_DISCARD. After that draw a plane that is somewhere cut + * by the depth value. + */ + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 0.75, 0); + ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.4, 0); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_TRUE); + ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZFUNC, D3DCMP_GREATER); + ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %s\n", DXGetErrorString9(hr)); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %s\n", DXGetErrorString9(hr)); + + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %s\n", DXGetErrorString9(hr)); + if(hr == D3D_OK) + { + /* No lights are defined... That means, lit vertices should be entirely black */ + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2 /*PrimCount */, quad, sizeof(quad[0])); + ok(hr == D3D_OK, "IDirect3DDevice9_DrawIndexedPrimitiveUP failed with %s\n", DXGetErrorString9(hr)); + + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with %s\n", DXGetErrorString9(hr)); + } + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE); + ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %s\n", DXGetErrorString9(hr)); + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); + color = getPixelColor(device, 512, 240); + ok(color == 0x00ffffff, "Present failed: Got color 0x%08x, expected 0x00ffffff.\n", color); + color = getPixelColor(device, 64, 240); + ok(color == 0x00ff0000, "Present failed: Got color 0x%08x, expected 0x00ff0000.\n", color); +} + START_TEST(visual) { IDirect3DDevice9 *device_ptr; @@ -1169,6 +1223,7 @@ START_TEST(visual) clear_test(device_ptr); fog_test(device_ptr); test_cube_wrap(device_ptr); + present_test(device_ptr); if (caps.VertexShaderVersion >= D3DVS_VERSION(2, 0)) { diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index e7a3173..b449856 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -148,7 +148,6 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CONST RECT *pSourceRect, CONST RECT *pDestRect, HWND hDestWindowOverride, CONST RGNDATA *pDirtyRegion, DWORD dwFlags) { IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface; - DWORD clear_flags = 0; unsigned int sync; int retval; @@ -298,22 +297,11 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO LEAVE_GL(); - if (This->wineD3DDevice->stencilBufferTarget) { - clear_flags |= WINED3DCLEAR_STENCIL|WINED3DCLEAR_ZBUFFER; - } - - /* Although this is not strictly required, a simple demo showed this does occur - on (at least non-debug) d3d */ if (This->presentParms.SwapEffect == WINED3DSWAPEFFECT_DISCARD) { + TRACE("Clearing the color buffer with pink color\n"); - TRACE("Clearing\n"); - - IWineD3DDevice_Clear((IWineD3DDevice*)This->wineD3DDevice, 0, NULL, clear_flags|WINED3DCLEAR_TARGET, 0x00, 1.0, 0); - - } else if (clear_flags) { - TRACE("Clearing z/stencil buffer\n"); - - IWineD3DDevice_Clear((IWineD3DDevice*)This->wineD3DDevice, 0, NULL, clear_flags, 0x00, 1.0, 0); + IWineD3DDevice_Clear((IWineD3DDevice*)This->wineD3DDevice, 0, NULL, + WINED3DCLEAR_TARGET, 0xff00ffff, 1.0, 0); } if(((IWineD3DSurfaceImpl *) This->frontBuffer)->Flags & SFLAG_INSYSMEM ||
1
0
0
0
Stefan Dösinger : wined3d: Implement vertical refresh sync.
by Alexandre Julliard
14 Jun '07
14 Jun '07
Module: wine Branch: master Commit: c9b8a79e0bd61204cfe7b88362617da9a485f0e0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c9b8a79e0bd61204cfe7b8836…
Author: Stefan Dösinger <stefandoesinger(a)gmx.at> Date: Sun Jun 3 13:20:27 2007 +0200 wined3d: Implement vertical refresh sync. --- dlls/wined3d/directx.c | 4 +++ dlls/wined3d/surface.c | 33 ++++++++++++++++++++++++++--- dlls/wined3d/swapchain.c | 44 ++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 1 + include/ddraw.h | 4 +++ include/wine/wined3d_gl.h | 9 ++++++++ include/wine/wined3d_types.h | 11 ++++++++++ 7 files changed, 102 insertions(+), 4 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c9b8a79e0bd61204cfe7b…
1
0
0
0
← Newer
1
...
42
43
44
45
46
47
48
...
86
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
Results per page:
10
25
50
100
200