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: [ATL] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f9fd4bbc7c0b824d78e38…
commit f9fd4bbc7c0b824d78e38709809a2312fe210a39 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 25 13:13:28 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 25 13:13:28 2019 +0100 [ATL] Sync with Wine Staging 4.0. CORE-15682 --- dll/win32/atl/atl_ax.c | 66 ++++++++++++++++++++++++++++++++++++++++---------- media/doc/README.WINE | 2 +- 2 files changed, 54 insertions(+), 14 deletions(-) diff --git a/dll/win32/atl/atl_ax.c b/dll/win32/atl/atl_ax.c index 28bec71fd9..ef81d4d851 100644 --- a/dll/win32/atl/atl_ax.c +++ b/dll/win32/atl/atl_ax.c @@ -28,6 +28,7 @@ #include "winerror.h" #include "winuser.h" #include "wine/debug.h" +#include "wine/heap.h" #include "objbase.h" #include "objidl.h" #include "ole2.h" @@ -104,7 +105,7 @@ BOOL WINAPI AtlAxWinInit(void) #error Unsupported version #endif - const WCHAR AtlAxWinW[] = {'A','t','l','A','x','W','i','n',ATL_NAME_SUFFIX}; + static const WCHAR AtlAxWinW[] = {'A','t','l','A','x','W','i','n',ATL_NAME_SUFFIX}; FIXME("version %04x semi-stub\n", _ATL_VER); @@ -128,7 +129,7 @@ BOOL WINAPI AtlAxWinInit(void) return FALSE; if(_ATL_VER > _ATL_VER_30) { - const WCHAR AtlAxWinLicW[] = {'A','t','l','A','x','W','i','n','L','i','c',ATL_NAME_SUFFIX}; + static const WCHAR AtlAxWinLicW[] = {'A','t','l','A','x','W','i','n','L','i','c',ATL_NAME_SUFFIX}; wcex.lpszClassName = AtlAxWinLicW; if ( !RegisterClassExW( &wcex ) ) @@ -1001,9 +1002,9 @@ enum content static enum content get_content_type(LPCOLESTR name, CLSID *control_id) { + static const WCHAR mshtml_prefixW[] = {'m','s','h','t','m','l',':',0}; WCHAR new_urlW[MAX_PATH]; DWORD size = MAX_PATH; - WCHAR mshtml_prefixW[] = {'m','s','h','t','m','l',':','\0'}; if (!name || !name[0]) { @@ -1407,25 +1408,64 @@ HRESULT WINAPI AtlAxGetControl(HWND hWnd, IUnknown **pUnk) } /*********************************************************************** - * AtlAxDialogBoxW [atl100.35] + * AtlAxDialogBoxA [atl100.@] * */ -INT_PTR WINAPI AtlAxDialogBoxW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc, - LPARAM dwInitParam) +INT_PTR WINAPI AtlAxDialogBoxA(HINSTANCE hInst, LPCSTR name, HWND owner, DLGPROC dlgProc, LPARAM param) { - FIXME("(%p %s %p %p %lx)\n", hInstance, debugstr_w(lpTemplateName), hWndParent, lpDialogProc, dwInitParam); - return 0; + INT_PTR res = 0; + int length; + WCHAR *nameW; + + if (IS_INTRESOURCE(name)) + return AtlAxDialogBoxW( hInst, (LPCWSTR) name, owner, dlgProc, param ); + + length = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 ); + nameW = heap_alloc( length * sizeof(WCHAR) ); + if (nameW) + { + MultiByteToWideChar( CP_ACP, 0, name, -1, nameW, length ); + res = AtlAxDialogBoxW( hInst, nameW, owner, dlgProc, param ); + heap_free( nameW ); + } + return res; } /*********************************************************************** - * AtlAxDialogBoxA [atl100.36] + * AtlAxDialogBoxW [atl100.@] * */ -INT_PTR WINAPI AtlAxDialogBoxA(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogProc, - LPARAM dwInitParam) +INT_PTR WINAPI AtlAxDialogBoxW(HINSTANCE hInst, LPCWSTR name, HWND owner, DLGPROC dlgProc, LPARAM param) { - FIXME("(%p %s %p %p %lx)\n", hInstance, debugstr_a(lpTemplateName), hWndParent, lpDialogProc, dwInitParam); - return 0; + HRSRC hrsrc; + HGLOBAL hgl; + LPCDLGTEMPLATEW ptr; + LPDLGTEMPLATEW newptr; + INT_PTR res; + + TRACE("(%p %s %p %p %lx)\n", hInst, debugstr_w(name), owner, dlgProc, param); + + hrsrc = FindResourceW( hInst, name, (LPWSTR)RT_DIALOG ); + if ( !hrsrc ) + return 0; + hgl = LoadResource (hInst, hrsrc); + if ( !hgl ) + return 0; + ptr = LockResource ( hgl ); + if (!ptr) + { + FreeResource( hgl ); + return 0; + } + newptr = AX_ConvertDialogTemplate( ptr ); + if ( newptr ) + { + res = DialogBoxIndirectParamW( hInst, newptr, owner, dlgProc, param ); + heap_free( newptr ); + } else + res = 0; + FreeResource ( hrsrc ); + return res; } /*********************************************************************** diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 3c5d454a18..6b8579bf94 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -45,7 +45,7 @@ reactos/dll/directx/wine/wined3d # Synced to WineStaging-3.9 reactos/dll/win32/activeds # Synced to WineStaging-3.3 reactos/dll/win32/actxprxy # Synced to WineStaging-3.3 reactos/dll/win32/advpack # Synced to WineStaging-4.0 -reactos/dll/win32/atl # Synced to WineStaging-3.17 +reactos/dll/win32/atl # Synced to WineStaging-4.0 reactos/dll/win32/atl80 # Synced to WineStaging-3.3 reactos/dll/win32/atl100 # Synced to WineStaging-3.3 reactos/dll/win32/avifil32 # Synced to WineStaging-3.9
6 years
1
0
0
0
[reactos] 01/01: [ADVPACK] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2a1300f5b6b8f4c8f403f…
commit 2a1300f5b6b8f4c8f403f3b9b5ce3cf18bff0f06 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 25 13:12:55 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 25 13:12:55 2019 +0100 [ADVPACK] Sync with Wine Staging 4.0. CORE-15682 --- dll/win32/advpack/reg.c | 2 +- media/doc/README.WINE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/advpack/reg.c b/dll/win32/advpack/reg.c index fd0a199b00..82c1d2b6e8 100644 --- a/dll/win32/advpack/reg.c +++ b/dll/win32/advpack/reg.c @@ -41,8 +41,8 @@ static const WCHAR quote[] = {'\"',0}; static BOOL get_temp_ini_path(LPWSTR name) { + static const WCHAR prefix[] = {'a','v','p',0}; WCHAR tmp_dir[MAX_PATH]; - WCHAR prefix[] = {'a','v','p',0}; if(!GetTempPathW(ARRAY_SIZE(tmp_dir), tmp_dir)) return FALSE; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index cffda39b1b..3c5d454a18 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -44,7 +44,7 @@ reactos/dll/directx/wine/wined3d # Synced to WineStaging-3.9 reactos/dll/win32/activeds # Synced to WineStaging-3.3 reactos/dll/win32/actxprxy # Synced to WineStaging-3.3 -reactos/dll/win32/advpack # Synced to WineStaging-3.17 +reactos/dll/win32/advpack # Synced to WineStaging-4.0 reactos/dll/win32/atl # Synced to WineStaging-3.17 reactos/dll/win32/atl80 # Synced to WineStaging-3.3 reactos/dll/win32/atl100 # Synced to WineStaging-3.3
6 years
1
0
0
0
[reactos] 01/01: [DMUSIC] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=517ea70ceb8bd33fc4621…
commit 517ea70ceb8bd33fc4621c48acbb3939a38aa3cb Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 25 13:12:18 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 25 13:12:18 2019 +0100 [DMUSIC] Sync with Wine Staging 4.0. CORE-15682 --- dll/directx/wine/dmusic/dmusic.c | 4 ++-- dll/directx/wine/dmusic/dmusic_main.c | 6 +++--- media/doc/README.WINE | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dll/directx/wine/dmusic/dmusic.c b/dll/directx/wine/dmusic/dmusic.c index 58dcd9d952..fd450b8e36 100644 --- a/dll/directx/wine/dmusic/dmusic.c +++ b/dll/directx/wine/dmusic/dmusic.c @@ -301,7 +301,7 @@ static HRESULT WINAPI IDirectMusic8Impl_GetDefaultPort(LPDIRECTMUSIC8 iface, LPG return S_OK; } /* FIXME: Check return types to ensure we're interpreting data right */ - MultiByteToWideChar(CP_ACP, 0, returnBuffer, -1, buff, sizeof(buff) / sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, returnBuffer, -1, buff, ARRAY_SIZE(buff)); CLSIDFromString(buff, &defaultPortGUID); *guid_port = defaultPortGUID; @@ -373,8 +373,8 @@ static const IDirectMusic8Vtbl DirectMusic8_Vtbl = { static void create_system_ports_list(IDirectMusic8Impl* object) { + static const WCHAR emulated[] = {' ','[','E','m','u','l','a','t','e','d',']',0}; port_info * port; - const WCHAR emulated[] = {' ','[','E','m','u','l','a','t','e','d',']',0}; ULONG nb_ports; ULONG nb_midi_out; ULONG nb_midi_in; diff --git a/dll/directx/wine/dmusic/dmusic_main.c b/dll/directx/wine/dmusic/dmusic_main.c index da6f45869d..7f77095cb6 100644 --- a/dll/directx/wine/dmusic/dmusic_main.c +++ b/dll/directx/wine/dmusic/dmusic_main.c @@ -408,7 +408,7 @@ const char *debugstr_dmguid (const GUID *id) { if (!id) return "(null)"; - for (i = 0; i < sizeof(guids)/sizeof(guids[0]); i++) { + for (i = 0; i < ARRAY_SIZE(guids); i++) { if (IsEqualGUID(id, guids[i].guid)) return guids[i].name; } @@ -452,7 +452,7 @@ static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) { FE(DMUS_OBJ_MEMORY), FE(DMUS_OBJ_STREAM) }; - return debugstr_flags (flagmask, flags, sizeof(flags)/sizeof(flags[0])); + return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags)); } /* Dump whole DMUS_OBJECTDESC struct */ @@ -484,7 +484,7 @@ static const char* debugstr_DMUS_PORTPARAMS_FLAGS(DWORD flagmask) FE(DMUS_PORTPARAMS_EFFECTS), FE(DMUS_PORTPARAMS_SHARE) }; - return debugstr_flags(flagmask, flags, sizeof(flags)/sizeof(flags[0])); + return debugstr_flags(flagmask, flags, ARRAY_SIZE(flags)); } /* Dump whole DMUS_PORTPARAMS struct */ diff --git a/media/doc/README.WINE b/media/doc/README.WINE index d19384e21e..cffda39b1b 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -32,7 +32,7 @@ reactos/dll/directx/wine/ddraw # Synced to WineStaging-3.9 reactos/dll/directx/wine/devenum # Synced to WineStaging-3.9 reactos/dll/directx/wine/dinput # Synced to WineStaging-4.0 reactos/dll/directx/wine/dinput8 # Synced to WineStaging-3.3 -reactos/dll/directx/wine/dmusic # Synced to WineStaging-3.17 +reactos/dll/directx/wine/dmusic # Synced to WineStaging-4.0 reactos/dll/directx/wine/dplay # Synced to WineStaging-3.3 reactos/dll/directx/wine/dplayx # Synced to WineStaging-3.17 reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29
6 years
1
0
0
0
[reactos] 01/01: [DINPUT_WINETEST] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a924dfff453add00f2992…
commit a924dfff453add00f2992fc7f782bec5f68c1216 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 25 13:11:40 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 25 13:11:40 2019 +0100 [DINPUT_WINETEST] Sync with Wine Staging 4.0. CORE-15682 --- modules/rostests/winetests/dinput/dinput.c | 10 ++++++++++ modules/rostests/winetests/dinput/keyboard.c | 3 +++ 2 files changed, 13 insertions(+) diff --git a/modules/rostests/winetests/dinput/dinput.c b/modules/rostests/winetests/dinput/dinput.c index 7e2da9ff32..cb7268908c 100644 --- a/modules/rostests/winetests/dinput/dinput.c +++ b/modules/rostests/winetests/dinput/dinput.c @@ -392,6 +392,16 @@ static BOOL CALLBACK enum_devices_callback(const DIDEVICEINSTANCEA *instance, vo { struct enum_devices_test *enum_test = context; + if ((instance->dwDevType & 0xff) == DIDEVTYPE_KEYBOARD || + (instance->dwDevType & 0xff) == DIDEVTYPE_MOUSE) { + const char *device = ((instance->dwDevType & 0xff) == + DIDEVTYPE_KEYBOARD) ? "Keyboard" : "Mouse"; + ok(IsEqualGUID(&instance->guidInstance, &instance->guidProduct), + "%s guidInstance (%s) does not match guidProduct (%s)\n", + device, wine_dbgstr_guid(&instance->guidInstance), + wine_dbgstr_guid(&instance->guidProduct)); + } + enum_test->device_count++; return enum_test->return_value; } diff --git a/modules/rostests/winetests/dinput/keyboard.c b/modules/rostests/winetests/dinput/keyboard.c index 8ee22fa38e..e8dfb4f484 100644 --- a/modules/rostests/winetests/dinput/keyboard.c +++ b/modules/rostests/winetests/dinput/keyboard.c @@ -411,6 +411,8 @@ static void test_dik_codes(IDirectInputA *dI, HWND hwnd, LANGID langid) if (!PeekMessageA(&msg, hwnd, 0, 0, PM_REMOVE)) { + U(in).ki.dwFlags = KEYEVENTF_KEYUP; + SendInput(1, &in, sizeof(in)); win_skip("failed to queue keyboard event\n"); break; } @@ -471,6 +473,7 @@ static void keyboard_tests(DWORD version) hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 10, 10, 200, 200, NULL, NULL, NULL, NULL); ok(hwnd != NULL, "err: %d\n", GetLastError()); + SetForegroundWindow( hwnd ); if (hwnd) {
6 years
1
0
0
0
[reactos] 01/01: [DINPUT] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=98e62237b173108e87854…
commit 98e62237b173108e87854dfea91e0a3b9b8b3acb Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 25 13:11:07 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 25 13:11:07 2019 +0100 [DINPUT] Sync with Wine Staging 4.0. CORE-15682 --- dll/directx/wine/dinput/CMakeLists.txt | 1 + dll/directx/wine/dinput/config.c | 8 ++++---- dll/directx/wine/dinput/device.c | 15 +++++++-------- dll/directx/wine/dinput/device_private.h | 3 --- dll/directx/wine/dinput/dinput.rc | 13 ++----------- dll/directx/wine/dinput/dinput_main.c | 18 ++++++++---------- dll/directx/wine/dinput/dinput_private.h | 2 ++ dll/directx/wine/dinput/joystick.c | 12 ++++++------ dll/directx/wine/dinput/joystick_osx.c | 2 +- dll/directx/wine/dinput/keyboard.c | 13 ++++--------- dll/directx/wine/dinput/mouse.c | 11 +++-------- dll/directx/wine/dinput/version.rc | 26 ++++++++++++++++++++++++++ media/doc/README.WINE | 2 +- 13 files changed, 65 insertions(+), 61 deletions(-) diff --git a/dll/directx/wine/dinput/CMakeLists.txt b/dll/directx/wine/dinput/CMakeLists.txt index fc215eae90..d964e748e9 100644 --- a/dll/directx/wine/dinput/CMakeLists.txt +++ b/dll/directx/wine/dinput/CMakeLists.txt @@ -20,6 +20,7 @@ add_library(dinput SHARED ${SOURCE} data_formats.c dinput.rc + version.rc ${CMAKE_CURRENT_BINARY_DIR}/dinput.def) add_library(dinput_data_formats data_formats.c) diff --git a/dll/directx/wine/dinput/config.c b/dll/directx/wine/dinput/config.c index 708f406375..885f1f4b8e 100644 --- a/dll/directx/wine/dinput/config.c +++ b/dll/directx/wine/dinput/config.c @@ -86,7 +86,6 @@ static BOOL CALLBACK collect_devices(LPCDIDEVICEINSTANCEW lpddi, IDirectInputDev */ static void init_listview_columns(HWND dialog) { - HINSTANCE hinstance = (HINSTANCE) GetWindowLongPtrW(dialog, GWLP_HINSTANCE); LVCOLUMNW listColumn; RECT viewRect; int width; @@ -95,7 +94,7 @@ static void init_listview_columns(HWND dialog) GetClientRect(GetDlgItem(dialog, IDC_DEVICEOBJECTSLIST), &viewRect); width = (viewRect.right - viewRect.left)/2; - LoadStringW(hinstance, IDS_OBJECTCOLUMN, column, sizeof(column)/sizeof(column[0])); + LoadStringW(DINPUT_instance, IDS_OBJECTCOLUMN, column, ARRAY_SIZE(column)); listColumn.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; listColumn.pszText = column; listColumn.cchTextMax = lstrlenW(listColumn.pszText); @@ -103,7 +102,7 @@ static void init_listview_columns(HWND dialog) SendDlgItemMessageW (dialog, IDC_DEVICEOBJECTSLIST, LVM_INSERTCOLUMNW, 0, (LPARAM) &listColumn); - LoadStringW(hinstance, IDS_ACTIONCOLUMN, column, sizeof(column)/sizeof(column[0])); + LoadStringW(DINPUT_instance, IDS_ACTIONCOLUMN, column, ARRAY_SIZE(column)); listColumn.cx = width; listColumn.pszText = column; listColumn.cchTextMax = lstrlenW(listColumn.pszText); @@ -453,7 +452,8 @@ HRESULT _configure_devices(IDirectInput8W *iface, InitCommonControls(); - DialogBoxParamW(GetModuleHandleA("dinput.dll"), (LPCWSTR) MAKEINTRESOURCE(IDD_CONFIGUREDEVICES), lpdiCDParams->hwnd, ConfigureDevicesDlgProc, (LPARAM) &data); + DialogBoxParamW(DINPUT_instance, (const WCHAR *)MAKEINTRESOURCE(IDD_CONFIGUREDEVICES), + lpdiCDParams->hwnd, ConfigureDevicesDlgProc, (LPARAM)&data); return DI_OK; } diff --git a/dll/directx/wine/dinput/device.c b/dll/directx/wine/dinput/device.c index 50ad76f861..6c446163d1 100644 --- a/dll/directx/wine/dinput/device.c +++ b/dll/directx/wine/dinput/device.c @@ -80,7 +80,7 @@ static void _dump_cooperativelevel_DI(DWORD dwFlags) { #undef FE }; TRACE(" cooperative level : "); - for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++) + for (i = 0; i < ARRAY_SIZE(flags); i++) if (flags[i].mask & dwFlags) TRACE("%s ",flags[i].name); TRACE("\n"); @@ -106,7 +106,7 @@ static void _dump_ObjectDataFormat_flags(DWORD dwFlags) { TRACE("Flags:"); /* First the flags */ - for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++) { + for (i = 0; i < ARRAY_SIZE(flags); i++) { if (flags[i].mask & dwFlags) TRACE(" %s",flags[i].name); } @@ -153,7 +153,7 @@ static void _dump_EnumObjects_flags(DWORD dwFlags) { if (type == DIDFT_ALL) { TRACE(" DIDFT_ALL"); } else { - for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++) { + for (i = 0; i < ARRAY_SIZE(flags); i++) { if (flags[i].mask & type) { type &= ~flags[i].mask; TRACE(" %s",flags[i].name); @@ -230,7 +230,7 @@ const char *_dump_dinput_GUID(const GUID *guid) { }; if (guid == NULL) return "null GUID"; - for (i = 0; i < (sizeof(guids) / sizeof(guids[0])); i++) { + for (i = 0; i < ARRAY_SIZE(guids); i++) { if (IsEqualGUID(guids[i].guid, guid)) { return guids[i].name; } @@ -916,7 +916,7 @@ HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, L if (dwFlags & DIDSAM_NOUSER) dps.wsz[0] = '\0'; else - lstrcpynW(dps.wsz, username, sizeof(dps.wsz)/sizeof(WCHAR)); + lstrcpynW(dps.wsz, username, ARRAY_SIZE(dps.wsz)); IDirectInputDevice8_SetProperty(iface, DIPROP_USERNAME, &dps.diph); /* Save the settings to disk */ @@ -1323,7 +1323,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface, { if (*device_player->username) { - lstrcpynW(ps->wsz, device_player->username, sizeof(ps->wsz)/sizeof(WCHAR)); + lstrcpynW(ps->wsz, device_player->username, ARRAY_SIZE(ps->wsz)); return DI_OK; } else break; @@ -1428,8 +1428,7 @@ HRESULT WINAPI IDirectInputDevice2WImpl_SetProperty( device_player->instance_guid = This->guid; } if (device_player) - lstrcpynW(device_player->username, ps->wsz, - sizeof(device_player->username)/sizeof(WCHAR)); + lstrcpynW(device_player->username, ps->wsz, ARRAY_SIZE(device_player->username)); break; } default: diff --git a/dll/directx/wine/dinput/device_private.h b/dll/directx/wine/dinput/device_private.h index 52bbec4490..d9e2997eaa 100644 --- a/dll/directx/wine/dinput/device_private.h +++ b/dll/directx/wine/dinput/device_private.h @@ -114,9 +114,6 @@ typedef struct LPDIRECTINPUTEFFECT ref; } effect_list_item; -extern const GUID DInput_Wine_Keyboard_GUID DECLSPEC_HIDDEN; -extern const GUID DInput_Wine_Mouse_GUID DECLSPEC_HIDDEN; - /* Various debug tools */ extern void _dump_DIPROPHEADER(LPCDIPROPHEADER diph) DECLSPEC_HIDDEN; extern void _dump_OBJECTINSTANCEA(const DIDEVICEOBJECTINSTANCEA *ddoi) DECLSPEC_HIDDEN; diff --git a/dll/directx/wine/dinput/dinput.rc b/dll/directx/wine/dinput/dinput.rc index d2641f31ea..30a035fdf7 100644 --- a/dll/directx/wine/dinput/dinput.rc +++ b/dll/directx/wine/dinput/dinput.rc @@ -18,19 +18,10 @@ #include "resource.h" -1 WINE_REGISTRY dinput_classes.rgs - -#define WINE_FILEDESCRIPTION_STR "Wine DirectInput" -#define WINE_FILENAME_STR "dinput.dll" -#define WINE_FILEVERSION 5,1,2600,881 -#define WINE_FILEVERSION_STR "5.1.2600.881" -#define WINE_PRODUCTVERSION 5,1,2600,881 -#define WINE_PRODUCTVERSION_STR "5.1" - -#include "wine/wine_common_ver.rc" - #pragma makedep po +1 WINE_REGISTRY dinput_classes.rgs + LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT STRINGTABLE diff --git a/dll/directx/wine/dinput/dinput_main.c b/dll/directx/wine/dinput/dinput_main.c index 82c0d14c18..4b058891d9 100644 --- a/dll/directx/wine/dinput/dinput_main.c +++ b/dll/directx/wine/dinput/dinput_main.c @@ -93,7 +93,7 @@ static const struct dinput_device *dinput_devices[] = &joystick_osx_device }; -static HINSTANCE DINPUT_instance = NULL; +HINSTANCE DINPUT_instance; static BOOL check_hook_thread(void); static CRITICAL_SECTION dinput_hook_crit; @@ -282,7 +282,7 @@ static void _dump_EnumDevices_dwFlags(DWORD dwFlags) TRACE("DIEDFL_ALLDEVICES\n"); return; } - for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++) + for (i = 0; i < ARRAY_SIZE(flags); i++) if (flags[i].mask & dwFlags) TRACE("%s ",flags[i].name); } @@ -1090,7 +1090,7 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics( /* Add keyboard and mouse to remaining device count */ if (!(dwFlags & DIEDBSFL_FORCEFEEDBACK)) { - for (i = 0; i < sizeof(guids) / sizeof(guids[0]); i++) + for (i = 0; i < ARRAY_SIZE(guids); i++) { if (should_enumerate_device(username_w, dwFlags, &This->device_players, guids[i])) remain++; @@ -1119,7 +1119,7 @@ static HRESULT WINAPI IDirectInput8AImpl_EnumDevicesBySemantics( } /* Enumerate keyboard and mouse */ - for(i=0; i < sizeof(guids)/sizeof(guids[0]); i++) + for (i = 0; i < ARRAY_SIZE(guids); i++) { if (should_enumerate_device(username_w, dwFlags, &This->device_players, guids[i])) { @@ -1191,7 +1191,7 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics( /* Add keyboard and mouse to remaining device count */ if (!(dwFlags & DIEDBSFL_FORCEFEEDBACK)) { - for (i = 0; i < sizeof(guids) / sizeof(guids[0]); i++) + for (i = 0; i < ARRAY_SIZE(guids); i++) { if (should_enumerate_device(ptszUserName, dwFlags, &This->device_players, guids[i])) remain++; @@ -1215,7 +1215,7 @@ static HRESULT WINAPI IDirectInput8WImpl_EnumDevicesBySemantics( if (dwFlags & DIEDBSFL_FORCEFEEDBACK) return DI_OK; /* Enumerate keyboard and mouse */ - for(i=0; i < sizeof(guids)/sizeof(guids[0]); i++) + for (i = 0; i < ARRAY_SIZE(guids); i++) { if (should_enumerate_device(ptszUserName, dwFlags, &This->device_players, guids[i])) { @@ -1747,12 +1747,10 @@ static DWORD WINAPI hook_thread_proc(void *param) { if (!dev->acquired || !dev->event_proc) continue; - if (IsEqualGUID( &dev->guid, &GUID_SysKeyboard ) || - IsEqualGUID( &dev->guid, &DInput_Wine_Keyboard_GUID )) + if (IsEqualGUID( &dev->guid, &GUID_SysKeyboard )) kbd_cnt++; else - if (IsEqualGUID( &dev->guid, &GUID_SysMouse ) || - IsEqualGUID( &dev->guid, &DInput_Wine_Mouse_GUID )) + if (IsEqualGUID( &dev->guid, &GUID_SysMouse )) mice_cnt++; } LeaveCriticalSection( &dinput->crit ); diff --git a/dll/directx/wine/dinput/dinput_private.h b/dll/directx/wine/dinput/dinput_private.h index 3ed68f2264..acda6c8048 100644 --- a/dll/directx/wine/dinput/dinput_private.h +++ b/dll/directx/wine/dinput/dinput_private.h @@ -27,6 +27,8 @@ #include "dinputd.h" #include "wine/list.h" +extern HINSTANCE DINPUT_instance; + /* Implementation specification */ typedef struct IDirectInputImpl IDirectInputImpl; struct IDirectInputImpl diff --git a/dll/directx/wine/dinput/joystick.c b/dll/directx/wine/dinput/joystick.c index 45c361809e..0ec1ceb249 100644 --- a/dll/directx/wine/dinput/joystick.c +++ b/dll/directx/wine/dinput/joystick.c @@ -92,7 +92,7 @@ static void _dump_DIEFFECT_flags(DWORD dwFlags) FE(DIEFF_SPHERICAL) #undef FE }; - for (i = 0; i < (sizeof(flags) / sizeof(flags[0])); i++) + for (i = 0; i < ARRAY_SIZE(flags); i++) if (flags[i].mask & dwFlags) TRACE("%s ", flags[i].name); TRACE("\n"); @@ -766,11 +766,11 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface, LPCWSTR lpszUserName, DWORD dwFlags) { + static const DWORD object_types[] = { DIDFT_AXIS, DIDFT_BUTTON }; + static const DWORD type_map[] = { DIDFT_RELAXIS, DIDFT_PSHBUTTON }; JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface); unsigned int i, j; BOOL has_actions = FALSE; - DWORD object_types[] = { DIDFT_AXIS, DIDFT_BUTTON }; - DWORD type_map[] = { DIDFT_RELAXIS, DIDFT_PSHBUTTON }; FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags); @@ -786,7 +786,7 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface, /* Only consider actions of the right genre */ if (lpdiaf->dwGenre != genre && genre != DIGENRE_ANY) continue; - for (j=0; j < sizeof(object_types)/sizeof(object_types[0]); j++) + for (j = 0; j < ARRAY_SIZE(object_types); j++) { if (type & object_types[j]) { @@ -979,7 +979,7 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_ { int i; - for (i = 0; i < sizeof(axis_names) / sizeof(axis_names[0]); i++) + for (i = 0; i < ARRAY_SIZE(axis_names); i++) { if (!strcmp(ptr, axis_names[i])) { @@ -1011,7 +1011,7 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_ } } - if (i == sizeof(axis_names) / sizeof(axis_names[0])) + if (i == ARRAY_SIZE(axis_names)) { ERR("invalid joystick axis type: \"%s\"\n", ptr); i = -1; diff --git a/dll/directx/wine/dinput/joystick_osx.c b/dll/directx/wine/dinput/joystick_osx.c index 2b2aade813..0701b9f42c 100644 --- a/dll/directx/wine/dinput/joystick_osx.c +++ b/dll/directx/wine/dinput/joystick_osx.c @@ -279,7 +279,7 @@ static const char* debugstr_cf(CFTypeRef t) if (!ret) { UniChar buf[200]; - int len = min(CFStringGetLength(s), sizeof(buf)/sizeof(buf[0])); + int len = min(CFStringGetLength(s), ARRAY_SIZE(buf)); CFStringGetCharacters(s, CFRangeMake(0, len), buf); ret = debugstr_wn(buf, len); } diff --git a/dll/directx/wine/dinput/keyboard.c b/dll/directx/wine/dinput/keyboard.c index 6c7b535ea4..642d0c0beb 100644 --- a/dll/directx/wine/dinput/keyboard.c +++ b/dll/directx/wine/dinput/keyboard.c @@ -145,10 +145,6 @@ static int KeyboardCallback( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM return ret; } -const GUID DInput_Wine_Keyboard_GUID = { /* 0ab8648a-7735-11d2-8c73-71df54a96441 */ - 0x0ab8648a, 0x7735, 0x11d2, {0x8c, 0x73, 0x71, 0xdf, 0x54, 0xa9, 0x64, 0x41} -}; - static DWORD get_keyboard_subtype(void) { DWORD kbd_type, kbd_subtype, dev_subtype; @@ -179,7 +175,7 @@ static void fill_keyboard_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD ver ddi.dwSize = dwSize; ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */ - ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */ + ddi.guidProduct = GUID_SysKeyboard; if (version >= 0x0800) ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (subtype << 8); else @@ -203,7 +199,7 @@ static void fill_keyboard_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD ver ddi.dwSize = dwSize; ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */ - ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */ + ddi.guidProduct = GUID_SysKeyboard; if (version >= 0x0800) ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (subtype << 8); else @@ -308,8 +304,7 @@ static HRESULT keyboarddev_create_device(IDirectInputImpl *dinput, REFGUID rguid TRACE("%p %s %s %p %i\n", dinput, debugstr_guid(rguid), debugstr_guid(riid), pdev, unicode); *pdev = NULL; - if (IsEqualGUID(&GUID_SysKeyboard, rguid) || /* Generic Keyboard */ - IsEqualGUID(&DInput_Wine_Keyboard_GUID, rguid)) /* Wine Keyboard */ + if (IsEqualGUID(&GUID_SysKeyboard, rguid)) /* Wine Keyboard */ { SysKeyboardImpl *This; @@ -508,7 +503,7 @@ static HRESULT WINAPI SysKeyboardWImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface scan = map_dik_to_scan(DIDFT_GETINSTANCE(pdidoi->dwType), This->subtype); if (!GetKeyNameTextW((scan & 0x80) << 17 | (scan & 0x7f) << 16, - pdidoi->tszName, sizeof(pdidoi->tszName)/sizeof(pdidoi->tszName[0]))) + pdidoi->tszName, ARRAY_SIZE(pdidoi->tszName))) return DIERR_OBJECTNOTFOUND; _dump_OBJECTINSTANCEW(pdidoi); diff --git a/dll/directx/wine/dinput/mouse.c b/dll/directx/wine/dinput/mouse.c index 6d3eff5d52..7133359351 100644 --- a/dll/directx/wine/dinput/mouse.c +++ b/dll/directx/wine/dinput/mouse.c @@ -93,10 +93,6 @@ static inline IDirectInputDevice8W *IDirectInputDevice8W_from_impl(SysMouseImpl static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM lparam ); -const GUID DInput_Wine_Mouse_GUID = { /* 9e573ed8-7734-11d2-8d4a-23903fb6bdf7 */ - 0x9e573ed8, 0x7734, 0x11d2, {0x8d, 0x4a, 0x23, 0x90, 0x3f, 0xb6, 0xbd, 0xf7} -}; - static void _dump_mouse_state(const DIMOUSESTATE2 *m_state) { int i; @@ -121,7 +117,7 @@ static void fill_mouse_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD versio ddi.dwSize = dwSize; ddi.guidInstance = GUID_SysMouse;/* DInput's GUID */ - ddi.guidProduct = DInput_Wine_Mouse_GUID; /* Vendor's GUID */ + ddi.guidProduct = GUID_SysMouse; if (version >= 0x0800) ddi.dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8); else @@ -145,7 +141,7 @@ static void fill_mouse_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD versio ddi.dwSize = dwSize; ddi.guidInstance = GUID_SysMouse;/* DInput's GUID */ - ddi.guidProduct = DInput_Wine_Mouse_GUID; /* Vendor's GUID */ + ddi.guidProduct = GUID_SysMouse; if (version >= 0x0800) ddi.dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8); else @@ -257,8 +253,7 @@ static HRESULT mousedev_create_device(IDirectInputImpl *dinput, REFGUID rguid, R TRACE("%p %s %s %p %i\n", dinput, debugstr_guid(rguid), debugstr_guid(riid), pdev, unicode); *pdev = NULL; - if (IsEqualGUID(&GUID_SysMouse, rguid) || /* Generic Mouse */ - IsEqualGUID(&DInput_Wine_Mouse_GUID, rguid)) /* Wine Mouse */ + if (IsEqualGUID(&GUID_SysMouse, rguid)) /* Wine Mouse */ { SysMouseImpl *This; diff --git a/dll/directx/wine/dinput/version.rc b/dll/directx/wine/dinput/version.rc new file mode 100644 index 0000000000..fd91f51877 --- /dev/null +++ b/dll/directx/wine/dinput/version.rc @@ -0,0 +1,26 @@ +/* + * Copyright 2001 Ove Kaaven + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WINE_FILEDESCRIPTION_STR "Wine DirectInput" +#define WINE_FILENAME_STR "dinput.dll" +#define WINE_FILEVERSION 5,1,2600,881 +#define WINE_FILEVERSION_STR "5.1.2600.881" +#define WINE_PRODUCTVERSION 5,1,2600,881 +#define WINE_PRODUCTVERSION_STR "5.1" + +#include "wine/wine_common_ver.rc" diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 64c9a50a12..d19384e21e 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -30,7 +30,7 @@ reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to WineStaging-4.0 reactos/dll/directx/wine/d3dxof # Synced to WineStaging-3.17 reactos/dll/directx/wine/ddraw # Synced to WineStaging-3.9 reactos/dll/directx/wine/devenum # Synced to WineStaging-3.9 -reactos/dll/directx/wine/dinput # Synced to WineStaging-3.17 +reactos/dll/directx/wine/dinput # Synced to WineStaging-4.0 reactos/dll/directx/wine/dinput8 # Synced to WineStaging-3.3 reactos/dll/directx/wine/dmusic # Synced to WineStaging-3.17 reactos/dll/directx/wine/dplay # Synced to WineStaging-3.3
6 years
1
0
0
0
[reactos] 01/01: [D3DX9_*] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e7b199daff6bc0951fc2c…
commit e7b199daff6bc0951fc2ce3b50b9cd17156ae0b5 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 25 13:10:23 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 25 13:10:23 2019 +0100 [D3DX9_*] Sync with Wine Staging 4.0. CORE-15682 --- dll/directx/wine/d3dx9_36/font.c | 5 +- dll/directx/wine/d3dx9_36/math.c | 24 ++++-- dll/directx/wine/d3dx9_36/shader.c | 8 +- dll/directx/wine/d3dx9_36/surface.c | 150 ++++++++++++++++++++++++++++-------- media/doc/README.WINE | 2 +- 5 files changed, 141 insertions(+), 48 deletions(-) diff --git a/dll/directx/wine/d3dx9_36/font.c b/dll/directx/wine/d3dx9_36/font.c index b4b9600320..05e490fd2a 100644 --- a/dll/directx/wine/d3dx9_36/font.c +++ b/dll/directx/wine/d3dx9_36/font.c @@ -134,7 +134,7 @@ static HRESULT WINAPI ID3DXFontImpl_GetDescA(ID3DXFont *iface, D3DXFONT_DESCA *d if( !desc ) return D3DERR_INVALIDCALL; memcpy(desc, &This->desc, FIELD_OFFSET(D3DXFONT_DESCA, FaceName)); - WideCharToMultiByte(CP_ACP, 0, This->desc.FaceName, -1, desc->FaceName, sizeof(desc->FaceName) / sizeof(CHAR), NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, This->desc.FaceName, -1, desc->FaceName, ARRAY_SIZE(desc->FaceName), NULL, NULL); return D3D_OK; } @@ -483,8 +483,7 @@ HRESULT WINAPI D3DXCreateFontIndirectA(IDirect3DDevice9 *device, const D3DXFONT_ /* Copy everything but the last structure member. This requires the two D3DXFONT_DESC structures to be equal until the FaceName member */ memcpy(&widedesc, desc, FIELD_OFFSET(D3DXFONT_DESCA, FaceName)); - MultiByteToWideChar(CP_ACP, 0, desc->FaceName, -1, - widedesc.FaceName, sizeof(widedesc.FaceName)/sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, desc->FaceName, -1, widedesc.FaceName, ARRAY_SIZE(widedesc.FaceName)); return D3DXCreateFontIndirectW(device, &widedesc, font); } diff --git a/dll/directx/wine/d3dx9_36/math.c b/dll/directx/wine/d3dx9_36/math.c index 8909c3c6b2..03ccbd04e1 100644 --- a/dll/directx/wine/d3dx9_36/math.c +++ b/dll/directx/wine/d3dx9_36/math.c @@ -794,24 +794,34 @@ D3DXMATRIX* WINAPI D3DXMatrixTransformation(D3DXMATRIX *pout, const D3DXVECTOR3 D3DXMatrixTranslation(&m1, -psc.x, -psc.y, -psc.z); - if ( !pscalingrotation ) + if ( !pscalingrotation || !pscaling ) { D3DXMatrixIdentity(&m2); D3DXMatrixIdentity(&m4); } else { + D3DXQUATERNION temp; + D3DXMatrixRotationQuaternion(&m4, pscalingrotation); - D3DXMatrixInverse(&m2, NULL, &m4); + temp.w = pscalingrotation->w; + temp.x = -pscalingrotation->x; + temp.y = -pscalingrotation->y; + temp.z = -pscalingrotation->z; + D3DXMatrixRotationQuaternion(&m2, &temp); } - if ( !pscaling ) D3DXMatrixIdentity(&m3); - else D3DXMatrixScaling(&m3, pscaling->x, pscaling->y, pscaling->z); + if ( !pscaling ) + D3DXMatrixIdentity(&m3); + else + D3DXMatrixScaling(&m3, pscaling->x, pscaling->y, pscaling->z); - if ( !protation ) D3DXMatrixIdentity(&m6); - else D3DXMatrixRotationQuaternion(&m6, protation); + if ( !protation ) + D3DXMatrixIdentity(&m6); + else + D3DXMatrixRotationQuaternion(&m6, protation); - D3DXMatrixTranslation(&m5, psc.x - prc.x, psc.y - prc.y, psc.z - prc.z); + D3DXMatrixTranslation(&m5, psc.x - prc.x, psc.y - prc.y, psc.z - prc.z); D3DXMatrixTranslation(&m7, prc.x + pt.x, prc.y + pt.y, prc.z + pt.z); D3DXMatrixMultiply(&m1, &m1, &m2); D3DXMatrixMultiply(&m1, &m1, &m3); diff --git a/dll/directx/wine/d3dx9_36/shader.c b/dll/directx/wine/d3dx9_36/shader.c index d3f6570f9f..fc0f503c69 100644 --- a/dll/directx/wine/d3dx9_36/shader.c +++ b/dll/directx/wine/d3dx9_36/shader.c @@ -2776,18 +2776,20 @@ HRESULT WINAPI D3DXCreateTextureShader(const DWORD *function, ID3DXTextureShader static unsigned int get_instr_length(const DWORD *byte_code, unsigned int major, unsigned int minor) { + DWORD opcode = *byte_code & 0xffff; unsigned int len = 0; + if (opcode == D3DSIO_COMMENT) + return (*byte_code & D3DSI_COMMENTSIZE_MASK) >> D3DSI_COMMENTSIZE_SHIFT; + if (major > 1) return (*byte_code & D3DSI_INSTLENGTH_MASK) >> D3DSI_INSTLENGTH_SHIFT; - switch (*byte_code & 0xffff) + switch (opcode) { case D3DSIO_END: ERR("Unexpected END token.\n"); return 0; - case D3DSIO_COMMENT: - return (*byte_code & D3DSI_COMMENTSIZE_MASK) >> D3DSI_COMMENTSIZE_SHIFT; case D3DSIO_DEF: case D3DSIO_DEFI: return 5; diff --git a/dll/directx/wine/d3dx9_36/surface.c b/dll/directx/wine/d3dx9_36/surface.c index 73a1cbde1a..ed82bcfbbd 100644 --- a/dll/directx/wine/d3dx9_36/surface.c +++ b/dll/directx/wine/d3dx9_36/surface.c @@ -1875,10 +1875,14 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, DWORD filter, D3DCOLOR color_key) { const struct pixel_format_desc *srcformatdesc, *destformatdesc; + void *tmp_src_memory = NULL, *tmp_dst_memory = NULL; + dxtn_conversion_func pre_convert = NULL, post_convert = NULL; + IDirect3DSurface9 *surface = dst_surface; + IDirect3DDevice9 *device; D3DSURFACE_DESC surfdesc; D3DLOCKED_RECT lockrect; struct volume src_size, dst_size; - HRESULT ret = D3D_OK; + HRESULT hr = D3D_OK; TRACE("(%p, %p, %s, %p, %#x, %u, %p, %s, %#x, 0x%08x)\n", dst_surface, dst_palette, wine_dbgstr_rect(dst_rect), src_memory, src_format, @@ -1934,6 +1938,26 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, return E_NOTIMPL; } + if (surfdesc.Pool == D3DPOOL_DEFAULT && !(surfdesc.Usage & D3DUSAGE_DYNAMIC)) + { + IDirect3DSurface9_GetDevice(dst_surface, &device); + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, surfdesc.Width, + surfdesc.Height, surfdesc.Format, D3DPOOL_SYSTEMMEM, &surface, NULL); + IDirect3DDevice9_Release(device); + if (FAILED(hr)) + { + WARN("Failed to create staging surface, hr %#x.\n", hr); + return D3DERR_INVALIDCALL; + } + } + + if (FAILED(IDirect3DSurface9_LockRect(surface, &lockrect, dst_rect, 0))) + { + if (surface != dst_surface) + IDirect3DSurface9_Release(surface); + return D3DXERR_INVALIDDATA; + } + if (src_format == surfdesc.Format && dst_size.width == src_size.width && dst_size.height == src_size.height @@ -1947,21 +1971,15 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, && src_size.height != surfdesc.Height)) { WARN("Source rect %s is misaligned.\n", wine_dbgstr_rect(src_rect)); - return D3DXERR_INVALIDDATA; + hr = D3DXERR_INVALIDDATA; + goto done; } - if (FAILED(IDirect3DSurface9_LockRect(dst_surface, &lockrect, dst_rect, 0))) - return D3DXERR_INVALIDDATA; - copy_pixels(src_memory, src_pitch, 0, lockrect.pBits, lockrect.Pitch, 0, &src_size, srcformatdesc); - - IDirect3DSurface9_UnlockRect(dst_surface); } else /* Stretching or format conversion. */ { - dxtn_conversion_func pre_convert, post_convert; - void *tmp_src_memory = NULL, *tmp_dst_memory = NULL; UINT tmp_src_pitch, tmp_dst_pitch; pre_convert = get_dxtn_conversion_func(srcformatdesc->format, FALSE); @@ -1971,27 +1989,25 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, (!post_convert && !is_conversion_to_supported(destformatdesc))) { FIXME("Unsupported format conversion %#x -> %#x.\n", src_format, surfdesc.Format); - return E_NOTIMPL; + hr = E_NOTIMPL; + goto done; } - if (FAILED(IDirect3DSurface9_LockRect(dst_surface, &lockrect, dst_rect, 0))) - return D3DXERR_INVALIDDATA; - /* handle pre-conversion */ if (pre_convert) { tmp_src_memory = HeapAlloc(GetProcessHeap(), 0, src_size.width * src_size.height * sizeof(DWORD)); if (!tmp_src_memory) { - ret = E_OUTOFMEMORY; - goto error; + hr = E_OUTOFMEMORY; + goto done; } tmp_src_pitch = src_size.width * sizeof(DWORD); if (!pre_convert(src_memory, tmp_src_memory, src_pitch, tmp_src_pitch, WINED3DFMT_B8G8R8A8_UNORM, src_size.width, src_size.height)) { - ret = E_FAIL; - goto error; + hr = E_FAIL; + goto done; } srcformatdesc = get_format_info(D3DFMT_A8R8G8B8); } @@ -2007,8 +2023,8 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, tmp_dst_memory = HeapAlloc(GetProcessHeap(), 0, dst_size.width * dst_size.height * sizeof(DWORD)); if (!tmp_dst_memory) { - ret = E_OUTOFMEMORY; - goto error; + hr = E_OUTOFMEMORY; + goto done; } tmp_dst_pitch = dst_size.width * sizeof(DWORD); destformatdesc = get_format_info(D3DFMT_A8R8G8B8); @@ -2041,12 +2057,24 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, if (!post_convert(tmp_dst_memory, lockrect.pBits, tmp_dst_pitch, lockrect.Pitch, WINED3DFMT_B8G8R8A8_UNORM, dst_size.width, dst_size.height)) { - ret = E_FAIL; - goto error; + hr = E_FAIL; + goto done; } } + } + +done: + IDirect3DSurface9_UnlockRect(surface); + if (surface != dst_surface) + { + if (SUCCEEDED(hr)) + { + IDirect3DSurface9_GetDevice(dst_surface, &device); + hr = IDirect3DDevice9_UpdateSurface(device, surface, NULL, dst_surface, NULL); + IDirect3DDevice9_Release(device); + } + IDirect3DSurface9_Release(surface); -error: if (pre_convert) HeapFree(GetProcessHeap(), 0, tmp_src_memory); if (post_convert) @@ -2054,7 +2082,7 @@ error: IDirect3DSurface9_UnlockRect(dst_surface); } - return ret; + return hr; } /************************************************************ @@ -2083,10 +2111,13 @@ HRESULT WINAPI D3DXLoadSurfaceFromSurface(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, IDirect3DSurface9 *src_surface, const PALETTEENTRY *src_palette, const RECT *src_rect, DWORD filter, D3DCOLOR color_key) { - RECT rect; + IDirect3DSurface9 *surface = src_surface; + D3DTEXTUREFILTERTYPE d3d_filter; + IDirect3DDevice9 *device; + D3DSURFACE_DESC src_desc; D3DLOCKED_RECT lock; - D3DSURFACE_DESC SrcDesc; HRESULT hr; + RECT s; TRACE("dst_surface %p, dst_palette %p, dst_rect %s, src_surface %p, " "src_palette %p, src_rect %s, filter %#x, color_key 0x%08x.\n", @@ -2096,20 +2127,71 @@ HRESULT WINAPI D3DXLoadSurfaceFromSurface(IDirect3DSurface9 *dst_surface, if (!dst_surface || !src_surface) return D3DERR_INVALIDCALL; - IDirect3DSurface9_GetDesc(src_surface, &SrcDesc); + if (!dst_palette && !src_palette && !color_key) + { + switch (filter) + { + case D3DX_FILTER_NONE: + d3d_filter = D3DTEXF_NONE; + break; + + case D3DX_FILTER_POINT: + d3d_filter = D3DTEXF_POINT; + break; + + case D3DX_FILTER_LINEAR: + d3d_filter = D3DTEXF_LINEAR; + break; + + default: + d3d_filter = ~0u; + break; + } + + if (d3d_filter != ~0u) + { + IDirect3DSurface9_GetDevice(src_surface, &device); + hr = IDirect3DDevice9_StretchRect(device, src_surface, src_rect, dst_surface, dst_rect, d3d_filter); + IDirect3DDevice9_Release(device); + if (SUCCEEDED(hr)) + return D3D_OK; + } + } + + IDirect3DSurface9_GetDesc(src_surface, &src_desc); if (!src_rect) - SetRect(&rect, 0, 0, SrcDesc.Width, SrcDesc.Height); - else - rect = *src_rect; + { + SetRect(&s, 0, 0, src_desc.Width, src_desc.Height); + src_rect = &s; + } - if (FAILED(IDirect3DSurface9_LockRect(src_surface, &lock, NULL, D3DLOCK_READONLY))) - return D3DXERR_INVALIDDATA; + if (FAILED(IDirect3DSurface9_LockRect(surface, &lock, NULL, D3DLOCK_READONLY))) + { + IDirect3DSurface9_GetDevice(src_surface, &device); + if (FAILED(IDirect3DDevice9_CreateRenderTarget(device, src_desc.Width, src_desc.Height, + src_desc.Format, D3DMULTISAMPLE_NONE, 0, TRUE, &surface, NULL))) + { + IDirect3DDevice9_Release(device); + return D3DXERR_INVALIDDATA; + } - hr = D3DXLoadSurfaceFromMemory(dst_surface, dst_palette, dst_rect, - lock.pBits, SrcDesc.Format, lock.Pitch, src_palette, &rect, filter, color_key); + if (SUCCEEDED(hr = IDirect3DDevice9_StretchRect(device, src_surface, NULL, surface, NULL, D3DTEXF_NONE))) + hr = IDirect3DSurface9_LockRect(surface, &lock, NULL, D3DLOCK_READONLY); + IDirect3DDevice9_Release(device); + if (FAILED(hr)) + { + IDirect3DSurface9_Release(surface); + return D3DXERR_INVALIDDATA; + } + } - IDirect3DSurface9_UnlockRect(src_surface); + hr = D3DXLoadSurfaceFromMemory(dst_surface, dst_palette, dst_rect, lock.pBits, + src_desc.Format, lock.Pitch, src_palette, src_rect, filter, color_key); + + IDirect3DSurface9_UnlockRect(surface); + if (surface != src_surface) + IDirect3DSurface9_Release(surface); return hr; } diff --git a/media/doc/README.WINE b/media/doc/README.WINE index c5b71b8082..64c9a50a12 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -26,7 +26,7 @@ reactos/dll/directx/wine/d3d8 # Synced to WineStaging-3.9 reactos/dll/directx/wine/d3d9 # Synced to WineStaging-3.9 reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-4.0 reactos/dll/directx/wine/d3drm # Synced to WineStaging-4.0 -reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to WineStaging-3.17 +reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to WineStaging-4.0 reactos/dll/directx/wine/d3dxof # Synced to WineStaging-3.17 reactos/dll/directx/wine/ddraw # Synced to WineStaging-3.9 reactos/dll/directx/wine/devenum # Synced to WineStaging-3.9
6 years
1
0
0
0
[reactos] 01/01: [D3DRM_WINETEST] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=28cb32c39304d214687b0…
commit 28cb32c39304d214687b0843090affe65890be2e Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 25 13:09:38 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 25 13:09:38 2019 +0100 [D3DRM_WINETEST] Sync with Wine Staging 4.0. CORE-15682 --- modules/rostests/winetests/d3drm/d3drm.c | 163 ++++++++++++++++++++++++------- 1 file changed, 130 insertions(+), 33 deletions(-) diff --git a/modules/rostests/winetests/d3drm/d3drm.c b/modules/rostests/winetests/d3drm/d3drm.c index 5bd6e5e285..5157952d63 100644 --- a/modules/rostests/winetests/d3drm/d3drm.c +++ b/modules/rostests/winetests/d3drm/d3drm.c @@ -1563,7 +1563,7 @@ static void test_object(void) ok(hr == CLASSFACTORY_E_FIRST, "Expected hr == CLASSFACTORY_E_FIRST, got %#x.\n", hr); ok(!unknown, "Expected object returned == NULL, got %p.\n", unknown); - for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) + for (i = 0; i < ARRAY_SIZE(tests); ++i) { unknown = (IUnknown *)0xdeadbeef; hr = IDirect3DRM_CreateObject(d3drm1, NULL, NULL, tests[i].iid, (void **)&unknown); @@ -3028,7 +3028,7 @@ static void test_d3drm_qi(void) hr = Direct3DRMCreate(&d3drm); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr); - test_qi("d3drm_qi", (IUnknown *)d3drm, &IID_IDirect3DRM, tests, sizeof(tests) / sizeof(*tests)); + test_qi("d3drm_qi", (IUnknown *)d3drm, &IID_IDirect3DRM, tests, ARRAY_SIZE(tests)); IDirect3DRM_Release(d3drm); } @@ -3122,7 +3122,7 @@ static void test_frame_qi(void) hr = IDirect3DRMFrame_QueryInterface(frame1, &IID_IUnknown, (void **)&unknown); ok(hr == D3DRM_OK, "Failed to create IUnknown from frame1 (hr = %x)\n", hr); IDirect3DRMFrame_Release(frame1); - test_qi("frame1_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("frame1_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM2, (void **)&d3drm2); @@ -3132,7 +3132,7 @@ static void test_frame_qi(void) hr = IDirect3DRMFrame2_QueryInterface(frame2, &IID_IUnknown, (void **)&unknown); ok(hr == D3DRM_OK, "Failed to create IUnknown from frame2 (hr = %x)\n", hr); IDirect3DRMFrame2_Release(frame2); - test_qi("frame2_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("frame2_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM3, (void **)&d3drm3); @@ -3142,7 +3142,7 @@ static void test_frame_qi(void) hr = IDirect3DRMFrame3_QueryInterface(frame3, &IID_IUnknown, (void **)&unknown); ok(hr == D3DRM_OK, "Failed to create IUnknown from frame3 (hr = %x)\n", hr); IDirect3DRMFrame3_Release(frame3); - test_qi("frame3_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("frame3_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); IDirect3DRM3_Release(d3drm3); @@ -3251,7 +3251,7 @@ static void test_device_qi(void) hr = IDirect3DRMDevice_QueryInterface(device1, &IID_IUnknown, (void **)&unknown); ok(SUCCEEDED(hr), "Cannot get IUnknown interface from IDirect3DRMDevice (hr = %x)\n", hr); IDirect3DRMDevice_Release(device1); - test_qi("device1_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("device1_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM2, (void **)&d3drm2); @@ -3261,7 +3261,7 @@ static void test_device_qi(void) hr = IDirect3DRMDevice2_QueryInterface(device2, &IID_IUnknown, (void **)&unknown); ok(SUCCEEDED(hr), "Cannot get IUnknown interface from IDirect3DRMDevice2 (hr = %x)\n", hr); IDirect3DRMDevice2_Release(device2); - test_qi("device2_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("device2_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM3, (void **)&d3drm3); @@ -3271,7 +3271,7 @@ static void test_device_qi(void) IDirect3DRMDevice3_QueryInterface(device3, &IID_IUnknown, (void **)&unknown); ok(SUCCEEDED(hr), "Cannot get IUnknown interface from IDirect3DRMDevice3 (hr = %x)\n", hr); IDirect3DRMDevice3_Release(device3); - test_qi("device3_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("device3_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); IDirectDrawClipper_Release(clipper); @@ -4439,7 +4439,7 @@ static IDirect3DDevice *create_device1(IDirectDraw *ddraw, HWND window, IDirectD /* We used to use EnumDevices() for this, but it seems * D3DDEVICEDESC.dwDeviceZBufferBitDepth only has a very casual * relationship with reality. */ - for (i = 0; i < sizeof(z_depths) / sizeof(*z_depths); ++i) + for (i = 0; i < ARRAY_SIZE(z_depths); ++i) { memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -4773,7 +4773,7 @@ static IDirect3DDevice2 *create_device2(IDirectDraw2 *ddraw, HWND window, IDirec /* We used to use EnumDevices() for this, but it seems * D3DDEVICEDESC.dwDeviceZBufferBitDepth only has a very casual * relationship with reality. */ - for (i = 0; i < sizeof(z_depths) / sizeof(*z_depths); ++i) + for (i = 0; i < ARRAY_SIZE(z_depths); ++i) { memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); @@ -5569,10 +5569,11 @@ static void test_load_texture(void) IDirect3DRM3 *d3drm3; IDirect3DRM2 *d3drm2; IDirect3DRM *d3drm1; + ULONG ref1, ref2; + unsigned int i; char *filename; HRESULT hr; BOOL ret; - int i; static const struct { @@ -5595,43 +5596,139 @@ static void test_load_texture(void) ok(SUCCEEDED(hr), "Failed to get IDirect3DRM2 interface, hr %#x.\n", hr); hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM3, (void **)&d3drm3); ok(SUCCEEDED(hr), "Failed to get IDirect3DRM3 interface, hr %#x.\n", hr); + ref1 = get_refcount((IUnknown *)d3drm1); + + /* Test all failures together. */ + texture1 = (IDirect3DRMTexture *)0xdeadbeef; + hr = IDirect3DRM_LoadTexture(d3drm1, NULL, &texture1); + ok(hr == D3DRMERR_BADVALUE, "Got unexpected hr %#x.\n", hr); + ok(!texture1, "Got unexpected texture %p.\n", texture1); + texture1 = (IDirect3DRMTexture *)0xdeadbeef; + hr = IDirect3DRM_LoadTexture(d3drm1, "", &texture1); + ok(hr == D3DRMERR_FILENOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(!texture1, "Got unexpected texture %p.\n", texture1); + hr = IDirect3DRM_LoadTexture(d3drm1, NULL, NULL); + ok(hr == D3DRMERR_BADVALUE, "Got unexpected hr %#x.\n", hr); - for (i = 0; i < sizeof(tests) / sizeof(*tests); ++i) + texture2 = (IDirect3DRMTexture2 *)0xdeadbeef; + hr = IDirect3DRM2_LoadTexture(d3drm2, NULL, &texture2); + ok(hr == D3DRMERR_FILENOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(!texture2, "Got unexpected texture %p.\n", texture2); + texture2 = (IDirect3DRMTexture2 *)0xdeadbeef; + hr = IDirect3DRM2_LoadTexture(d3drm2, "", &texture2); + ok(hr == D3DRMERR_FILENOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(!texture2, "Got unexpected texture %p.\n", texture2); + hr = IDirect3DRM2_LoadTexture(d3drm2, NULL, NULL); + ok(hr == D3DRMERR_BADVALUE, "Got unexpected hr %#x.\n", hr); + + texture3 = (IDirect3DRMTexture3 *)0xdeadbeef; + hr = IDirect3DRM3_LoadTexture(d3drm3, NULL, &texture3); + ok(hr == D3DRMERR_FILENOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(!texture3, "Got unexpected texture %p.\n", texture3); + texture3 = (IDirect3DRMTexture3 *)0xdeadbeef; + hr = IDirect3DRM_LoadTexture(d3drm3, "", &texture3); + ok(hr == D3DRMERR_FILENOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(!texture3, "Got unexpected texture %p.\n", texture3); + hr = IDirect3DRM3_LoadTexture(d3drm3, NULL, NULL); + ok(hr == D3DRMERR_BADVALUE, "Got unexpected hr %#x.\n", hr); + + for (i = 0; i < ARRAY_SIZE(tests); ++i) { filename = create_bitmap(tests[i].w, tests[i].h, tests[i].palettized); hr = IDirect3DRM_LoadTexture(d3drm1, filename, &texture1); ok(SUCCEEDED(hr), "Test %u: Failed to load texture, hr %#x.\n", i, hr); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 > ref1, "Test %u: expected ref2 > ref1, got ref1 %u, ref2 %u.\n", i, ref1, ref2); + + hr = IDirect3DRMTexture_InitFromFile(texture1, filename); + ok(hr == D3DRMERR_BADOBJECT, "Test %u: Got unexpected hr %#x.\n", i, hr); + /* InitFromFile() seems to AddRef() IDirect3DRM even if it fails. */ + IDirect3DRM_Release(d3drm1); d3drm_img = IDirect3DRMTexture_GetImage(texture1); - todo_wine ok(!!d3drm_img, "Test %u: Failed to get image.\n", i); - if (d3drm_img) - test_bitmap_data(i * 4, d3drm_img, FALSE, tests[i].w, tests[i].h, tests[i].palettized); + ok(!!d3drm_img, "Test %u: Failed to get image.\n", i); + test_bitmap_data(i * 7, d3drm_img, FALSE, tests[i].w, tests[i].h, tests[i].palettized); + IDirect3DRMTexture_Release(texture1); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref1 == ref2, "Test %u: expected ref1 == ref2, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + hr = IDirect3DRM_CreateObject(d3drm1, &CLSID_CDirect3DRMTexture, + NULL, &IID_IDirect3DRMTexture, (void **)&texture1); + ok(SUCCEEDED(hr), "Test %u: Failed to create texture, hr %#x.\n", i, hr); + hr = IDirect3DRMTexture_InitFromFile(texture1, NULL); + ok(hr == D3DRMERR_BADOBJECT, "Test %u: Got unexpected hr %#x.\n", i, hr); + hr = IDirect3DRMTexture_InitFromFile(texture1, ""); + ok(hr == D3DRMERR_BADOBJECT, "Test %u: Got unexpected hr %#x.\n", i, hr); + hr = IDirect3DRMTexture_InitFromFile(texture1, filename); + ok(SUCCEEDED(hr), "Test %u: Failed to initialise texture from file, hr %#x.\n", i, hr); + d3drm_img = IDirect3DRMTexture_GetImage(texture1); + ok(!!d3drm_img, "Test %u: Failed to get image.\n", i); + test_bitmap_data(i * 7 + 1, d3drm_img, FALSE, tests[i].w, tests[i].h, tests[i].palettized); IDirect3DRMTexture_Release(texture1); hr = IDirect3DRM2_LoadTexture(d3drm2, filename, &texture2); ok(SUCCEEDED(hr), "Test %u: Failed to load texture, hr %#x.\n", i, hr); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 > ref1, "Test %u: expected ref2 > ref1, got ref1 %u, ref2 %u.\n", i, ref1, ref2); + + hr = IDirect3DRMTexture2_InitFromFile(texture2, filename); + ok(hr == D3DRMERR_BADOBJECT, "Test %u: Got unexpected hr %#x.\n", i, hr); + IDirect3DRM_Release(d3drm1); d3drm_img = IDirect3DRMTexture2_GetImage(texture2); - todo_wine ok(!!d3drm_img, "Test %u: Failed to get image.\n", i); - if (d3drm_img) - test_bitmap_data(i * 4 + 1, d3drm_img, TRUE, tests[i].w, tests[i].h, tests[i].palettized); + ok(!!d3drm_img, "Test %u: Failed to get image.\n", i); + test_bitmap_data(i * 7 + 2, d3drm_img, TRUE, tests[i].w, tests[i].h, tests[i].palettized); + IDirect3DRMTexture2_Release(texture2); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref1 == ref2, "Test %u: expected ref1 == ref2, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + hr = IDirect3DRM2_CreateObject(d3drm2, &CLSID_CDirect3DRMTexture, + NULL, &IID_IDirect3DRMTexture2, (void **)&texture2); + ok(SUCCEEDED(hr), "Test %u: Failed to create texture, hr %#x.\n", i, hr); + hr = IDirect3DRMTexture2_InitFromFile(texture2, NULL); + ok(hr == D3DRMERR_BADOBJECT, "Test %u: Got unexpected hr %#x.\n", i, hr); + hr = IDirect3DRMTexture2_InitFromFile(texture2, ""); + ok(hr == D3DRMERR_BADOBJECT, "Test %u: Got unexpected hr %#x.\n", i, hr); + hr = IDirect3DRMTexture2_InitFromFile(texture2, filename); + ok(SUCCEEDED(hr), "Test %u: Failed to initialise texture from file, hr %#x.\n", i, hr); + d3drm_img = IDirect3DRMTexture2_GetImage(texture2); + ok(!!d3drm_img, "Test %u: Failed to get image.\n", i); + test_bitmap_data(i * 7 + 3, d3drm_img, TRUE, tests[i].w, tests[i].h, tests[i].palettized); IDirect3DRMTexture2_Release(texture2); hr = IDirect3DRM3_LoadTexture(d3drm3, filename, &texture3); ok(SUCCEEDED(hr), "Test %u: Failed to load texture, hr %#x.\n", i, hr); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref2 > ref1, "Test %u: expected ref2 > ref1, got ref1 %u, ref2 %u.\n", i, ref1, ref2); + + hr = IDirect3DRMTexture3_InitFromFile(texture3, filename); + ok(hr == D3DRMERR_BADOBJECT, "Test %u: Got unexpected hr %#x.\n", i, hr); + IDirect3DRM_Release(d3drm1); d3drm_img = IDirect3DRMTexture3_GetImage(texture3); - todo_wine ok(!!d3drm_img, "Test %u: Failed to get image.\n", i); - if (d3drm_img) - test_bitmap_data(i * 4 + 2, d3drm_img, TRUE, tests[i].w, tests[i].h, tests[i].palettized); + ok(!!d3drm_img, "Test %u: Failed to get image.\n", i); + test_bitmap_data(i * 7 + 4, d3drm_img, TRUE, tests[i].w, tests[i].h, tests[i].palettized); /* Test whether querying a version 1 texture from version 3 causes a * change in the loading behavior. */ hr = IDirect3DRMTexture3_QueryInterface(texture3, &IID_IDirect3DRMTexture, (void **)&texture1); ok(SUCCEEDED(hr), "Failed to get IDirect3DRMTexture interface, hr %#x.\n", hr); d3drm_img = IDirect3DRMTexture_GetImage(texture1); - todo_wine ok(!!d3drm_img, "Test %u: Failed to get image.\n", i); - if (d3drm_img) - test_bitmap_data(i * 4 + 3, d3drm_img, TRUE, tests[i].w, tests[i].h, tests[i].palettized); + ok(!!d3drm_img, "Test %u: Failed to get image.\n", i); + test_bitmap_data(i * 7 + 5, d3drm_img, TRUE, tests[i].w, tests[i].h, tests[i].palettized); IDirect3DRMTexture_Release(texture1); IDirect3DRMTexture3_Release(texture3); + ref2 = get_refcount((IUnknown *)d3drm1); + ok(ref1 == ref2, "Test %u: expected ref1 == ref2, got ref1 = %u, ref2 = %u.\n", i, ref1, ref2); + + hr = IDirect3DRM3_CreateObject(d3drm3, &CLSID_CDirect3DRMTexture, + NULL, &IID_IDirect3DRMTexture3, (void **)&texture3); + ok(SUCCEEDED(hr), "Test %u: Failed to create texture, hr %#x.\n", i, hr); + hr = IDirect3DRMTexture3_InitFromFile(texture3, NULL); + ok(hr == D3DRMERR_BADOBJECT, "Test %u: Got unexpected hr %#x.\n", i, hr); + hr = IDirect3DRMTexture3_InitFromFile(texture3, ""); + ok(hr == D3DRMERR_BADOBJECT, "Test %u: Got unexpected hr %#x.\n", i, hr); + hr = IDirect3DRMTexture3_InitFromFile(texture3, filename); + ok(SUCCEEDED(hr), "Test %u: Failed to initialize texture from file, hr %#x.\n", i, hr); + d3drm_img = IDirect3DRMTexture3_GetImage(texture3); + ok(!!d3drm_img, "Test %u: Failed to get image.\n", i); + test_bitmap_data(i * 7 + 6, d3drm_img, TRUE, tests[i].w, tests[i].h, tests[i].palettized); + IDirect3DRMTexture3_Release(texture3); ret = DeleteFileA(filename); ok(ret, "Test %u: Failed to delete bitmap \"%s\".\n", i, filename); @@ -5736,7 +5833,7 @@ static void test_texture_qi(void) hr = IDirect3DRMTexture_QueryInterface(texture1, &IID_IUnknown, (void **)&unknown); ok(SUCCEEDED(hr), "Cannot get IUnknown interface from IDirect3DRMTexture (hr = %#x)\n", hr); IDirect3DRMTexture_Release(texture1); - test_qi("texture1_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("texture1_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM2, (void **)&d3drm2); @@ -5746,7 +5843,7 @@ static void test_texture_qi(void) hr = IDirect3DRMTexture2_QueryInterface(texture2, &IID_IUnknown, (void **)&unknown); ok(SUCCEEDED(hr), "Cannot get IUnknown interface from IDirect3DRMTexture2 (hr = %#x)\n", hr); IDirect3DRMTexture2_Release(texture2); - test_qi("texture2_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("texture2_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM3, (void **)&d3drm3); @@ -5757,7 +5854,7 @@ static void test_texture_qi(void) hr = IDirect3DRMTexture3_QueryInterface(texture3, &IID_IUnknown, (void **)&unknown); ok(SUCCEEDED(hr), "Cannot get IUnknown interface from IDirect3DRMTexture3 (hr = %#x)\n", hr); IDirect3DRMTexture3_Release(texture3); - test_qi("texture3_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("texture3_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); IDirect3DRM3_Release(d3drm3); @@ -5873,7 +5970,7 @@ static void test_viewport_qi(void) hr = IDirect3DRMViewport_QueryInterface(viewport1, &IID_IUnknown, (void **)&unknown); ok(SUCCEEDED(hr), "Cannot get IUnknown interface (hr = %#x).\n", hr); IDirect3DRMViewport_Release(viewport1); - test_qi("viewport1_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("viewport1_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM2, (void **)&d3drm2); @@ -5883,7 +5980,7 @@ static void test_viewport_qi(void) hr = IDirect3DRMViewport_QueryInterface(viewport1, &IID_IUnknown, (void **)&unknown); ok(SUCCEEDED(hr), "Cannot get IUnknown interface (hr = %#x).\n", hr); IDirect3DRMViewport_Release(viewport1); - test_qi("viewport1_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("viewport1_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); IDirect3DRMDevice_Release(device1); IDirect3DRMFrame_Release(camera1); @@ -5902,7 +5999,7 @@ static void test_viewport_qi(void) hr = IDirect3DRMViewport2_QueryInterface(viewport2, &IID_IUnknown, (void **)&unknown); ok(SUCCEEDED(hr), "Cannot get IUnknown interface (hr = %#x).\n", hr); IDirect3DRMViewport_Release(viewport2); - test_qi("viewport2_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("viewport2_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); IDirect3DRMDevice3_Release(device3); IDirect3DRMFrame3_Release(camera3); @@ -7181,7 +7278,7 @@ static void test_animation_qi(void) ok(SUCCEEDED(hr), "Failed to get IUnknown from animation, hr %#x.\n", hr); IDirect3DRMAnimation_Release(animation); - test_qi("animation_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("animation_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); hr = IDirect3DRM_QueryInterface(d3drm1, &IID_IDirect3DRM3, (void **)&d3drm3); @@ -7194,7 +7291,7 @@ static void test_animation_qi(void) ok(SUCCEEDED(hr), "Failed to get IUnknown from animation, hr %#x.\n", hr); IDirect3DRMAnimation2_Release(animation2); - test_qi("animation2_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("animation2_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); IDirect3DRM3_Release(d3drm3); @@ -7302,7 +7399,7 @@ static void test_wrap_qi(void) hr = IDirect3DRMWrap_QueryInterface(wrap, &IID_IUnknown, (void **)&unknown); ok(SUCCEEDED(hr), "Failed to get IUnknown from wrap (hr = %#x)\n", hr); IDirect3DRMWrap_Release(wrap); - test_qi("wrap_qi", unknown, &IID_IUnknown, tests, sizeof(tests) / sizeof(*tests)); + test_qi("wrap_qi", unknown, &IID_IUnknown, tests, ARRAY_SIZE(tests)); IUnknown_Release(unknown); IDirect3DRM_Release(d3drm1);
6 years
1
0
0
0
[reactos] 01/01: [D3DRM] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=511039b77d66c297f71cb…
commit 511039b77d66c297f71cbd50fdfd65efd8c073f1 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 25 13:09:01 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 25 13:09:01 2019 +0100 [D3DRM] Sync with Wine Staging 4.0. CORE-15682 --- dll/directx/wine/d3drm/d3drm.c | 40 ++++- dll/directx/wine/d3drm/d3drm_private.h | 4 - dll/directx/wine/d3drm/texture.c | 312 ++++++++++++++++++++++++++++++++- media/doc/README.WINE | 2 +- 4 files changed, 341 insertions(+), 17 deletions(-) diff --git a/dll/directx/wine/d3drm/d3drm.c b/dll/directx/wine/d3drm/d3drm.c index 3ea16327bf..d0f20235a8 100644 --- a/dll/directx/wine/d3drm/d3drm.c +++ b/dll/directx/wine/d3drm/d3drm.c @@ -638,12 +638,24 @@ static HRESULT WINAPI d3drm1_LoadTexture(IDirect3DRM *iface, struct d3drm_texture *object; HRESULT hr; - FIXME("iface %p, filename %s, texture %p stub!\n", iface, debugstr_a(filename), texture); + TRACE("iface %p, filename %s, texture %p.\n", iface, debugstr_a(filename), texture); + + if (!texture) + return D3DRMERR_BADVALUE; if (FAILED(hr = d3drm_texture_create(&object, iface))) return hr; *texture = &object->IDirect3DRMTexture_iface; + if (FAILED(hr = IDirect3DRMTexture_InitFromFile(*texture, filename))) + { + IDirect3DRMTexture_Release(*texture); + *texture = NULL; + if (!filename) + return D3DRMERR_BADVALUE; + + return hr == D3DRMERR_BADOBJECT ? D3DRMERR_FILENOTFOUND : hr; + } return D3DRM_OK; } @@ -1143,15 +1155,22 @@ static HRESULT WINAPI d3drm2_LoadTexture(IDirect3DRM2 *iface, const char *filename, IDirect3DRMTexture2 **texture) { struct d3drm *d3drm = impl_from_IDirect3DRM2(iface); - struct d3drm_texture *object; + IDirect3DRMTexture3 *texture3; HRESULT hr; - FIXME("iface %p, filename %s, texture %p stub!\n", iface, debugstr_a(filename), texture); + TRACE("iface %p, filename %s, texture %p.\n", iface, debugstr_a(filename), texture); - if (FAILED(hr = d3drm_texture_create(&object, &d3drm->IDirect3DRM_iface))) + if (!texture) + return D3DRMERR_BADVALUE; + + if (FAILED(hr = IDirect3DRM3_LoadTexture(&d3drm->IDirect3DRM3_iface, filename, &texture3))) + { + *texture = NULL; return hr; + } - *texture = &object->IDirect3DRMTexture2_iface; + hr = IDirect3DRMTexture3_QueryInterface(texture3, &IID_IDirect3DRMTexture2, (void **)texture); + IDirect3DRMTexture3_Release(texture3); return hr; } @@ -1818,12 +1837,21 @@ static HRESULT WINAPI d3drm3_LoadTexture(IDirect3DRM3 *iface, struct d3drm_texture *object; HRESULT hr; - FIXME("iface %p, filename %s, texture %p stub!\n", iface, debugstr_a(filename), texture); + TRACE("iface %p, filename %s, texture %p.\n", iface, debugstr_a(filename), texture); + + if (!texture) + return D3DRMERR_BADVALUE; if (FAILED(hr = d3drm_texture_create(&object, &d3drm->IDirect3DRM_iface))) return hr; *texture = &object->IDirect3DRMTexture3_iface; + if (FAILED(hr = IDirect3DRMTexture3_InitFromFile(*texture, filename))) + { + IDirect3DRMTexture3_Release(*texture); + *texture = NULL; + return hr == D3DRMERR_BADOBJECT ? D3DRMERR_FILENOTFOUND : hr; + } return D3DRM_OK; } diff --git a/dll/directx/wine/d3drm/d3drm_private.h b/dll/directx/wine/d3drm/d3drm_private.h index 0f24f80d24..858911f350 100644 --- a/dll/directx/wine/d3drm/d3drm_private.h +++ b/dll/directx/wine/d3drm/d3drm_private.h @@ -33,10 +33,6 @@ #include "wine/heap.h" #include "wine/list.h" -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a))) -#endif - struct d3drm_object { LONG ref; diff --git a/dll/directx/wine/d3drm/texture.c b/dll/directx/wine/d3drm/texture.c index fd56e76ff9..7741718ce9 100644 --- a/dll/directx/wine/d3drm/texture.c +++ b/dll/directx/wine/d3drm/texture.c @@ -2,6 +2,7 @@ * Implementation of IDirect3DRMTextureX interfaces * * Copyright 2012 Christian Costa + * Copyright 2016 Aaryaman Vasishta * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -67,6 +68,289 @@ static BOOL d3drm_validate_image(D3DRMIMAGE *image) return TRUE; } +static BOOL d3drm_image_palettise(D3DRMIMAGE *image, unsigned char *src_data, + SIZE_T w, SIZE_T h, BOOL flip) +{ + unsigned char *dst_data, *src_ptr, *dst_ptr; + SIZE_T src_pitch, dst_pitch, i, x, y; + D3DRMPALETTEENTRY *palette, *entry; + unsigned int colour_count = 0; + + if (w > (~(SIZE_T)0 - 3) / h) + return FALSE; + + src_pitch = flip ? -w * 3 : w * 3; + dst_pitch = (w + 3) & ~3; + + if (!(dst_data = heap_alloc(dst_pitch * h))) + { + WARN("Failed to allocate image buffer.\n"); + return FALSE; + } + memset(dst_data, 0xff, dst_pitch * h); + + if (!(palette = heap_alloc(256 * sizeof(*palette)))) + { + WARN("Failed to allocate palette.\n"); + heap_free(dst_data); + return FALSE; + } + + src_ptr = flip ? &src_data[(h - 1) * w * 3] : src_data; + dst_ptr = dst_data; + + for (y = 0; y < h; ++y) + { + for (x = 0; x < w; ++x) + { + for (i = 0; i < colour_count; ++i) + { + entry = &palette[i]; + if (entry->red == src_ptr[x * 3 + 0] + && entry->green == src_ptr[x * 3 + 1] + && entry->blue == src_ptr[x * 3 + 2]) + break; + } + + if (i == colour_count) + { + if (colour_count == 256) + { + heap_free(dst_data); + heap_free(palette); + return FALSE; + } + + entry = &palette[colour_count++]; + entry->red = src_ptr[x * 3 + 0]; + entry->green = src_ptr[x * 3 + 1]; + entry->blue = src_ptr[x * 3 + 2]; + entry->flags = D3DRMPALETTE_READONLY; + } + + dst_ptr[x] = i; + } + + src_ptr += src_pitch; + dst_ptr += dst_pitch; + } + + image->depth = 8; + image->rgb = 0; + image->bytes_per_line = dst_pitch; + image->buffer1 = dst_data; + image->red_mask = 0xff; + image->green_mask = 0xff; + image->blue_mask = 0xff; + image->palette_size = colour_count; + if (!(image->palette = heap_realloc(palette, colour_count * sizeof(*palette)))) + image->palette = palette; + + return TRUE; +} + +static HRESULT d3drm_image_load_32(D3DRMIMAGE *image, unsigned char *src_data, + LONGLONG src_data_size, SIZE_T w, SIZE_T h, BOOL flip) +{ + unsigned char *dst_data, *src_ptr, *dst_ptr; + SIZE_T src_pitch, dst_pitch, x, y; + + if (d3drm_image_palettise(image, src_data, w, h, flip)) + return D3DRM_OK; + + if (w > (~(SIZE_T)0 / 4) / h) + return D3DRMERR_BADALLOC; + + src_pitch = flip ? -w * 3 : w * 3; + dst_pitch = w * 4; + + if (!(dst_data = heap_alloc(dst_pitch * h))) + { + WARN("Failed to allocate image buffer.\n"); + return D3DRMERR_BADALLOC; + } + + src_ptr = flip ? &src_data[(h - 1) * w * 3] : src_data; + dst_ptr = dst_data; + + for (y = 0; y < h; ++y) + { + for (x = 0; x < w; ++x) + { + dst_ptr[x * 4 + 0] = src_ptr[x * 3 + 0]; + dst_ptr[x * 4 + 1] = src_ptr[x * 3 + 1]; + dst_ptr[x * 4 + 2] = src_ptr[x * 3 + 2]; + dst_ptr[x * 4 + 3] = 0xff; + } + + src_ptr += src_pitch; + dst_ptr += dst_pitch; + } + + image->depth = 32; + image->rgb = 1; + image->bytes_per_line = dst_pitch; + image->buffer1 = dst_data; + image->red_mask = 0xff0000; + image->green_mask = 0x00ff00; + image->blue_mask = 0x0000ff; + image->palette_size = 0; + image->palette = NULL; + + return D3DRM_OK; +} + +static HRESULT d3drm_image_load_8(D3DRMIMAGE *image, const RGBQUAD *palette, + unsigned char *src_data, LONGLONG src_data_size, SIZE_T w, SIZE_T h, BOOL flip) +{ + unsigned char *dst_data; + SIZE_T i; + + if (w > ~(SIZE_T)0 / h) + return D3DRMERR_BADALLOC; + + if (!(dst_data = heap_alloc(w * h))) + { + WARN("Failed to allocate image buffer.\n"); + return D3DRMERR_BADALLOC; + } + + if (!(image->palette = heap_alloc(256 * sizeof(*image->palette)))) + { + WARN("Failed to allocate palette.\n"); + heap_free(dst_data); + return D3DRMERR_BADALLOC; + } + + memcpy(image->palette, palette, 256 * sizeof(*image->palette)); + for (i = 0; i < 256; ++i) + { + image->palette[i].flags = D3DRMPALETTE_READONLY; + } + + if (flip) + { + for (i = 0; i < h; ++i) + { + memcpy(&dst_data[i * w], &src_data[(h - 1 - i) * w], w); + } + } + else + { + memcpy(dst_data, src_data, w * h); + } + + image->depth = 8; + image->rgb = 0; + image->bytes_per_line = w; + image->buffer1 = dst_data; + image->red_mask = 0xff; + image->green_mask = 0xff; + image->blue_mask = 0xff; + image->palette_size = 256; + + return D3DRM_OK; +} + +static void CDECL destroy_image_callback(IDirect3DRMObject *obj, void *arg) +{ + D3DRMIMAGE *image = arg; + + TRACE("texture object %p, image %p.\n", obj, image); + + heap_free(image->buffer1); + heap_free(image); +} + +static HRESULT d3drm_texture_load(struct d3drm_texture *texture, + const char *path, BOOL flip, D3DRMIMAGE **image_out) +{ + BITMAPFILEHEADER *header; + unsigned int w, h, bpp; + HANDLE file, mapping; + LARGE_INTEGER size; + D3DRMIMAGE *image; + BITMAPINFO *info; + LONGLONG rem; + HRESULT hr; + + if ((file = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE) + return D3DRMERR_BADOBJECT; + + mapping = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, NULL); + CloseHandle(file); + if (!mapping || mapping == INVALID_HANDLE_VALUE) + return D3DRMERR_BADVALUE; + + if (!GetFileSizeEx(mapping, &size)) + { + CloseHandle(mapping); + return D3DRMERR_BADVALUE; + } + rem = size.QuadPart; + + header = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0); + CloseHandle(mapping); + if (!header) + return D3DRMERR_BADVALUE; + + hr = D3DRMERR_BADALLOC; + if (!(image = heap_alloc_zero(sizeof(*image)))) + goto fail; + + hr = D3DRMERR_BADFILE; + if (rem < sizeof(*header) || header->bfType != 0x4d42 /* BM */) + goto fail; + rem -= sizeof(*header); + + info = (BITMAPINFO *)&header[1]; + /* Only allow version 1 DIB's (BITMAPINFOHEADER) to be loaded. */ + if (rem < sizeof(info->bmiHeader) || info->bmiHeader.biSize != sizeof(info->bmiHeader)) + goto fail; + rem -= sizeof(info->bmiHeader); + + w = info->bmiHeader.biWidth; + h = abs(info->bmiHeader.biHeight); + bpp = info->bmiHeader.biBitCount == 24 ? 32 : info->bmiHeader.biBitCount; + if (bpp != 8 && bpp != 32) + goto fail; + + image->width = w; + image->height = h; + image->aspectx = 1; + image->aspecty = 1; + if (bpp == 8) + { + rem -= 256 * sizeof(*info->bmiColors); + if (w > rem / h) + goto fail; + hr = d3drm_image_load_8(image, info->bmiColors, (unsigned char *)&info->bmiColors[256], rem, w, h, flip); + } + else + { + if (w > (rem / 3) / h) + goto fail; + hr = d3drm_image_load_32(image, (unsigned char *)&info->bmiColors, rem, w, h, flip); + } + if (FAILED(hr)) + goto fail; + + /* Use an internal destroy callback to destroy the image struct. */ + hr = IDirect3DRMObject_AddDestroyCallback(&texture->IDirect3DRMTexture3_iface, destroy_image_callback, image); + + *image_out = image; + + UnmapViewOfFile(header); + + return hr; + +fail: + heap_free(image); + UnmapViewOfFile(header); + + return hr; +} + static HRESULT WINAPI d3drm_texture1_QueryInterface(IDirect3DRMTexture *iface, REFIID riid, void **out) { struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); @@ -171,9 +455,16 @@ static HRESULT WINAPI d3drm_texture1_GetClassName(IDirect3DRMTexture *iface, DWO static HRESULT WINAPI d3drm_texture1_InitFromFile(IDirect3DRMTexture *iface, const char *filename) { - FIXME("iface %p, filename %s stub!\n", iface, debugstr_a(filename)); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture(iface); + D3DRMIMAGE *image; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, filename %s.\n", iface, debugstr_a(filename)); + + if (FAILED(hr = d3drm_texture_load(texture, filename, FALSE, &image))) + return hr; + + return IDirect3DRMTexture3_InitFromImage(&texture->IDirect3DRMTexture3_iface, image); } static HRESULT WINAPI d3drm_texture1_InitFromSurface(IDirect3DRMTexture *iface, @@ -473,9 +764,11 @@ static HRESULT WINAPI d3drm_texture2_GetClassName(IDirect3DRMTexture2 *iface, DW static HRESULT WINAPI d3drm_texture2_InitFromFile(IDirect3DRMTexture2 *iface, const char *filename) { - FIXME("iface %p, filename %s stub!\n", iface, debugstr_a(filename)); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture2(iface); - return E_NOTIMPL; + TRACE("iface %p, filename %s.\n", iface, debugstr_a(filename)); + + return IDirect3DRMTexture3_InitFromFile(&texture->IDirect3DRMTexture3_iface, filename); } static HRESULT WINAPI d3drm_texture2_InitFromSurface(IDirect3DRMTexture2 *iface, @@ -833,9 +1126,16 @@ static HRESULT WINAPI d3drm_texture3_GetClassName(IDirect3DRMTexture3 *iface, DW static HRESULT WINAPI d3drm_texture3_InitFromFile(IDirect3DRMTexture3 *iface, const char *filename) { - FIXME("iface %p, filename %s stub!\n", iface, debugstr_a(filename)); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + D3DRMIMAGE *image; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, filename %s.\n", iface, debugstr_a(filename)); + + if (FAILED(hr = d3drm_texture_load(texture, filename, TRUE, &image))) + return hr; + + return IDirect3DRMTexture3_InitFromImage(iface, image); } static HRESULT WINAPI d3drm_texture3_InitFromSurface(IDirect3DRMTexture3 *iface, diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 3a225d4992..c5b71b8082 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -25,7 +25,7 @@ reactos/dll/directx/wine/amstream # Synced to WineStaging-3.9 reactos/dll/directx/wine/d3d8 # Synced to WineStaging-3.9 reactos/dll/directx/wine/d3d9 # Synced to WineStaging-3.9 reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-4.0 -reactos/dll/directx/wine/d3drm # Synced to WineStaging-3.9 +reactos/dll/directx/wine/d3drm # Synced to WineStaging-4.0 reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to WineStaging-3.17 reactos/dll/directx/wine/d3dxof # Synced to WineStaging-3.17 reactos/dll/directx/wine/ddraw # Synced to WineStaging-3.9
6 years
1
0
0
0
[reactos] 01/01: [D3DCOMPILER_43] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6971090559bfb966ac3f9…
commit 6971090559bfb966ac3f9f5ea618bde1db01f1d9 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 25 13:08:25 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 25 13:08:25 2019 +0100 [D3DCOMPILER_43] Sync with Wine Staging 4.0. CORE-15682 --- dll/directx/wine/d3dcompiler_43/utils.c | 7 +++++-- media/doc/README.WINE | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dll/directx/wine/d3dcompiler_43/utils.c b/dll/directx/wine/d3dcompiler_43/utils.c index be0adbbf2c..95a1dbd3d5 100644 --- a/dll/directx/wine/d3dcompiler_43/utils.c +++ b/dll/directx/wine/d3dcompiler_43/utils.c @@ -2138,9 +2138,12 @@ static void debug_dump_ir_constructor(const struct hlsl_ir_constructor *construc static const char *debug_writemask(DWORD writemask) { - char string[5], components[] = {'x', 'y', 'z', 'w'}; + static const char components[] = {'x', 'y', 'z', 'w'}; + char string[5]; unsigned int i = 0, pos = 0; + assert(!(writemask & ~BWRITERSP_WRITEMASK_ALL)); + while (writemask) { if (writemask & 1) @@ -2176,7 +2179,7 @@ static void debug_dump_ir_swizzle(const struct hlsl_ir_swizzle *swizzle) } else { - char c[] = {'x', 'y', 'z', 'w'}; + static const char c[] = {'x', 'y', 'z', 'w'}; for (i = 0; i < swizzle->node.data_type->dimx; ++i) TRACE("%c", c[(swizzle->swizzle >> i * 2) & 0x3]); diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 9494440bff..3a225d4992 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -24,7 +24,7 @@ The following libraries are shared with Wine. reactos/dll/directx/wine/amstream # Synced to WineStaging-3.9 reactos/dll/directx/wine/d3d8 # Synced to WineStaging-3.9 reactos/dll/directx/wine/d3d9 # Synced to WineStaging-3.9 -reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-3.17 +reactos/dll/directx/wine/d3dcompiler_43 # Synced to WineStaging-4.0 reactos/dll/directx/wine/d3drm # Synced to WineStaging-3.9 reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to WineStaging-3.17 reactos/dll/directx/wine/d3dxof # Synced to WineStaging-3.17
6 years
1
0
0
0
[reactos] 01/01: [WINHLP32] Sync with Wine Staging 4.0. CORE-15682
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=05b6b556106bff2720147…
commit 05b6b556106bff27201477f79ffd0dcde47ce1c8 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Fri Jan 25 13:07:47 2019 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Fri Jan 25 13:07:47 2019 +0100 [WINHLP32] Sync with Wine Staging 4.0. CORE-15682 --- base/applications/winhlp32/CMakeLists.txt | 2 +- base/applications/winhlp32/macro.c | 2 +- base/applications/winhlp32/macro.lex.l | 14 +++++++++----- base/applications/winhlp32/macro.lex.yy.c | 21 +++++++++++---------- base/applications/winhlp32/macro.lex.yy.h | 5 +---- base/applications/winhlp32/winhelp.c | 13 ++++++------- media/doc/README.WINE | 2 +- 7 files changed, 30 insertions(+), 29 deletions(-) diff --git a/base/applications/winhlp32/CMakeLists.txt b/base/applications/winhlp32/CMakeLists.txt index aecb08cfd3..cb4ee2e72a 100644 --- a/base/applications/winhlp32/CMakeLists.txt +++ b/base/applications/winhlp32/CMakeLists.txt @@ -2,8 +2,8 @@ include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) add_definitions( + -D__WINESRC__ -D__ROS_LONG64__ - -D_CRT_NONSTDC_NO_DEPRECATE -Dfileno=_fileno -Disatty=_isatty) diff --git a/base/applications/winhlp32/macro.c b/base/applications/winhlp32/macro.c index 5a25d6c944..280e618236 100644 --- a/base/applications/winhlp32/macro.c +++ b/base/applications/winhlp32/macro.c @@ -154,7 +154,7 @@ void CALLBACK MACRO_About(void) WCHAR name[256]; HICON icon = LoadImageW( Globals.hInstance, MAKEINTRESOURCEW(IDI_WINHELP), IMAGE_ICON, 48, 48, LR_SHARED ); - LoadStringW( Globals.hInstance, STID_WINE_HELP, name, sizeof(name)/sizeof(WCHAR) ); + LoadStringW( Globals.hInstance, STID_WINE_HELP, name, ARRAY_SIZE( name )); ShellAboutW( MACRO_CurrentWindow()->hMainWnd, name, NULL, icon ); } diff --git a/base/applications/winhlp32/macro.lex.l b/base/applications/winhlp32/macro.lex.l index da2dd22e44..eab7a795af 100644 --- a/base/applications/winhlp32/macro.lex.l +++ b/base/applications/winhlp32/macro.lex.l @@ -20,7 +20,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ %} -%option noinput nounput never-interactive 8bit noyywrap +%option noinput nounput never-interactive 8bit %x quote %{ #include "config.h" @@ -75,7 +75,7 @@ struct lexret yylval; /* opening a new one */ if (lex_data->quote_stk_idx == 0) { - assert(lex_data->cache_used < sizeof(lex_data->cache_string) / sizeof(lex_data->cache_string[0])); + assert(lex_data->cache_used < ARRAY_SIZE(lex_data->cache_string)); lex_data->strptr = lex_data->cache_string[lex_data->cache_used] = HeapAlloc(GetProcessHeap(), 0, strlen(lex_data->macroptr) + 1); yylval.string = lex_data->strptr; lex_data->cache_used++; @@ -83,7 +83,7 @@ struct lexret yylval; } else *lex_data->strptr++ = yytext[0]; lex_data->quote_stack[lex_data->quote_stk_idx++] = yytext[0]; - assert(lex_data->quote_stk_idx < sizeof(lex_data->quote_stack) / sizeof(lex_data->quote_stack[0])); + assert(lex_data->quote_stk_idx < ARRAY_SIZE(lex_data->quote_stack)); } else { @@ -222,7 +222,7 @@ CheckArgs_end: static int MACRO_CallBoolFunc(void *fn, const char* args, void** ret) { void* pa[2]; - int idx = MACRO_CheckArgs(pa, sizeof(pa)/sizeof(pa[0]), args); + int idx = MACRO_CheckArgs(pa, ARRAY_SIZE(pa), args); if (idx < 0) return 0; if (!fn) return 1; @@ -257,7 +257,7 @@ static int MACRO_CallBoolFunc(void *fn, const char* args, void** ret) static int MACRO_CallVoidFunc(void *fn, const char* args) { void* pa[6]; - int idx = MACRO_CheckArgs(pa, sizeof(pa)/sizeof(pa[0]), args); + int idx = MACRO_CheckArgs(pa, ARRAY_SIZE(pa), args); if (idx < 0) return 0; if (!fn) return 1; @@ -367,3 +367,7 @@ WINHELP_WINDOW* MACRO_CurrentWindow(void) { return lex_data ? lex_data->window : Globals.active_win; } + +#ifndef yywrap +int yywrap(void) { return 1; } +#endif diff --git a/base/applications/winhlp32/macro.lex.yy.c b/base/applications/winhlp32/macro.lex.yy.c index 255bdb159a..ff4d78cfe6 100644 --- a/base/applications/winhlp32/macro.lex.yy.c +++ b/base/applications/winhlp32/macro.lex.yy.c @@ -333,9 +333,6 @@ void yyfree (void * ); /* Begin user sect3 */ -#define yywrap() 1 -#define YY_SKIP_YYWRAP - typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; @@ -528,7 +525,7 @@ struct lexret yylval; #define YY_INPUT(buf,result,max_size)\ if ((result = *lex_data->macroptr ? 1 : 0)) buf[0] = *lex_data->macroptr++; -#line 532 "macro.lex.yy.c" +#line 529 "macro.lex.yy.c" #define INITIAL 0 #define quote 1 @@ -712,7 +709,7 @@ YY_DECL #line 58 "macro.lex.l" -#line 716 "macro.lex.yy.c" +#line 713 "macro.lex.yy.c" if ( !(yy_init) ) { @@ -827,7 +824,7 @@ YY_RULE_SETUP /* opening a new one */ if (lex_data->quote_stk_idx == 0) { - assert(lex_data->cache_used < sizeof(lex_data->cache_string) / sizeof(lex_data->cache_string[0])); + assert(lex_data->cache_used < ARRAY_SIZE(lex_data->cache_string)); lex_data->strptr = lex_data->cache_string[lex_data->cache_used] = HeapAlloc(GetProcessHeap(), 0, strlen(lex_data->macroptr) + 1); yylval.string = lex_data->strptr; lex_data->cache_used++; @@ -835,7 +832,7 @@ YY_RULE_SETUP } else *lex_data->strptr++ = yytext[0]; lex_data->quote_stack[lex_data->quote_stk_idx++] = yytext[0]; - assert(lex_data->quote_stk_idx < sizeof(lex_data->quote_stack) / sizeof(lex_data->quote_stack[0])); + assert(lex_data->quote_stk_idx < ARRAY_SIZE(lex_data->quote_stack)); } else { @@ -880,7 +877,7 @@ YY_RULE_SETUP #line 108 "macro.lex.l" ECHO; YY_BREAK -#line 884 "macro.lex.yy.c" +#line 881 "macro.lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -1957,7 +1954,7 @@ CheckArgs_end: static int MACRO_CallBoolFunc(void *fn, const char* args, void** ret) { void* pa[2]; - int idx = MACRO_CheckArgs(pa, sizeof(pa)/sizeof(pa[0]), args); + int idx = MACRO_CheckArgs(pa, ARRAY_SIZE(pa), args); if (idx < 0) return 0; if (!fn) return 1; @@ -1992,7 +1989,7 @@ static int MACRO_CallBoolFunc(void *fn, const char* args, void** ret) static int MACRO_CallVoidFunc(void *fn, const char* args) { void* pa[6]; - int idx = MACRO_CheckArgs(pa, sizeof(pa)/sizeof(pa[0]), args); + int idx = MACRO_CheckArgs(pa, ARRAY_SIZE(pa), args); if (idx < 0) return 0; if (!fn) return 1; @@ -2103,3 +2100,7 @@ WINHELP_WINDOW* MACRO_CurrentWindow(void) return lex_data ? lex_data->window : Globals.active_win; } +#ifndef yywrap +int yywrap(void) { return 1; } +#endif + diff --git a/base/applications/winhlp32/macro.lex.yy.h b/base/applications/winhlp32/macro.lex.yy.h index 05147e869b..7b39b6c146 100644 --- a/base/applications/winhlp32/macro.lex.yy.h +++ b/base/applications/winhlp32/macro.lex.yy.h @@ -201,9 +201,6 @@ void yyfree (void * ); /* Begin user sect3 */ -#define yywrap() 1 -#define YY_SKIP_YYWRAP - extern int yylineno; extern char *yytext; @@ -318,6 +315,6 @@ extern int yylex (void); #line 107 "macro.lex.l" -#line 322 "macro.lex.yy.h" +#line 319 "macro.lex.yy.h" #undef yyIN_HEADER #endif /* yyHEADER_H */ diff --git a/base/applications/winhlp32/winhelp.c b/base/applications/winhlp32/winhelp.c index 2ac3d2ff24..7ce5d4a0a8 100644 --- a/base/applications/winhlp32/winhelp.c +++ b/base/applications/winhlp32/winhelp.c @@ -66,19 +66,18 @@ static void WINHELP_InitFonts(HWND hWnd) {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, {'H','e','l','v',0}}, {-10, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, {'H','e','l','v',0}}, { -8, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, {'H','e','l','v',0}}}; -#define FONTS_LEN (sizeof(logfontlist)/sizeof(*logfontlist)) - static HFONT fonts[FONTS_LEN]; + static HFONT fonts[ARRAY_SIZE(logfontlist)]; static BOOL init = FALSE; - win->fonts_len = FONTS_LEN; + win->fonts_len = ARRAY_SIZE(logfontlist); win->fonts = fonts; if (!init) { UINT i; - for (i = 0; i < FONTS_LEN; i++) + for (i = 0; i < ARRAY_SIZE(logfontlist); i++) { fonts[i] = CreateFontIndirectW(&logfontlist[i]); } @@ -595,7 +594,7 @@ static void WINHELP_RememberPage(WINHELP_WINDOW* win, WINHELP_WNDPAGE* wpage) if (!Globals.history.index || Globals.history.set[0].page != wpage->page) { - num = sizeof(Globals.history.set) / sizeof(Globals.history.set[0]); + num = ARRAY_SIZE(Globals.history.set); /* we're full, remove latest entry */ if (Globals.history.index == num) { @@ -610,7 +609,7 @@ static void WINHELP_RememberPage(WINHELP_WINDOW* win, WINHELP_WNDPAGE* wpage) } if (win->hHistoryWnd) InvalidateRect(win->hHistoryWnd, NULL, TRUE); - num = sizeof(win->back.set) / sizeof(win->back.set[0]); + num = ARRAY_SIZE(win->back.set); if (win->back.index == num) { /* we're full, remove latest entry */ @@ -1136,7 +1135,7 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara GetWindowRect(hWnd, &r); r.right = r.left + 30 * tm.tmAveCharWidth; - r.bottom = r.top + (sizeof(Globals.history.set) / sizeof(Globals.history.set[0])) * tm.tmHeight; + r.bottom = r.top + ARRAY_SIZE(Globals.history.set) * tm.tmHeight; AdjustWindowRect(&r, GetWindowLongW(hWnd, GWL_STYLE), FALSE); if (r.left < 0) {r.right -= r.left; r.left = 0;} if (r.top < 0) {r.bottom -= r.top; r.top = 0;} diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 05961c6c29..9494440bff 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -239,7 +239,7 @@ reactos/base/applications/extrac32 # Synced to WineStaging-4.0 reactos/base/applications/iexplore # Synced to WineStaging-3.3 reactos/base/applications/notepad # Forked at Wine-20041201 reactos/base/applications/regedit # Out of sync -reactos/base/applications/winhlp32 # Synced to WineStaging-3.3 +reactos/base/applications/winhlp32 # Synced to WineStaging-4.0 reactos/base/applications/wordpad # Synced to WineStaging-1.9.16 reactos/base/applications/write # Synced to WineStaging-3.3 reactos/base/services/rpcss # Synced to WineStaging-3.3
6 years
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
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