ReactOS.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
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
List overview
Download
Ros-diffs
January 2019
----- 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
ros-diffs@reactos.org
31 participants
300 discussions
Start a n
N
ew thread
[reactos] 01/01: [MDI] Fix GCC build
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1b92120fc9263352d402e…
commit 1b92120fc9263352d402eb50bda93266fa542053 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Jan 20 11:09:54 2019 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sun Jan 20 11:09:54 2019 +0100 [MDI] Fix GCC build --- modules/rosapps/templates/mdi/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rosapps/templates/mdi/main.c b/modules/rosapps/templates/mdi/main.c index 977a082350..6fa1d144e7 100644 --- a/modules/rosapps/templates/mdi/main.c +++ b/modules/rosapps/templates/mdi/main.c @@ -127,7 +127,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) hFont = CreateFont(-MulDiv(8,GetDeviceCaps(hdc,LOGPIXELSY),72), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _T("MS Sans Serif")); ReleaseDC(0, hdc); - hFrameWnd = CreateWindowEx(0, (LPCTSTR)hFrameWndClass, szTitle, + hFrameWnd = CreateWindowEx(0, (LPCTSTR)(ULONG_PTR)hFrameWndClass, szTitle, // hFrameWnd = CreateWindow(szFrameClass, szTitle, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
6 years
1
0
0
0
[reactos] 01/01: [BUTTERFLIES] Fix GCC build
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=32faa247331dc744d307a…
commit 32faa247331dc744d307aa9fd60146aa59cde8ba Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Jan 20 11:06:42 2019 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sun Jan 20 11:06:42 2019 +0100 [BUTTERFLIES] Fix GCC build --- modules/rosapps/applications/screensavers/butterflies/butterflies.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rosapps/applications/screensavers/butterflies/butterflies.c b/modules/rosapps/applications/screensavers/butterflies/butterflies.c index 1c181fea91..60f7ed4d17 100644 --- a/modules/rosapps/applications/screensavers/butterflies/butterflies.c +++ b/modules/rosapps/applications/screensavers/butterflies/butterflies.c @@ -230,7 +230,7 @@ void Display() } -INT_PTR AboutProc(HWND hdlg, UINT msg, WPARAM wpm, LPARAM lpm){ +INT_PTR CALLBACK AboutProc(HWND hdlg, UINT msg, WPARAM wpm, LPARAM lpm){ switch(msg){ case WM_CTLCOLORSTATIC:
6 years
1
0
0
0
[reactos] 01/01: [NTOS:KE] Remove unnecessary breakpoint in KiRaiseException. CORE-15640
by Thomas Faber
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=21ea19c40f08a7dc040da…
commit 21ea19c40f08a7dc040dad62f2d85d4582dca026 Author: Thomas Faber <thomas.faber(a)reactos.org> AuthorDate: Sat Jan 19 11:26:39 2019 +0100 Commit: Thomas Faber <thomas.faber(a)reactos.org> CommitDate: Sun Jan 20 09:57:03 2019 +0100 [NTOS:KE] Remove unnecessary breakpoint in KiRaiseException. CORE-15640 --- ntoskrnl/ke/except.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ntoskrnl/ke/except.c b/ntoskrnl/ke/except.c index 525fc83686..e789ffc81b 100644 --- a/ntoskrnl/ke/except.c +++ b/ntoskrnl/ke/except.c @@ -138,7 +138,6 @@ KiRaiseException(IN PEXCEPTION_RECORD ExceptionRecord, { /* Don't fail silently */ DPRINT1("KiRaiseException: Failed to Probe\n"); - DbgBreakPoint(); /* Return the exception code */ _SEH2_YIELD(return _SEH2_GetExceptionCode());
6 years
1
0
0
0
[reactos] 01/01: [ROSAPPS] Fix 64 bit issues
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2890a22179528006e637c…
commit 2890a22179528006e637cd5efdfc2abb7e2ceb5b Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sun Jan 20 09:04:58 2019 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Sun Jan 20 09:04:58 2019 +0100 [ROSAPPS] Fix 64 bit issues --- modules/rosapps/applications/CMakeLists.txt | 6 ++-- .../screensavers/butterflies/butterflies.c | 6 ++-- .../applications/screensavers/matrix/config.c | 8 +++--- .../applications/screensavers/matrix/screensave.c | 2 +- .../rosapps/applications/sysutils/CMakeLists.txt | 4 ++- modules/rosapps/applications/sysutils/ctm/ctm.c | 7 +++-- .../rosapps/applications/sysutils/tlist/tlist.c | 32 +++++++++++----------- modules/rosapps/templates/dialog/memdlg.c | 4 +-- modules/rosapps/templates/mdi/framewnd.c | 4 +-- modules/rosapps/templates/mdi/main.c | 4 +-- 10 files changed, 41 insertions(+), 36 deletions(-) diff --git a/modules/rosapps/applications/CMakeLists.txt b/modules/rosapps/applications/CMakeLists.txt index 74dd129590..19c0ecfe9a 100644 --- a/modules/rosapps/applications/CMakeLists.txt +++ b/modules/rosapps/applications/CMakeLists.txt @@ -1,7 +1,9 @@ add_subdirectory(cmdutils) add_subdirectory(devutils) -add_subdirectory(explorer-old) -add_subdirectory(fraginator) +if (ARCH STREQUAL "i386") + add_subdirectory(explorer-old) + add_subdirectory(fraginator) +endif() add_subdirectory(imagesoft) add_subdirectory(net) add_subdirectory(notevil) diff --git a/modules/rosapps/applications/screensavers/butterflies/butterflies.c b/modules/rosapps/applications/screensavers/butterflies/butterflies.c index b11a45dd13..1c181fea91 100644 --- a/modules/rosapps/applications/screensavers/butterflies/butterflies.c +++ b/modules/rosapps/applications/screensavers/butterflies/butterflies.c @@ -230,7 +230,7 @@ void Display() } -BOOL AboutProc(HWND hdlg, UINT msg, WPARAM wpm, LPARAM lpm){ +INT_PTR AboutProc(HWND hdlg, UINT msg, WPARAM wpm, LPARAM lpm){ switch(msg){ case WM_CTLCOLORSTATIC: @@ -238,7 +238,7 @@ BOOL AboutProc(HWND hdlg, UINT msg, WPARAM wpm, LPARAM lpm){ { SetTextColor((HDC)wpm, RGB(0,0,255)); SetBkColor((HDC)wpm, (COLORREF)GetSysColor(COLOR_3DFACE)); - return((int)GetSysColorBrush(COLOR_3DFACE)); + return (INT_PTR)GetSysColorBrush(COLOR_3DFACE); } break; case WM_COMMAND: @@ -314,7 +314,7 @@ BOOL WINAPI ScreenSaverConfigureDialog(HWND hDlg, UINT message, EndDialog(hDlg, TRUE); break; case IDABOUT: - DialogBox(hInstance, MAKEINTRESOURCE(IDD_DLG_ABOUT), hDlg, (DLGPROC)AboutProc); + DialogBox(hInstance, MAKEINTRESOURCE(IDD_DLG_ABOUT), hDlg, AboutProc); break; } } diff --git a/modules/rosapps/applications/screensavers/matrix/config.c b/modules/rosapps/applications/screensavers/matrix/config.c index 1caa402593..f504a3b23c 100644 --- a/modules/rosapps/applications/screensavers/matrix/config.c +++ b/modules/rosapps/applications/screensavers/matrix/config.c @@ -36,7 +36,7 @@ void AddFonts(HWND hwndCombo) lf.lfFaceName[0] = _T('\0'); hdc = GetDC(0); - EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC)EnumFontProc, (LONG)hwndCombo, 0); + EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC)EnumFontProc, (LONG_PTR)hwndCombo, 0); ReleaseDC(0, hdc); } @@ -53,7 +53,7 @@ void UpdatePreview(HWND hwnd) // // Dialogbox procedure for Configuration window // -BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { static TCHAR buf[256]; HWND hwndCombo, hwndCtrl; @@ -112,7 +112,7 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { SetTextColor((HDC)wParam, RGB(0,80,0)); SetBkColor((HDC)wParam, GetSysColor(COLOR_3DFACE)); - return (BOOL)GetSysColorBrush(COLOR_3DFACE); + return (INT_PTR)GetSysColorBrush(COLOR_3DFACE); } else if(GetDlgCtrlID((HWND)lParam) == IDC_PREVIEW) { @@ -167,7 +167,7 @@ BOOL CALLBACK ConfigDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) DrawText(hdc, buf, -1, &rect, DT_CENTER|DT_VCENTER|DT_WORDBREAK); - return (BOOL)GetStockObject(NULL_BRUSH); + return (INT_PTR)GetStockObject(NULL_BRUSH); } else { diff --git a/modules/rosapps/applications/screensavers/matrix/screensave.c b/modules/rosapps/applications/screensavers/matrix/screensave.c index adfc9d9191..2c521598aa 100644 --- a/modules/rosapps/applications/screensavers/matrix/screensave.c +++ b/modules/rosapps/applications/screensavers/matrix/screensave.c @@ -121,7 +121,7 @@ VOID ParseCommandLine(LPWSTR szCmdLine, UCHAR *chOption, HWND *hwndParent) if(isdigit(ch)) { - unsigned int i = _wtoi(szCmdLine - 1); + ULONG_PTR i = _wtoi(szCmdLine - 1); *hwndParent = (HWND)i; } else diff --git a/modules/rosapps/applications/sysutils/CMakeLists.txt b/modules/rosapps/applications/sysutils/CMakeLists.txt index ec5888deb7..997681dbf8 100644 --- a/modules/rosapps/applications/sysutils/CMakeLists.txt +++ b/modules/rosapps/applications/sysutils/CMakeLists.txt @@ -6,7 +6,9 @@ add_subdirectory(kill) add_subdirectory(logevent) add_subdirectory(lsdd) add_subdirectory(man) -add_subdirectory(pedump) +if (ARCH STREQUAL "i386") + add_subdirectory(pedump) +endif() add_subdirectory(regexpl) add_subdirectory(rosddt) add_subdirectory(screenshot) diff --git a/modules/rosapps/applications/sysutils/ctm/ctm.c b/modules/rosapps/applications/sysutils/ctm/ctm.c index dd45ff0a6f..9f6715e579 100644 --- a/modules/rosapps/applications/sysutils/ctm/ctm.c +++ b/modules/rosapps/applications/sysutils/ctm/ctm.c @@ -189,7 +189,8 @@ void DisplayScreen() lines = ProcPerScreen; for (idx=0; idx<ProcPerScreen; idx++) { - int len, i; + int i; + SIZE_T len; TCHAR lpNumber[5]; TCHAR lpPid[8]; TCHAR lpCpu[6]; @@ -501,7 +502,7 @@ void PerfDataRefresh() // so that we can establish delta values pPDOld = NULL; for (Idx2=0; Idx2<ProcessCountOld; Idx2++) { - if (pPerfDataOld[Idx2].ProcessId == (ULONG)(pSPI->UniqueProcessId) && + if (pPerfDataOld[Idx2].ProcessId == HandleToUlong(pSPI->UniqueProcessId) && /* check also for the creation time, a new process may have an id of an old one */ pPerfDataOld[Idx2].CreateTime.QuadPart == pSPI->CreateTime.QuadPart) { pPDOld = &pPerfDataOld[Idx2]; @@ -525,7 +526,7 @@ void PerfDataRefresh() #endif } - pPerfData[Idx].ProcessId = (ULONG)(pSPI->UniqueProcessId); + pPerfData[Idx].ProcessId = HandleToUlong(pSPI->UniqueProcessId); pPerfData[Idx].CreateTime = pSPI->CreateTime; if (pPDOld) { diff --git a/modules/rosapps/applications/sysutils/tlist/tlist.c b/modules/rosapps/applications/sysutils/tlist/tlist.c index 85958fbb26..5d8db27018 100644 --- a/modules/rosapps/applications/sysutils/tlist/tlist.c +++ b/modules/rosapps/applications/sysutils/tlist/tlist.c @@ -47,7 +47,7 @@ void *PsaiMalloc(SIZE_T size) NtCurrentProcess(), &pBuf, 0, - (PULONG)&size, + &size, MEM_COMMIT, PAGE_READWRITE ); @@ -58,7 +58,7 @@ void *PsaiMalloc(SIZE_T size) void PsaiFree(void *ptr) { - ULONG nSize = 0; + SIZE_T nSize = 0; NtFreeVirtualMemory(NtCurrentProcess(), &ptr, &nSize, MEM_RELEASE); } @@ -117,7 +117,7 @@ ProcessHasDescendants ( if (NULL == pInfo) return 0; do { - if (ALREADY_PROCESSED != (DWORD)pInfo->InheritedFromUniqueProcessId) + if (ALREADY_PROCESSED != HandleToUlong(pInfo->InheritedFromUniqueProcessId)) { if ((Pid != (HANDLE)pInfo->UniqueProcessId) && (Pid == (HANDLE)pInfo->InheritedFromUniqueProcessId)) { @@ -158,8 +158,8 @@ int WINAPI PrintProcessInfoDepth ( wprintf ( L"%s (%d, %d) %s\n", Module, - pInfo->UniqueProcessId, - pInfo->InheritedFromUniqueProcessId, + HandleToUlong(pInfo->UniqueProcessId), + HandleToUlong(pInfo->InheritedFromUniqueProcessId), Title ); return EXIT_SUCCESS; @@ -177,13 +177,13 @@ PrintProcessAndDescendants ( if (NULL == pInfo) return EXIT_FAILURE; /* Print current pInfo process */ PrintProcessInfoDepth (pInfo, Depth ++); - pInfo->InheritedFromUniqueProcessId = (HANDLE)ALREADY_PROCESSED; + pInfo->InheritedFromUniqueProcessId = UlongToHandle(ALREADY_PROCESSED); /* Save current process' PID */ Pid = pInfo->UniqueProcessId; /* Scan and print possible children */ do { - if (ALREADY_PROCESSED != (DWORD)pInfo->InheritedFromUniqueProcessId) + if (ALREADY_PROCESSED != HandleToUlong(pInfo->InheritedFromUniqueProcessId)) { if (Pid == pInfo->InheritedFromUniqueProcessId) { @@ -198,7 +198,7 @@ PrintProcessAndDescendants ( else { PrintProcessInfoDepth (pInfo, Depth); - pInfo->InheritedFromUniqueProcessId = (HANDLE)ALREADY_PROCESSED; + pInfo->InheritedFromUniqueProcessId = UlongToHandle(ALREADY_PROCESSED); } } } @@ -227,16 +227,16 @@ int WINAPI PrintProcessList (BOOL DisplayTree) { GetProcessInfo (pInfo, & Module, & Title); wprintf ( - L"%4d %-16s %s\n", - pInfo->UniqueProcessId, + L"%4d %-16s %s (%04d)\n", + HandleToUlong(pInfo->UniqueProcessId), Module, Title, - pInfo->InheritedFromUniqueProcessId + HandleToUlong(pInfo->InheritedFromUniqueProcessId) ); } else { - if (ALREADY_PROCESSED != (DWORD)pInfo->InheritedFromUniqueProcessId) + if (ALREADY_PROCESSED != HandleToUlong(pInfo->InheritedFromUniqueProcessId)) { PrintProcessAndDescendants (pInfo, pInfoBase, 0); } @@ -310,8 +310,8 @@ int WINAPI PrintThreads (PSYSTEM_PROCESS_INFORMATION pInfo) NtClose (hThread); /* Now print the collected information */ - wprintf (L" %4d Win32StartAddr:0x%08x LastErr:0x%08x State:%s\n", - CurThread->ClientId.UniqueThread, + wprintf (L" %4d Win32StartAddr:0x%p LastErr:0x%08x State:%s\n", + HandleToUlong(CurThread->ClientId.UniqueThread), Win32StartAddress, 0 /* FIXME: ((PTEB) tInfo.TebBaseAddress)->LastErrorValue */, ThreadStateName[CurThread->ThreadState] @@ -357,7 +357,7 @@ int WINAPI PrintProcess (char * PidStr) CLIENT_ID ClientId = {0, 0}; - ClientId.UniqueProcess = (PVOID) atol (PidStr); + ClientId.UniqueProcess = UlongToHandle(atol (PidStr)); if (FALSE == AcquirePrivileges ()) { @@ -411,7 +411,7 @@ int WINAPI PrintProcess (char * PidStr) GetProcessInfo (pInfo, & Module, & Title); - wprintf (L"%4d %s\n", ClientId.UniqueProcess, Module); + wprintf (L"%4d %s\n", HandleToUlong(ClientId.UniqueProcess), Module); #if 0 printf (" CWD: %s\n", ""); /* it won't appear if empty */ printf (" CmdLine: %s\n", ""); /* it won't appear if empty */ diff --git a/modules/rosapps/templates/dialog/memdlg.c b/modules/rosapps/templates/dialog/memdlg.c index 310d242b43..dd95e49f42 100644 --- a/modules/rosapps/templates/dialog/memdlg.c +++ b/modules/rosapps/templates/dialog/memdlg.c @@ -40,9 +40,9 @@ LRESULT CALLBACK DialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lP LPWORD lpwAlign(LPWORD lpIn) { - ULONG ul; + ULONG_PTR ul; - ul = (ULONG)lpIn; + ul = (ULONG_PTR)lpIn; ul += 3; ul >>= 2; ul <<= 2; diff --git a/modules/rosapps/templates/mdi/framewnd.c b/modules/rosapps/templates/mdi/framewnd.c index ef4e5d0d46..184927a251 100644 --- a/modules/rosapps/templates/mdi/framewnd.c +++ b/modules/rosapps/templates/mdi/framewnd.c @@ -205,7 +205,7 @@ void OnEnterMenuLoop(HWND hWnd) // Update the status bar pane sizes nParts = -1; - SendMessage(hStatusBar, SB_SETPARTS, 1, (long)&nParts); + SendMessage(hStatusBar, SB_SETPARTS, 1, (LPARAM)&nParts); bInMenuLoop = TRUE; SendMessage(hStatusBar, SB_SETTEXT, (WPARAM)0, (LPARAM)_T("")); } @@ -221,7 +221,7 @@ void OnExitMenuLoop(HWND hWnd) nParts[0] = 100; nParts[1] = 210; nParts[2] = rc.right; - SendMessage(hStatusBar, SB_SETPARTS, 3, (long)nParts); + SendMessage(hStatusBar, SB_SETPARTS, 3, (LPARAM)nParts); SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM)_T("")); UpdateStatusBar(); } diff --git a/modules/rosapps/templates/mdi/main.c b/modules/rosapps/templates/mdi/main.c index 6cb88c281a..977a082350 100644 --- a/modules/rosapps/templates/mdi/main.c +++ b/modules/rosapps/templates/mdi/main.c @@ -127,7 +127,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) hFont = CreateFont(-MulDiv(8,GetDeviceCaps(hdc,LOGPIXELSY),72), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _T("MS Sans Serif")); ReleaseDC(0, hdc); - hFrameWnd = CreateWindowEx(0, (LPCTSTR)(int)hFrameWndClass, szTitle, + hFrameWnd = CreateWindowEx(0, (LPCTSTR)hFrameWndClass, szTitle, // hFrameWnd = CreateWindow(szFrameClass, szTitle, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, @@ -165,7 +165,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) nParts[0] = 100; nParts[1] = 210; nParts[2] = 400; - SendMessage(hStatusBar, SB_SETPARTS, 3, (long)nParts); + SendMessage(hStatusBar, SB_SETPARTS, 3, (LPARAM)nParts); } else { CheckMenuItem(hMenuOptions, ID_OPTIONS_TOOLBAR, MF_BYCOMMAND|MF_GRAYED); CheckMenuItem(hMenuOptions, ID_OPTIONS_STATUSBAR, MF_BYCOMMAND|MF_GRAYED);
6 years
1
0
0
0
[reactos] 01/01: [WIN32SS:NTUSER] Fix Window-snap madness (#1246)
by Denis Malikov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=37af78775ddb371501fbc…
commit 37af78775ddb371501fbcfb74c766a7d68f5470a Author: Denis Malikov <Getequ(a)users.noreply.github.com> AuthorDate: Sun Jan 20 05:05:19 2019 +0700 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Sat Jan 19 23:05:19 2019 +0100 [WIN32SS:NTUSER] Fix Window-snap madness (#1246) Desktop window was treated as possible to resize. Fix for 7e396787 CORE-15624 --- win32ss/user/ntuser/defwnd.c | 5 +++++ win32ss/user/ntuser/nonclient.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/win32ss/user/ntuser/defwnd.c b/win32ss/user/ntuser/defwnd.c index 67215d1f26..fc55c4acfb 100644 --- a/win32ss/user/ntuser/defwnd.c +++ b/win32ss/user/ntuser/defwnd.c @@ -787,6 +787,11 @@ IntDefWindowProc( PWND topWnd = UserGetWindowObject(hwndTop); if (topWnd) { + if ((topWnd->style & WS_THICKFRAME) == 0) + { + return 0; + } + if (wParam == VK_DOWN) { if (topWnd->style & WS_MAXIMIZE) diff --git a/win32ss/user/ntuser/nonclient.c b/win32ss/user/ntuser/nonclient.c index 7a5fcc445e..ba8dececb1 100644 --- a/win32ss/user/ntuser/nonclient.c +++ b/win32ss/user/ntuser/nonclient.c @@ -395,7 +395,7 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam) if (msg.message == WM_LBUTTONUP) { // check for snapping if was moved by caption - if (hittest == HTCAPTION) + if (hittest == HTCAPTION && thickframe && (ExStyle & WS_EX_MDICHILD) == 0) { RECT snapRect; BOOL doSideSnap = FALSE; @@ -1618,6 +1618,10 @@ NC_HandleNCLButtonDblClk(PWND pWnd, WPARAM wParam, LPARAM lParam) case HTBOTTOM: { RECT sizingRect = pWnd->rcWindow, mouseRect; + + if (pWnd->ExStyle & WS_EX_MDICHILD) + break; + UserSystemParametersInfo(SPI_GETWORKAREA, 0, &mouseRect, 0); co_WinPosSetWindowPos(pWnd,
6 years
1
0
0
0
[reactos] 01/01: [WINMM:MIDIMAP] Support Windows XP compatible MIDIMap registry setting (#1240)
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d893a6c3558994406c786…
commit d893a6c3558994406c786d72b26f0c4f4a33f071 Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Sun Jan 20 00:48:22 2019 +0300 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Sat Jan 19 22:48:22 2019 +0100 [WINMM:MIDIMAP] Support Windows XP compatible MIDIMap registry setting (#1240) CORE-15602 --- dll/win32/winmm/midimap/midimap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dll/win32/winmm/midimap/midimap.c b/dll/win32/winmm/midimap/midimap.c index e8214a63b4..fd9ecae485 100644 --- a/dll/win32/winmm/midimap/midimap.c +++ b/dll/win32/winmm/midimap/midimap.c @@ -239,6 +239,11 @@ static BOOL MIDIMAP_LoadSettings(MIDIMAPDATA* mom) { ret = MIDIMAP_LoadSettingsDefault(mom, buffer); } + else if (!RegQueryValueExW(hKey, L"szPname", 0, &type, (void*)buffer, &size) && *buffer) + { + /* Windows XP and higher setting */ + ret = MIDIMAP_LoadSettingsDefault(mom, buffer); + } else { ret = MIDIMAP_LoadSettingsDefault(mom, NULL);
6 years
1
0
0
0
[reactos] 01/01: [USETUP] Implement handling Home/End keys in Boot Loader Page (#1265)
by Yaroslav Kibysh
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8d15720b3125ad95b52db…
commit 8d15720b3125ad95b52db347f0edac9c85c49e82 Author: Yaroslav Kibysh <yanet.prod(a)gmail.com> AuthorDate: Sat Jan 19 19:44:13 2019 +0200 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Sat Jan 19 18:44:13 2019 +0100 [USETUP] Implement handling Home/End keys in Boot Loader Page (#1265) --- base/setup/usetup/usetup.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/base/setup/usetup/usetup.c b/base/setup/usetup/usetup.c index 3199cba9b7..5aeb33697c 100644 --- a/base/setup/usetup/usetup.c +++ b/base/setup/usetup/usetup.c @@ -4019,6 +4019,24 @@ BootLoaderPage(PINPUT_RECORD Ir) CONSOLE_InvertTextXY(8, Line, 60, 1); } + else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && + (Ir->Event.KeyEvent.wVirtualKeyCode == VK_HOME)) /* HOME */ + { + CONSOLE_NormalTextXY(8, Line, 60, 1); + + Line = 12; + + CONSOLE_InvertTextXY(8, Line, 60, 1); + } + else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && + (Ir->Event.KeyEvent.wVirtualKeyCode == VK_END)) /* END */ + { + CONSOLE_NormalTextXY(8, Line, 60, 1); + + Line = 15; + + CONSOLE_InvertTextXY(8, Line, 60, 1); + } else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) && (Ir->Event.KeyEvent.wVirtualKeyCode == VK_F3)) /* F3 */ {
6 years
1
0
0
0
[reactos] 01/01: [WIN32SS][NTUSER] Refactor PR #1226 (#1266)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d0d909245fdadcc93463d…
commit d0d909245fdadcc93463d501c5667bc21738c3b1 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Jan 19 23:56:33 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Jan 19 23:56:33 2019 +0900 [WIN32SS][NTUSER] Refactor PR #1226 (#1266) Refactoring of #1226. CORE-12845 --- win32ss/user/ntuser/defwnd.c | 83 ++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/win32ss/user/ntuser/defwnd.c b/win32ss/user/ntuser/defwnd.c index d00d9aa853..67215d1f26 100644 --- a/win32ss/user/ntuser/defwnd.c +++ b/win32ss/user/ntuser/defwnd.c @@ -783,85 +783,84 @@ IntDefWindowProc( } if (IS_KEY_DOWN(gafAsyncKeyState, VK_LWIN) || IS_KEY_DOWN(gafAsyncKeyState, VK_RWIN)) { - PWND topWnd = UserGetWindowObject(UserGetForegroundWindow()); - + HWND hwndTop = UserGetForegroundWindow(); + PWND topWnd = UserGetWindowObject(hwndTop); if (topWnd) { if (wParam == VK_DOWN) { - co_IntSendMessage(UserHMGetHandle(topWnd), WM_SYSCOMMAND, (topWnd->style & WS_MAXIMIZE) ? SC_RESTORE : SC_MINIMIZE, lParam); - } - else - if (wParam == VK_UP) + if (topWnd->style & WS_MAXIMIZE) + co_IntSendMessage(hwndTop, WM_SYSCOMMAND, SC_RESTORE, lParam); + else + co_IntSendMessage(hwndTop, WM_SYSCOMMAND, SC_MINIMIZE, lParam); + } + else if (wParam == VK_UP) { - RECT currentRect = (topWnd->InternalPos.NormalRect.right == topWnd->InternalPos.NormalRect.left) || - (topWnd->InternalPos.NormalRect.top == topWnd->InternalPos.NormalRect.bottom) - ? topWnd->rcWindow - : topWnd->InternalPos.NormalRect; - co_IntSendMessage(UserHMGetHandle(topWnd), WM_SYSCOMMAND, SC_MAXIMIZE, 0); - + RECT currentRect; + if ((topWnd->InternalPos.NormalRect.right == topWnd->InternalPos.NormalRect.left) || + (topWnd->InternalPos.NormalRect.top == topWnd->InternalPos.NormalRect.bottom)) + { + currentRect = topWnd->rcWindow; + } + else + { + currentRect = topWnd->InternalPos.NormalRect; + } + co_IntSendMessage(hwndTop, WM_SYSCOMMAND, SC_MAXIMIZE, 0); + // save normal rect if maximazing snapped window topWnd->InternalPos.NormalRect = currentRect; } - else - if (wParam == VK_LEFT || wParam == VK_RIGHT) + else if (wParam == VK_LEFT || wParam == VK_RIGHT) { - RECT snapRect; - RECT normalRect; - RECT windowRect; - BOOL snapped = FALSE; + RECT snapRect, normalRect, windowRect; + BOOL snapped; normalRect = topWnd->InternalPos.NormalRect; - snapped = (normalRect.left != 0 - && normalRect.right != 0 - && normalRect.top != 0 - && normalRect.bottom != 0); + snapped = (normalRect.left != 0 && normalRect.right != 0 && + normalRect.top != 0 && normalRect.bottom != 0); if (topWnd->style & WS_MAXIMIZE) { - co_IntSendMessage(UserHMGetHandle(topWnd), WM_SYSCOMMAND, SC_RESTORE, lParam); + co_IntSendMessage(hwndTop, WM_SYSCOMMAND, SC_RESTORE, lParam); snapped = FALSE; } - windowRect = topWnd->rcWindow; UserSystemParametersInfo(SPI_GETWORKAREA, 0, &snapRect, 0); if (wParam == VK_LEFT) { - snapRect.right = (snapRect.right - snapRect.left) / 2 + snapRect.left; + snapRect.right = (snapRect.left + snapRect.right) / 2; } else // VK_RIGHT { - snapRect.left = (snapRect.right - snapRect.left) / 2 + snapRect.left; + snapRect.left = (snapRect.left + snapRect.right) / 2; } if (snapped) { // if window was snapped but moved to other location - restore normal size - if (snapRect.left != windowRect.left || - snapRect.right != windowRect.right || - snapRect.top != windowRect.top || - snapRect.bottom != windowRect.bottom) + if (!IntEqualRect(&snapRect, &windowRect)) { RECT empty = {0, 0, 0, 0}; co_WinPosSetWindowPos(topWnd, - 0, - normalRect.left, - normalRect.top, - normalRect.right - normalRect.left, - normalRect.bottom - normalRect.top, - 0); + 0, + normalRect.left, + normalRect.top, + normalRect.right - normalRect.left, + normalRect.bottom - normalRect.top, + 0); topWnd->InternalPos.NormalRect = empty; } } else { co_WinPosSetWindowPos(topWnd, - 0, - snapRect.left, - snapRect.top, - snapRect.right - snapRect.left, - snapRect.bottom - snapRect.top, - 0); + 0, + snapRect.left, + snapRect.top, + snapRect.right - snapRect.left, + snapRect.bottom - snapRect.top, + 0); topWnd->InternalPos.NormalRect = windowRect; } }
6 years
1
0
0
0
[reactos] 05/05: [OPENGL32] Fix wglChoosePixelFormat
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c3e4b5fec6ff51e04e95c…
commit c3e4b5fec6ff51e04e95c3c6908b1b99aee49023 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Tue Jan 15 17:25:05 2019 +0100 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Sat Jan 19 14:23:54 2019 +0100 [OPENGL32] Fix wglChoosePixelFormat Not asking for a feature is not asking not to have it. --- dll/opengl/opengl32/wgl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dll/opengl/opengl32/wgl.c b/dll/opengl/opengl32/wgl.c index 213b8b4076..92d62e91b7 100644 --- a/dll/opengl/opengl32/wgl.c +++ b/dll/opengl/opengl32/wgl.c @@ -205,28 +205,28 @@ INT WINAPI wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd) } /* only use bitmap capable formats for bitmap rendering */ - if ((ppfd->dwFlags & PFD_DRAW_TO_BITMAP) != (format.dwFlags & PFD_DRAW_TO_BITMAP)) + if ((ppfd->dwFlags & PFD_DRAW_TO_BITMAP) && !(format.dwFlags & PFD_DRAW_TO_BITMAP)) { TRACE( "PFD_DRAW_TO_BITMAP mismatch for iPixelFormat=%d\n", i ); continue; } /* only use window capable formats for window rendering */ - if ((ppfd->dwFlags & PFD_DRAW_TO_WINDOW) != (format.dwFlags & PFD_DRAW_TO_WINDOW)) + if ((ppfd->dwFlags & PFD_DRAW_TO_WINDOW) && !(format.dwFlags & PFD_DRAW_TO_WINDOW)) { TRACE( "PFD_DRAW_TO_WINDOW mismatch for iPixelFormat=%d\n", i ); continue; } /* only use opengl capable formats for opengl rendering */ - if ((ppfd->dwFlags & PFD_SUPPORT_OPENGL) != (format.dwFlags & PFD_SUPPORT_OPENGL)) + if ((ppfd->dwFlags & PFD_SUPPORT_OPENGL) && !(format.dwFlags & PFD_SUPPORT_OPENGL)) { TRACE( "PFD_SUPPORT_OPENGL mismatch for iPixelFormat=%d\n", i ); continue; } /* only use GDI capable formats for GDI rendering */ - if ((ppfd->dwFlags & PFD_SUPPORT_GDI) != (format.dwFlags & PFD_SUPPORT_GDI)) + if ((ppfd->dwFlags & PFD_SUPPORT_GDI) && !(format.dwFlags & PFD_SUPPORT_GDI)) { TRACE( "PFD_SUPPORT_GDI mismatch for iPixelFormat=%d\n", i ); continue;
6 years
1
0
0
0
[reactos] 04/05: [APITESTS] Add tests for opengl32.dll
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bb8a3f4e097bd08169f0d…
commit bb8a3f4e097bd08169f0d2027259d7bc6bd1b926 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Thu Nov 22 18:18:05 2018 +0100 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Sat Jan 19 14:23:54 2019 +0100 [APITESTS] Add tests for opengl32.dll Ensure that our SW implementation exposes the same extensions and the same pixel formats than windows. --- modules/rostests/apitests/CMakeLists.txt | 1 + modules/rostests/apitests/opengl32/CMakeLists.txt | 6 + modules/rostests/apitests/opengl32/sw_extensions.c | 78 ++++ .../rostests/apitests/opengl32/sw_pixelformat.c | 395 +++++++++++++++++++++ modules/rostests/apitests/opengl32/testlist.c | 15 + 5 files changed, 495 insertions(+) diff --git a/modules/rostests/apitests/CMakeLists.txt b/modules/rostests/apitests/CMakeLists.txt index 8d4ee4834b..5bff8ce760 100644 --- a/modules/rostests/apitests/CMakeLists.txt +++ b/modules/rostests/apitests/CMakeLists.txt @@ -26,6 +26,7 @@ add_subdirectory(netapi32) add_subdirectory(netshell) add_subdirectory(ntdll) add_subdirectory(ole32) +add_subdirectory(opengl32) add_subdirectory(pefile) add_subdirectory(powrprof) add_subdirectory(sdk) diff --git a/modules/rostests/apitests/opengl32/CMakeLists.txt b/modules/rostests/apitests/opengl32/CMakeLists.txt new file mode 100644 index 0000000000..6fddd120e1 --- /dev/null +++ b/modules/rostests/apitests/opengl32/CMakeLists.txt @@ -0,0 +1,6 @@ + +add_executable(opengl32_apitest sw_extensions.c sw_pixelformat.c testlist.c) +target_link_libraries(opengl32_apitest wine) +set_module_type(opengl32_apitest win32cui) +add_importlibs(opengl32_apitest opengl32 gdi32 user32 msvcrt kernel32) +add_rostests_file(TARGET opengl32_apitest) diff --git a/modules/rostests/apitests/opengl32/sw_extensions.c b/modules/rostests/apitests/opengl32/sw_extensions.c new file mode 100644 index 0000000000..3329645ae4 --- /dev/null +++ b/modules/rostests/apitests/opengl32/sw_extensions.c @@ -0,0 +1,78 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: BSD - See COPYING.ARM in the top level directory + * PURPOSE: Tests extensions exposed by the software implementation + * PROGRAMMERS: J�r�me Gardou + */ + +#include <windows.h> +#include <wingdi.h> +#include <GL/gl.h> + +#include "wine/test.h" + +START_TEST(sw_extensions) +{ + BITMAPINFO biDst; + HDC hdcDst = CreateCompatibleDC(0); + HBITMAP bmpDst, bmpOld; + INT nFormats, iPixelFormat, res, i; + PIXELFORMATDESCRIPTOR pfd; + const char* output; + HGLRC Context; + UINT *dstBuffer = NULL; + + memset(&biDst, 0, sizeof(BITMAPINFO)); + biDst.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + biDst.bmiHeader.biWidth = 4; + biDst.bmiHeader.biHeight = -4; + biDst.bmiHeader.biPlanes = 1; + biDst.bmiHeader.biBitCount = 32; + biDst.bmiHeader.biCompression = BI_RGB; + + bmpDst = CreateDIBSection(0, &biDst, DIB_RGB_COLORS, (void**)&dstBuffer, NULL, 0); + + bmpOld = SelectObject(hdcDst, bmpDst); + + /* Choose a pixel format */ + nFormats = DescribePixelFormat(hdcDst, 0, 0, NULL); + for(i=1; i<=nFormats; i++) + { + memset(&pfd, 0, sizeof(PIXELFORMATDESCRIPTOR)); + DescribePixelFormat(hdcDst, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd); + + if((pfd.dwFlags & PFD_DRAW_TO_BITMAP) && + (pfd.dwFlags & PFD_SUPPORT_OPENGL) && + (pfd.cColorBits == 32) && + (pfd.cAlphaBits == 8) ) + { + iPixelFormat = i; + break; + } + } + + ok(pfd.dwFlags & PFD_GENERIC_FORMAT, "We found a pixel format for drawing to bitmap which is not generic !\n"); + ok (iPixelFormat >= 1 && iPixelFormat <= nFormats, "Could not find a suitable pixel format.\n"); + res = SetPixelFormat(hdcDst, iPixelFormat, &pfd); + ok (res != 0, "SetPixelFormat failed.\n"); + Context = wglCreateContext(hdcDst); + ok(Context != NULL, "We failed to create a GL context.\n"); + wglMakeCurrent(hdcDst, Context); + + /* Get the version */ + output = (const char*)glGetString(GL_VERSION); + ok(strcmp(output, "1.1.0") == 0, "Expected version 1.1.0, got \"%s\".\n", output); + + /* Get the extensions list */ + output = (const char*)glGetString(GL_EXTENSIONS); + trace("GL extensions are %s.\n", output); + ok (strlen(output) == strlen("GL_WIN_swap_hint GL_EXT_bgra GL_EXT_paletted_texture"), "Wrong extension list : \"%s\".\n", output); + ok(strstr(output, "GL_WIN_swap_hint") != NULL, "GL_WIN_swap_hint extension is not present.\n"); + ok(strstr(output, "GL_EXT_bgra") != NULL, "GL_EXT_bgra extension is not present.\n"); + ok(strstr(output, "GL_EXT_paletted_texture") != NULL, "GL_EXT_paletted_texture extension is not present.\n"); + + /* cleanup */ + wglDeleteContext(Context); + SelectObject(hdcDst, bmpOld); + DeleteDC(hdcDst); +} diff --git a/modules/rostests/apitests/opengl32/sw_pixelformat.c b/modules/rostests/apitests/opengl32/sw_pixelformat.c new file mode 100644 index 0000000000..ffb3d4d1a2 --- /dev/null +++ b/modules/rostests/apitests/opengl32/sw_pixelformat.c @@ -0,0 +1,395 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: BSD - See COPYING.ARM in the top level directory + * PURPOSE: Tests pixel formats exposed by the software implementation + * PROGRAMMERS: J�r�me Gardou + */ + +#include <windows.h> +#include <wingdi.h> +#include <GL/gl.h> +#include <stdio.h> + +#include "wine/test.h" + +static char* str_dbg_pfd_flags(DWORD flags) +{ + static char buffer[1000]; + static char *p = buffer; + char* ret; + + BOOL first = TRUE; + + if (p > &buffer[800]) + p = buffer; + + *p = 0; + +#define FLAGS_TO_STR(__x__) \ + do { \ + if (flags & __x__) \ + { \ + if (!first) strcat(p, " | "); \ + strcat(p, #__x__); \ + first = FALSE; \ + flags &= ~((DWORD)__x__); \ + } \ + } while(0) + + FLAGS_TO_STR(PFD_DOUBLEBUFFER); + FLAGS_TO_STR(PFD_STEREO); + FLAGS_TO_STR(PFD_DRAW_TO_WINDOW); + FLAGS_TO_STR(PFD_DRAW_TO_BITMAP); + FLAGS_TO_STR(PFD_SUPPORT_GDI); + FLAGS_TO_STR(PFD_SUPPORT_OPENGL); + FLAGS_TO_STR(PFD_GENERIC_FORMAT); + FLAGS_TO_STR(PFD_NEED_PALETTE); + FLAGS_TO_STR(PFD_NEED_SYSTEM_PALETTE); + FLAGS_TO_STR(PFD_SWAP_EXCHANGE); + FLAGS_TO_STR(PFD_SWAP_COPY); + FLAGS_TO_STR(PFD_SWAP_LAYER_BUFFERS); + FLAGS_TO_STR(PFD_GENERIC_ACCELERATED); + FLAGS_TO_STR(PFD_SUPPORT_COMPOSITION); +#undef FLAGS_TO_STR + + if (flags) + { + char tmp[16]; + sprintf(tmp, " | 0x%08x", (UINT)flags); + strcat(p, tmp); + } + + ret = p; + + p += strlen(p) + 1; + + return ret; +} + +struct test_color +{ + BYTE iPixelType; + BYTE cColorBits; + BYTE cRedBits; BYTE cRedShift; + BYTE cGreenBits; BYTE cGreenShift; + BYTE cBlueBits; BYTE cBlueShift; + BYTE cAlphaBits; BYTE cAlphaShift; + BYTE cAccumBits; + BYTE cAccumRedBits; BYTE cAccumGreenBits; BYTE cAccumBlueBits; BYTE cAccumAlphaBits; +}; + +static const struct test_color test_colors_32[] = +{ + {PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0}, + {PFD_TYPE_RGBA, 32, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16}, + {PFD_TYPE_COLORINDEX, 32, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0}, +}; + +static const struct test_color test_colors_24[] = +{ + {PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 0, 0, 64, 16, 16, 16, 0}, + {PFD_TYPE_RGBA, 24, 8, 16, 8, 8, 8, 0, 8, 0, 64, 16, 16, 16, 16}, + {PFD_TYPE_COLORINDEX, 24, 8, 16, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0}, +}; + +static const struct test_color test_colors_16[] = +{ + {PFD_TYPE_RGBA, 16, 5, 10, 5, 5, 5, 0, 0, 0, 32, 11, 11, 10, 0}, + {PFD_TYPE_RGBA, 16, 5, 10, 5, 5, 5, 0, 8, 0, 32, 8, 8, 8, 8}, + {PFD_TYPE_COLORINDEX, 16, 5, 10, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0}, +}; + +static const struct test_color test_colors_16_565[] = +{ + {PFD_TYPE_RGBA, 16, 5, 11, 6, 5, 5, 0, 0, 0, 32, 11, 11, 10, 0}, + {PFD_TYPE_RGBA, 16, 5, 11, 6, 5, 5, 0, 8, 0, 32, 8, 8, 8, 8}, + {PFD_TYPE_COLORINDEX, 16, 5, 11, 6, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0}, +}; + +static const struct test_color test_colors_8[] = +{ + {PFD_TYPE_RGBA, 8, 3, 0, 3, 3, 2, 6, 0, 0, 32, 11, 11, 10, 0}, + {PFD_TYPE_RGBA, 8, 3, 0, 3, 3, 2, 6, 8, 0, 32, 8, 8, 8, 8}, + {PFD_TYPE_COLORINDEX, 8, 3, 0, 3, 3, 2, 6, 0, 0, 0, 0, 0, 0, 0}, +}; + +static const struct test_color test_colors_4[] = +{ + {PFD_TYPE_RGBA, 4, 1, 0, 1, 1, 1, 2, 0, 0, 16, 5, 6, 5, 0}, + {PFD_TYPE_RGBA, 4, 1, 0, 1, 1, 1, 2, 8, 0, 16, 4, 4, 4, 4}, + {PFD_TYPE_COLORINDEX, 4, 1, 0, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0}, +}; + +static const struct test_color* test_colors_32bpp[] = {test_colors_32, test_colors_24, test_colors_16, test_colors_8, test_colors_4, NULL}; +static const struct test_color* test_colors_24bpp[] = {test_colors_24, test_colors_32, test_colors_16, test_colors_8, test_colors_4, NULL}; +static const struct test_color* test_colors_16bpp[] = {test_colors_16_565, test_colors_24, test_colors_32, test_colors_8, test_colors_4, NULL}; +static const struct test_color* test_colors_8bpp[] = {test_colors_8, test_colors_24, test_colors_32, test_colors_16, test_colors_4, NULL}; + +static const BYTE test_depths[] = { 32, 16 }; + +static void test_format(HDC hdc, int num_pf, int pf, const struct test_color *colors, BYTE depth, BOOL is_window, BOOL is_double_buffered) +{ + PIXELFORMATDESCRIPTOR pfd; + int ret; + + ret = DescribePixelFormat(hdc, pf, sizeof(pfd), &pfd); + ok(ret == num_pf, "Number of pixel formats changed!\n"); + + ok(pfd.nSize == sizeof(pfd), "Wrong nSize for format %i, expected %u, got %u\n", pf, (WORD)sizeof(pfd), pfd.nSize); + ok(pfd.nVersion == 1, "Wrong nVersion for format %i, expected 1, got %u\n", pf, pfd.nVersion); + if (is_window) + { + DWORD flags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_GENERIC_FORMAT; + + if ((pfd.cColorBits <= 8) && (pfd.iPixelType == PFD_TYPE_RGBA)) + flags |= PFD_NEED_PALETTE; + + if (is_double_buffered) + { + flags |= PFD_DOUBLEBUFFER | PFD_SWAP_COPY; + } + else + { + flags |= PFD_DRAW_TO_BITMAP | PFD_SUPPORT_GDI; + } + ok((pfd.dwFlags == flags) || (pfd.dwFlags == (flags | PFD_SUPPORT_COMPOSITION)), + "Wrong dwFlags for format %i, expected %s (0x%08x), got %s(0x%08x)\n", + pf, str_dbg_pfd_flags(flags), (UINT)flags, str_dbg_pfd_flags(pfd.dwFlags), (UINT)pfd.dwFlags); + } + else + { + ok(pfd.dwFlags == (PFD_DRAW_TO_BITMAP | PFD_SUPPORT_GDI | PFD_SUPPORT_OPENGL | PFD_GENERIC_FORMAT), + "Wrong dwFlags for format %i, expected PFD_DRAW_TO_BITMAP | PFD_SUPPORT_GDI | PFD_SUPPORT_OPENGL | PFD_GENERIC_FORMAT, got %s\n", + pf, str_dbg_pfd_flags(pfd.dwFlags)); + } + +#define TEST_FIELD(__x__) ok(pfd.__x__ == colors->__x__, "Wrong " #__x__ " for format %i, expected %u, got %u\n", pf, colors->__x__, pfd.__x__) + TEST_FIELD(iPixelType); + TEST_FIELD(cColorBits); + TEST_FIELD(cRedBits); + TEST_FIELD(cRedShift); + TEST_FIELD(cGreenBits); + TEST_FIELD(cGreenShift); + TEST_FIELD(cBlueBits); + TEST_FIELD(cBlueShift); + TEST_FIELD(cAlphaBits); + TEST_FIELD(cAlphaShift); + TEST_FIELD(cAccumBits); + TEST_FIELD(cAccumRedBits); + TEST_FIELD(cAccumGreenBits); + TEST_FIELD(cAccumBlueBits); + TEST_FIELD(cAccumAlphaBits); +#undef TEST_FIELD + ok(pfd.cDepthBits == depth, "Wrong cDepthBit for format %i, expected %u, got %u\n", pf, depth, pfd.cDepthBits); + + /* the rest is constant */ +#define TEST_FIELD(__x__, __y__) ok(pfd.__x__ == __y__, "Wrong " #__x__ " for format %i, expected " #__y__ ", got %u\n", pf, (UINT)pfd.__x__) + TEST_FIELD(cStencilBits, 8); + TEST_FIELD(cAuxBuffers, 0); + TEST_FIELD(iLayerType, 0); + TEST_FIELD(bReserved, 0); + TEST_FIELD(dwLayerMask, 0); + TEST_FIELD(dwVisibleMask, 0); + TEST_FIELD(dwDamageMask, 0); +#undef TEST_FIELD +} + +static void test_screen_colors(const struct test_color **colors) +{ + int pf, num_pf, ret; + int i, j; + HDC hdc; + HWND hwnd; + PIXELFORMATDESCRIPTOR pfd; + + hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW, 10, 10, 200, 200, NULL, NULL, + NULL, NULL); + if (!hwnd) + { + ok(hwnd != NULL, "Failed to create a window.\n"); + return; + } + + hdc = GetDC( hwnd ); + num_pf = DescribePixelFormat(hdc, 0, 0, NULL); + ok(num_pf > 0, "DescribePixelFormat failed.\n"); + + for (pf = 1; pf <= num_pf; pf++) + { + ret = DescribePixelFormat(hdc, pf, sizeof(pfd), &pfd); + ok(ret == num_pf, "Number of pixel formats changed!\n"); + + if (pfd.dwFlags & PFD_GENERIC_FORMAT) + break; + } + + ok(pf < num_pf, "No generic pixel format!\n"); + + /* First the formats compatible with the DC */ + for (i = 0; i < 3; i++) + { + /* Single buffered first */ + for (j = 0; j < ARRAY_SIZE(test_depths); j++) + { + test_format(hdc, num_pf, pf++, &colors[0][i], test_depths[j], TRUE, FALSE); + } + + /* Then double buffered */ + for (j = 0; j < ARRAY_SIZE(test_depths); j++) + { + test_format(hdc, num_pf, pf++, &colors[0][i], test_depths[j], TRUE, TRUE); + } + } + + colors++; + + /* Then the rest */ + while (*colors) + { + for (i = 0; i < 3; i++) + { + for (j = 0; j < ARRAY_SIZE(test_depths); j++) + { + test_format(hdc, num_pf, pf++, &colors[0][i], test_depths[j], FALSE, FALSE); + } + } + colors++; + } + + /* We must have tested all generic formats. */ + ok(pf - 1 == num_pf, "We didn't test all generic formats : tested %u, total %u.\n", pf, num_pf); + + ReleaseDC( hwnd, hdc ); + DestroyWindow( hwnd ); +} + +static HBITMAP create_dib_section(WORD bpp, void** dstBuffer) +{ + BITMAPINFO bi; + + memset(&bi, 0, sizeof(BITMAPINFO)); + bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bi.bmiHeader.biWidth = 4; + bi.bmiHeader.biHeight = -4; + bi.bmiHeader.biPlanes = 1; + bi.bmiHeader.biBitCount = bpp; + bi.bmiHeader.biCompression = BI_RGB; + + return CreateDIBSection(0, &bi, DIB_RGB_COLORS, dstBuffer, NULL, 0); +} + +static void test_bitmap_colors(HDC hdc, const struct test_color** colors) +{ + INT num_pf, pf, ret; + PIXELFORMATDESCRIPTOR pfd; + INT i, j; + + num_pf = DescribePixelFormat(hdc, 0, 0, NULL); + ok(num_pf > 0, "DescribePixelFormat failed.\n"); + + for (pf = 1; pf <= num_pf; pf++) + { + ret = DescribePixelFormat(hdc, pf, sizeof(pfd), &pfd); + ok(ret == num_pf, "Number of pixel formats changed!\n"); + + if (pfd.dwFlags & PFD_GENERIC_FORMAT) + break; + } + + ok(pf < num_pf, "No generic pixel format!\n"); + + /* First the formats compatible with the DC */ + for (i = 0; i < 3; i++) + { + /* Single buffered first */ + for (j = 0; j < ARRAY_SIZE(test_depths); j++) + { + test_format(hdc, num_pf, pf++, &colors[0][i], test_depths[j], TRUE, FALSE); + } + + /* Then double buffered */ + for (j = 0; j < ARRAY_SIZE(test_depths); j++) + { + test_format(hdc, num_pf, pf++, &colors[0][i], test_depths[j], TRUE, TRUE); + } + } + + colors++; + + /* Then the rest */ + while (*colors) + { + for (i = 0; i < 3; i++) + { + for (j = 0; j < ARRAY_SIZE(test_depths); j++) + { + test_format(hdc, num_pf, pf++, &colors[0][i], test_depths[j], FALSE, FALSE); + } + } + colors++; + } + + /* We must have tested all generic formats. */ + ok(pf - 1 == num_pf, "We didn't test all generic formats : tested %u, total %u.\n", pf, num_pf); +} + +static void test_bitmap_formats(const struct test_color ** colors) +{ + HBITMAP oldBmp, dib; + HDC hdc; + static const INT bpps [] = {4, 8, 16, 24, 32}; + INT i; + void* dib_buffer; + + hdc = CreateCompatibleDC(NULL); + ok (hdc != NULL, "Failed creating a memory DC.\n"); + + for (i = 0; i < ARRAY_SIZE(bpps); i++) + { + dib = create_dib_section(bpps[i], &dib_buffer); + ok(dib != NULL, "Failed to create DIB for %u bpp\n", bpps[i]); + + oldBmp = SelectObject(hdc, dib); + ok (oldBmp != NULL, "Failed to select the DIB\n"); + + trace("testing DIB %ubpp\n", bpps[i]); + /* For mem DC, this is always the depth of the screen which is taken into account */ + test_bitmap_colors(hdc, colors); + + SelectObject(hdc, oldBmp); + DeleteObject(dib); + } +} + +START_TEST(sw_pixelformat) +{ + DEVMODEW devMode; + INT ret; + DWORD orig_bpp; + static const WORD bit_depths[] = {8, 16, 24, 32}; + static const struct test_color** colors[] = {test_colors_8bpp, test_colors_16bpp, test_colors_24bpp, test_colors_32bpp}; + INT i; + + ret = EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &devMode); + ok (ret != 0, "EnumDisplaySettings failed.\n"); + orig_bpp = devMode.dmBitsPerPel; + + for (i = 0; i < ARRAY_SIZE(bit_depths); i++) + { + devMode.dmBitsPerPel = bit_depths[i]; + ret = ChangeDisplaySettingsExW(NULL, &devMode, NULL, 0, NULL); + if (ret == DISP_CHANGE_SUCCESSFUL) + { + trace("Testing %ubpp\n", bit_depths[i]); + test_screen_colors(colors[i]); + test_bitmap_formats(colors[i]); + } + else + { + skip("Unable to switch to %ubpp\n", bit_depths[i]); + } + } + + devMode.dmBitsPerPel = orig_bpp; + ret = ChangeDisplaySettingsExW(NULL, &devMode, NULL, 0, NULL); +} diff --git a/modules/rostests/apitests/opengl32/testlist.c b/modules/rostests/apitests/opengl32/testlist.c new file mode 100644 index 0000000000..21105035fe --- /dev/null +++ b/modules/rostests/apitests/opengl32/testlist.c @@ -0,0 +1,15 @@ +#define __ROS_LONG64__ + +#define STANDALONE +#include <wine/test.h> + +extern void func_sw_extensions(void); +extern void func_sw_pixelformat(void); + +const struct test winetest_testlist[] = +{ + { "sw_extensions", func_sw_extensions }, + { "sw_pixelformat", func_sw_pixelformat }, + + { 0, 0 } +};
6 years
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
30
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
Results per page:
10
25
50
100
200