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
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
September 2018
----- 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
24 participants
223 discussions
Start a n
N
ew thread
01/01: [ATL100_WINETEST] Sync with Wine Staging 3.17. CORE-15127
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=814d42def77ce2121cf20…
commit 814d42def77ce2121cf203b77cd04bc7e9cf7dfb Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Oct 1 00:27:20 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Oct 1 00:27:20 2018 +0100 [ATL100_WINETEST] Sync with Wine Staging 3.17. CORE-15127 --- modules/rostests/winetests/atl100/atl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/rostests/winetests/atl100/atl.c b/modules/rostests/winetests/atl100/atl.c index a287e38e27..fc195cb85b 100644 --- a/modules/rostests/winetests/atl100/atl.c +++ b/modules/rostests/winetests/atl100/atl.c @@ -902,6 +902,7 @@ static void test_AtlAxAttachControl(void) hr = AtlAxAttachControl(control, hwnd, &container); ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08x\n", hr); ok(container != NULL, "Expected not NULL!\n"); + IUnknown_Release(container); val = GetWindowLongW(hwnd, GWLP_USERDATA); ok(val == 0xdeadbeef, "Expected unchanged, returned %08x\n", val); DestroyWindow(hwnd);
6 years, 2 months
1
0
0
0
01/01: [ATL] Sync with Wine Staging 3.17. CORE-15127
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=21d3faa2a61388cef1286…
commit 21d3faa2a61388cef1286d08a7b475c28a020599 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Oct 1 00:26:43 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Oct 1 00:26:43 2018 +0100 [ATL] Sync with Wine Staging 3.17. CORE-15127 --- dll/win32/atl/atl30.c | 2 +- dll/win32/atl/atl_ax.c | 2 +- dll/win32/atl/registrar.c | 4 ++-- media/doc/README.WINE | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dll/win32/atl/atl30.c b/dll/win32/atl/atl30.c index 674c1aac8d..dcdddd9632 100644 --- a/dll/win32/atl/atl30.c +++ b/dll/win32/atl/atl30.c @@ -374,7 +374,7 @@ ATOM WINAPI AtlModuleRegisterWndClassInfoW(_ATL_MODULEW *pm, _ATL_WNDCLASSINFOW if (!wci->m_wc.lpszClassName) { static const WCHAR szFormat[] = {'A','T','L','%','0','8','l','x',0}; - snprintfW(wci->m_szAutoName, sizeof(wci->m_szAutoName)/sizeof(WCHAR), szFormat, (UINT_PTR)wci); + snprintfW(wci->m_szAutoName, ARRAY_SIZE(wci->m_szAutoName), szFormat, (UINT_PTR)wci); TRACE("auto-generated class name %s\n", debugstr_w(wci->m_szAutoName)); wci->m_wc.lpszClassName = wci->m_szAutoName; } diff --git a/dll/win32/atl/atl_ax.c b/dll/win32/atl/atl_ax.c index 1765dcc689..28bec71fd9 100644 --- a/dll/win32/atl/atl_ax.c +++ b/dll/win32/atl/atl_ax.c @@ -1268,7 +1268,7 @@ static LPDLGTEMPLATEW AX_ConvertDialogTemplate(LPCDLGTEMPLATEW src_tmpl) if ( GET_WORD(tmp) == '{' ) /* all this mess created because of this line */ { static const WCHAR AtlAxWin[] = {'A','t','l','A','x','W','i','n', 0}; - PUT_BLOCK(AtlAxWin, sizeof(AtlAxWin)/sizeof(WCHAR)); + PUT_BLOCK(AtlAxWin, ARRAY_SIZE(AtlAxWin)); PUT_BLOCK(tmp, strlenW(tmp)+1); } else PUT_BLOCK(tmp, src-tmp); diff --git a/dll/win32/atl/registrar.c b/dll/win32/atl/registrar.c index 3d597ba217..d96bd34086 100644 --- a/dll/win32/atl/registrar.c +++ b/dll/win32/atl/registrar.c @@ -394,11 +394,11 @@ static HRESULT do_process_root_key(LPCOLESTR data, BOOL do_register) hres = DISP_E_EXCEPTION; break; } - for(i=0; i<sizeof(root_keys)/sizeof(root_keys[0]); i++) { + for(i=0; i<ARRAY_SIZE(root_keys); i++) { if(!lstrcmpiW(buf.str, root_keys[i].name)) break; } - if(i == sizeof(root_keys)/sizeof(root_keys[0])) { + if(i == ARRAY_SIZE(root_keys)) { WARN("Wrong root key name: %s\n", debugstr_w(buf.str)); hres = DISP_E_EXCEPTION; break; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 8f9944e010..c3651a9123 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-3.17 -reactos/dll/win32/atl # Synced to WineStaging-3.3 +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 reactos/dll/win32/avifil32 # Synced to WineStaging-3.9
6 years, 2 months
1
0
0
0
01/01: [ADVPACK_WINETEST] Sync with Wine Staging 3.17. CORE-15127
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d1060f20d659c090c9039…
commit d1060f20d659c090c903986bb5e62c375c777456 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Oct 1 00:26:09 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Oct 1 00:26:09 2018 +0100 [ADVPACK_WINETEST] Sync with Wine Staging 3.17. CORE-15127 --- modules/rostests/winetests/advpack/advpack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/rostests/winetests/advpack/advpack.c b/modules/rostests/winetests/advpack/advpack.c index d5958769ab..8d7c5ebb48 100644 --- a/modules/rostests/winetests/advpack/advpack.c +++ b/modules/rostests/winetests/advpack/advpack.c @@ -134,8 +134,8 @@ static void delnode_test(void) /* Native DelNode apparently does not support relative paths, so we use absolute paths for testing */ - currDirLen = GetCurrentDirectoryA(sizeof(currDir) / sizeof(CHAR), currDir); - assert(currDirLen > 0 && currDirLen < sizeof(currDir) / sizeof(CHAR)); + currDirLen = GetCurrentDirectoryA(ARRAY_SIZE(currDir), currDir); + assert(currDirLen > 0 && currDirLen < ARRAY_SIZE(currDir)); if(currDir[currDirLen - 1] == '\\') currDir[--currDirLen] = 0;
6 years, 2 months
1
0
0
0
01/01: [ADVPACK] Sync with Wine Staging 3.17. CORE-15127
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0df75d96480a1dc776500…
commit 0df75d96480a1dc776500e3d39c8514645506c2b Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Oct 1 00:25:34 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Oct 1 00:25:34 2018 +0100 [ADVPACK] Sync with Wine Staging 3.17. CORE-15127 --- dll/win32/advpack/advpack.c | 18 ++++++------------ dll/win32/advpack/install.c | 26 +++++++++----------------- dll/win32/advpack/reg.c | 6 +++--- media/doc/README.WINE | 2 +- 4 files changed, 19 insertions(+), 33 deletions(-) diff --git a/dll/win32/advpack/advpack.c b/dll/win32/advpack/advpack.c index d2ce60e3e2..2e8027f640 100644 --- a/dll/win32/advpack/advpack.c +++ b/dll/win32/advpack/advpack.c @@ -530,18 +530,12 @@ HRESULT WINAPI SetPerUserSecValuesA(PERUSERSECTIONA* pPerUser) if (!pPerUser) return E_INVALIDARG; - MultiByteToWideChar(CP_ACP, 0, pPerUser->szGUID, -1, perUserW.szGUID, - sizeof(perUserW.szGUID) / sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, pPerUser->szDispName, -1, perUserW.szDispName, - sizeof(perUserW.szDispName) / sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, pPerUser->szLocale, -1, perUserW.szLocale, - sizeof(perUserW.szLocale) / sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, pPerUser->szStub, -1, perUserW.szStub, - sizeof(perUserW.szStub) / sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, pPerUser->szVersion, -1, perUserW.szVersion, - sizeof(perUserW.szVersion) / sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, pPerUser->szCompID, -1, perUserW.szCompID, - sizeof(perUserW.szCompID) / sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, pPerUser->szGUID, -1, perUserW.szGUID, ARRAY_SIZE(perUserW.szGUID)); + MultiByteToWideChar(CP_ACP, 0, pPerUser->szDispName, -1, perUserW.szDispName, ARRAY_SIZE(perUserW.szDispName)); + MultiByteToWideChar(CP_ACP, 0, pPerUser->szLocale, -1, perUserW.szLocale, ARRAY_SIZE(perUserW.szLocale)); + MultiByteToWideChar(CP_ACP, 0, pPerUser->szStub, -1, perUserW.szStub, ARRAY_SIZE(perUserW.szStub)); + MultiByteToWideChar(CP_ACP, 0, pPerUser->szVersion, -1, perUserW.szVersion, ARRAY_SIZE(perUserW.szVersion)); + MultiByteToWideChar(CP_ACP, 0, pPerUser->szCompID, -1, perUserW.szCompID, ARRAY_SIZE(perUserW.szCompID)); perUserW.dwIsInstalled = pPerUser->dwIsInstalled; perUserW.bRollback = pPerUser->bRollback; diff --git a/dll/win32/advpack/install.c b/dll/win32/advpack/install.c index dcd1dd7b97..c3caf3ae7e 100644 --- a/dll/win32/advpack/install.c +++ b/dll/win32/advpack/install.c @@ -115,28 +115,22 @@ static HRESULT per_user_install_callback(HINF hinf, PCWSTR field, const void *ar per_user.bRollback = FALSE; per_user.dwIsInstalled = 0; - SetupGetLineTextW(NULL, hinf, field, disp_name, per_user.szDispName, - sizeof(per_user.szDispName) / sizeof(WCHAR), &size); + SetupGetLineTextW(NULL, hinf, field, disp_name, per_user.szDispName, ARRAY_SIZE(per_user.szDispName), &size); - SetupGetLineTextW(NULL, hinf, field, version, per_user.szVersion, - sizeof(per_user.szVersion) / sizeof(WCHAR), &size); + SetupGetLineTextW(NULL, hinf, field, version, per_user.szVersion, ARRAY_SIZE(per_user.szVersion), &size); if (SetupFindFirstLineW(hinf, field, is_installed, &context)) { SetupGetIntField(&context, 1, (PINT)&per_user.dwIsInstalled); } - SetupGetLineTextW(NULL, hinf, field, comp_id, per_user.szCompID, - sizeof(per_user.szCompID) / sizeof(WCHAR), &size); + SetupGetLineTextW(NULL, hinf, field, comp_id, per_user.szCompID, ARRAY_SIZE(per_user.szCompID), &size); - SetupGetLineTextW(NULL, hinf, field, guid, per_user.szGUID, - sizeof(per_user.szGUID) / sizeof(WCHAR), &size); + SetupGetLineTextW(NULL, hinf, field, guid, per_user.szGUID, ARRAY_SIZE(per_user.szGUID), &size); - SetupGetLineTextW(NULL, hinf, field, locale, per_user.szLocale, - sizeof(per_user.szLocale) / sizeof(WCHAR), &size); + SetupGetLineTextW(NULL, hinf, field, locale, per_user.szLocale, ARRAY_SIZE(per_user.szLocale), &size); - SetupGetLineTextW(NULL, hinf, field, stub_path, per_user.szStub, - sizeof(per_user.szStub) / sizeof(WCHAR), &size); + SetupGetLineTextW(NULL, hinf, field, stub_path, per_user.szStub, ARRAY_SIZE(per_user.szStub), &size); return SetPerUserSecValuesW(&per_user); } @@ -154,8 +148,7 @@ static HRESULT register_ocxs_callback(HINF hinf, PCWSTR field, const void *arg) WCHAR buffer[MAX_INF_STRING_LENGTH]; /* get OCX filename */ - if (!SetupGetStringFieldW(&context, 1, buffer, - sizeof(buffer) / sizeof(WCHAR), NULL)) + if (!SetupGetStringFieldW(&context, 1, buffer, ARRAY_SIZE(buffer), NULL)) continue; hm = LoadLibraryExW(buffer, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); @@ -273,7 +266,7 @@ static HRESULT iterate_section_fields(HINF hinf, PCWSTR section, PCWSTR key, { WCHAR static_buffer[200]; WCHAR *buffer = static_buffer; - DWORD size = sizeof(static_buffer) / sizeof(WCHAR); + DWORD size = ARRAY_SIZE(static_buffer); INFCONTEXT context; HRESULT hr = E_FAIL; @@ -645,8 +638,7 @@ HRESULT WINAPI ExecuteCabA(HWND hwnd, CABINFOA* pCab, LPVOID pReserved) RtlCreateUnicodeStringFromAsciiz(&inf, pCab->pszInf); RtlCreateUnicodeStringFromAsciiz(§ion, pCab->pszSection); - MultiByteToWideChar(CP_ACP, 0, pCab->szSrcPath, -1, cabinfo.szSrcPath, - sizeof(cabinfo.szSrcPath) / sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, pCab->szSrcPath, -1, cabinfo.szSrcPath, ARRAY_SIZE(cabinfo.szSrcPath)); cabinfo.pszInf = inf.Buffer; cabinfo.pszSection = section.Buffer; diff --git a/dll/win32/advpack/reg.c b/dll/win32/advpack/reg.c index 9a430159ec..fd0a199b00 100644 --- a/dll/win32/advpack/reg.c +++ b/dll/win32/advpack/reg.c @@ -44,7 +44,7 @@ static BOOL get_temp_ini_path(LPWSTR name) WCHAR tmp_dir[MAX_PATH]; WCHAR prefix[] = {'a','v','p',0}; - if(!GetTempPathW(sizeof(tmp_dir)/sizeof(WCHAR), tmp_dir)) + if(!GetTempPathW(ARRAY_SIZE(tmp_dir), tmp_dir)) return FALSE; if(!GetTempFileNameW(tmp_dir, prefix, 0, name)) @@ -177,14 +177,14 @@ static HRESULT write_predefined_strings(HMODULE hm, LPCWSTR ini_path) WCHAR sys_root[MAX_PATH]; *mod_path = '\"'; - if (!GetModuleFileNameW(hm, mod_path + 1, sizeof(mod_path) / sizeof(WCHAR) - 2)) + if (!GetModuleFileNameW(hm, mod_path + 1, ARRAY_SIZE(mod_path) - 2)) return E_FAIL; lstrcatW(mod_path, quote); WritePrivateProfileStringW(Strings, MOD_PATH, mod_path, ini_path); *sys_root = '\0'; - GetEnvironmentVariableW(SystemRoot, sys_root, sizeof(sys_root) / sizeof(WCHAR)); + GetEnvironmentVariableW(SystemRoot, sys_root, ARRAY_SIZE(sys_root)); if(!strncmpiW(sys_root, mod_path + 1, strlenW(sys_root))) { diff --git a/media/doc/README.WINE b/media/doc/README.WINE index e0f90c20dc..8f9944e010 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.3 +reactos/dll/win32/advpack # Synced to WineStaging-3.17 reactos/dll/win32/atl # Synced to WineStaging-3.3 reactos/dll/win32/atl80 # Synced to WineStaging-3.3 reactos/dll/win32/atl100 # Synced to WineStaging-3.3
6 years, 2 months
1
0
0
0
01/01: [QEDIT] Sync with Wine Staging 3.17. CORE-15127
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=698fd79dd2e52c41dd52e…
commit 698fd79dd2e52c41dd52ed727bbabfe0246554e0 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Oct 1 00:24:54 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Oct 1 00:24:54 2018 +0100 [QEDIT] Sync with Wine Staging 3.17. CORE-15127 --- dll/directx/wine/qedit/main.c | 4 ++-- media/doc/README.WINE | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dll/directx/wine/qedit/main.c b/dll/directx/wine/qedit/main.c index a012ff210c..a46f3f02e5 100644 --- a/dll/directx/wine/qedit/main.c +++ b/dll/directx/wine/qedit/main.c @@ -167,13 +167,13 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) && ! IsEqualGUID( &IID_IUnknown, riid) ) return E_NOINTERFACE; - for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++) + for (i = 0; i < ARRAY_SIZE(object_creation); i++) { if (IsEqualGUID(object_creation[i].clsid, rclsid)) break; } - if (i == sizeof(object_creation)/sizeof(object_creation[0])) + if (i == ARRAY_SIZE(object_creation)) { FIXME("%s: no class found.\n", debugstr_guid(rclsid)); return CLASS_E_CLASSNOTAVAILABLE; diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 5fb5472d3d..e0f90c20dc 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -38,7 +38,7 @@ reactos/dll/directx/wine/dplayx # Synced to WineStaging-3.17 reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29 reactos/dll/directx/wine/dxdiagn # Synced to WineStaging-3.3 reactos/dll/directx/wine/msdmo # Synced to WineStaging-3.17 -reactos/dll/directx/wine/qedit # Synced to WineStaging-3.3 +reactos/dll/directx/wine/qedit # Synced to WineStaging-3.17 reactos/dll/directx/wine/quartz # Synced to WineStaging-3.9 reactos/dll/directx/wine/wined3d # Synced to WineStaging-3.9
6 years, 2 months
1
0
0
0
01/01: [MSDMO] Sync with Wine Staging 3.17. CORE-15127
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=64c1a65258d21ac904925…
commit 64c1a65258d21ac9049255e7b718051c31e46afd Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Oct 1 00:24:18 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Oct 1 00:24:18 2018 +0100 [MSDMO] Sync with Wine Staging 3.17. CORE-15127 --- dll/directx/wine/msdmo/CMakeLists.txt | 2 +- dll/directx/wine/msdmo/dmoreg.c | 4 ++-- media/doc/README.WINE | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dll/directx/wine/msdmo/CMakeLists.txt b/dll/directx/wine/msdmo/CMakeLists.txt index 3a7637259e..43b7a8074a 100644 --- a/dll/directx/wine/msdmo/CMakeLists.txt +++ b/dll/directx/wine/msdmo/CMakeLists.txt @@ -1,7 +1,7 @@ add_definitions(-D__WINESRC__) include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) -spec2def(msdmo.dll msdmo.spec) +spec2def(msdmo.dll msdmo.spec ADD_IMPORTLIB) list(APPEND SOURCE dmoreg.c diff --git a/dll/directx/wine/msdmo/dmoreg.c b/dll/directx/wine/msdmo/dmoreg.c index 2161d40af6..864cb859e6 100644 --- a/dll/directx/wine/msdmo/dmoreg.c +++ b/dll/directx/wine/msdmo/dmoreg.c @@ -208,7 +208,7 @@ HRESULT WINAPI DMORegister( ret = RegCreateKeyExW(HKEY_CLASSES_ROOT, szDMORootKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hrkey, NULL); if (ret) - return HRESULT_FROM_WIN32(ret); + return E_FAIL; /* Create clsidDMO key under MediaObjects */ ret = RegCreateKeyExW(hrkey, GUIDToString(szguid, clsidDMO), 0, NULL, @@ -316,7 +316,7 @@ HRESULT WINAPI DMOUnregister(REFCLSID dmo, REFGUID category) /* remove from all categories */ if (IsEqualGUID(category, &GUID_NULL)) { - DWORD index = 0, len = sizeof(catW)/sizeof(WCHAR); + DWORD index = 0, len = ARRAY_SIZE(catW); while (!RegEnumKeyExW(categorieskey, index++, catW, &len, NULL, NULL, NULL, NULL)) hr = unregister_dmo_from_category(dmoW, catW, categorieskey); diff --git a/media/doc/README.WINE b/media/doc/README.WINE index b51b4082cc..5fb5472d3d 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -37,7 +37,7 @@ 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 reactos/dll/directx/wine/dxdiagn # Synced to WineStaging-3.3 -reactos/dll/directx/wine/msdmo # Synced to WineStaging-3.9 +reactos/dll/directx/wine/msdmo # Synced to WineStaging-3.17 reactos/dll/directx/wine/qedit # Synced to WineStaging-3.3 reactos/dll/directx/wine/quartz # Synced to WineStaging-3.9 reactos/dll/directx/wine/wined3d # Synced to WineStaging-3.9
6 years, 2 months
1
0
0
0
01/01: [DPLAYX_WINETEST] Sync with Wine Staging 3.17. CORE-15127
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ddfe5ce855c553aeddb33…
commit ddfe5ce855c553aeddb33b512a48ae67b4eff7dc Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Oct 1 00:23:40 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Oct 1 00:23:40 2018 +0100 [DPLAYX_WINETEST] Sync with Wine Staging 3.17. CORE-15127 --- modules/rostests/winetests/dplayx/dplayx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/rostests/winetests/dplayx/dplayx.c b/modules/rostests/winetests/dplayx/dplayx.c index c67d1b78e9..f5c30a9a06 100644 --- a/modules/rostests/winetests/dplayx/dplayx.c +++ b/modules/rostests/winetests/dplayx/dplayx.c @@ -767,7 +767,7 @@ static BOOL CALLBACK callback_providersA(GUID* guid, char *name, DWORD major, DW if (!prov) return TRUE; - if (prov->call_count < sizeof(prov->guid_data) / sizeof(prov->guid_data[0])) + if (prov->call_count < ARRAY_SIZE(prov->guid_data)) { prov->guid_ptr[prov->call_count] = guid; prov->guid_data[prov->call_count] = *guid; @@ -786,7 +786,7 @@ static BOOL CALLBACK callback_providersW(GUID* guid, WCHAR *name, DWORD major, D if (!prov) return TRUE; - if (prov->call_count < sizeof(prov->guid_data) / sizeof(prov->guid_data[0])) + if (prov->call_count < ARRAY_SIZE(prov->guid_data)) { prov->guid_ptr[prov->call_count] = guid; prov->guid_data[prov->call_count] = *guid; @@ -896,7 +896,7 @@ static BOOL CALLBACK EnumAddress_cb2( REFGUID guidDataType, { BOOL found = FALSE; int i; - for( i=0; i < sizeof(sps) / sizeof(sps[0]) && !found; i++ ) + for( i=0; i < ARRAY_SIZE(sps) && !found; i++ ) found = IsEqualGUID( sps[i], lpData ); ok( found, "Unknown Address type found %s\n", wine_dbgstr_guid(lpData) ); }
6 years, 2 months
1
0
0
0
01/01: [DPLAYX] Sync with Wine Staging 3.17. CORE-15127
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a8126f3f1e2e5a07e87aa…
commit a8126f3f1e2e5a07e87aa949816d78cc4378fece Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Oct 1 00:23:02 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Oct 1 00:23:02 2018 +0100 [DPLAYX] Sync with Wine Staging 3.17. CORE-15127 --- dll/directx/wine/dplayx/dplay.c | 12 ++++++------ dll/directx/wine/dplayx/dplayx_global.c | 4 ++-- dll/directx/wine/dplayx/dplobby.c | 6 +++--- media/doc/README.WINE | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dll/directx/wine/dplayx/dplay.c b/dll/directx/wine/dplayx/dplay.c index fde068138e..65c7e4df5d 100644 --- a/dll/directx/wine/dplayx/dplay.c +++ b/dll/directx/wine/dplayx/dplay.c @@ -4335,7 +4335,7 @@ static HRESULT WINAPI IDirectPlay4AImpl_EnumConnections( IDirectPlay4A *iface, RegCloseKey(hkServiceProvider); /* 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, &serviceProviderGUID ); /* FIXME: Have I got a memory leak on the serviceProviderGUID? */ @@ -4433,7 +4433,7 @@ static HRESULT WINAPI IDirectPlay4AImpl_EnumConnections( IDirectPlay4A *iface, RegCloseKey(hkServiceProvider); /* 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, &serviceProviderGUID ); /* FIXME: Have I got a memory leak on the serviceProviderGUID? */ @@ -4682,7 +4682,7 @@ static HMODULE DP_LoadSP( LPCGUID lpcGuid, LPSPINITDATA lpSpData, LPBOOL lpbIsDp } /* 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, &serviceProviderGUID ); /* FIXME: Have I got a memory leak on the serviceProviderGUID? */ @@ -5811,7 +5811,7 @@ static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, dwIndex = 0; do { - sizeOfSubKeyName = sizeof(subKeyName) / sizeof(WCHAR); + sizeOfSubKeyName = ARRAY_SIZE(subKeyName); ret_value = RegEnumKeyW(hkResult, dwIndex, subKeyName, sizeOfSubKeyName); dwIndex++; } @@ -5836,8 +5836,8 @@ static HRESULT DirectPlayEnumerateAW(LPDPENUMDPCALLBACKA lpEnumCallbackA, HKEY hkServiceProvider; WCHAR guidKeyContent[(2 * 16) + 1 + 6 /* This corresponds to '{....-..-..-..-......}' */ ]; DWORD sizeOfGuidKeyContent = sizeof(guidKeyContent); - - sizeOfSubKeyName = sizeof(subKeyName) / sizeof(WCHAR); + + sizeOfSubKeyName = ARRAY_SIZE(subKeyName); ret_value = RegEnumKeyExW(hkResult, dwIndex, subKeyName, &sizeOfSubKeyName, NULL, NULL, NULL, &filetime); if (ret_value == ERROR_NO_MORE_ITEMS) diff --git a/dll/directx/wine/dplayx/dplayx_global.c b/dll/directx/wine/dplayx/dplayx_global.c index 14c53a0c8d..bc087c8b33 100644 --- a/dll/directx/wine/dplayx/dplayx_global.c +++ b/dll/directx/wine/dplayx/dplayx_global.c @@ -120,9 +120,9 @@ static LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size ) /* Find blank area */ uBlockUsed = 0; - while( lpMemArea[ uBlockUsed ].used && uBlockUsed <= dwMaxBlock ) { uBlockUsed++; } + while( uBlockUsed < dwMaxBlock && lpMemArea[ uBlockUsed ].used ) { uBlockUsed++; } - if( uBlockUsed <= dwMaxBlock ) + if( uBlockUsed < dwMaxBlock ) { /* Set the area used */ lpMemArea[ uBlockUsed ].used = TRUE; diff --git a/dll/directx/wine/dplayx/dplobby.c b/dll/directx/wine/dplayx/dplobby.c index 944fea9ec6..30d76aa16d 100644 --- a/dll/directx/wine/dplayx/dplobby.c +++ b/dll/directx/wine/dplayx/dplobby.c @@ -782,7 +782,7 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumAddressTypes( IDirectPlayLobby3 } /* 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, &serviceProviderGUID ); /* FIXME: Have I got a memory leak on the serviceProviderGUID? */ @@ -809,7 +809,7 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumAddressTypes( IDirectPlayLobby3 TRACE( "Found Address Type GUID %s\n", atSubKey ); /* FIXME: Check return types to ensure we're interpreting data right */ - MultiByteToWideChar( CP_ACP, 0, atSubKey, -1, buff, sizeof(buff)/sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, atSubKey, -1, buff, ARRAY_SIZE( buff )); CLSIDFromString( buff, &serviceProviderGUID ); /* FIXME: Have I got a memory leak on the serviceProviderGUID? */ @@ -950,7 +950,7 @@ static HRESULT WINAPI IDirectPlayLobby3AImpl_EnumLocalApplications( IDirectPlayL } /* 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, &serviceProviderGUID ); /* FIXME: Have I got a memory leak on the serviceProviderGUID? */ diff --git a/media/doc/README.WINE b/media/doc/README.WINE index a0bda6e3b5..b51b4082cc 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -34,7 +34,7 @@ reactos/dll/directx/wine/dinput # Synced to WineStaging-3.17 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 -reactos/dll/directx/wine/dplayx # 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 reactos/dll/directx/wine/dxdiagn # Synced to WineStaging-3.3 reactos/dll/directx/wine/msdmo # Synced to WineStaging-3.9
6 years, 2 months
1
0
0
0
01/01: [DMUSIC] Sync with Wine Staging 3.17. CORE-15127
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a16afc25c96cc1681fb4b…
commit a16afc25c96cc1681fb4bfced5f26e585e701064 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Oct 1 00:22:26 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Oct 1 00:22:26 2018 +0100 [DMUSIC] Sync with Wine Staging 3.17. CORE-15127 --- dll/directx/wine/dmusic/collection.c | 208 ++---------------------- dll/directx/wine/dmusic/dmobject.c | 214 ++++++++++++++++++++++++ dll/directx/wine/dmusic/dmobject.h | 53 ++++++ dll/directx/wine/dmusic/port.c | 307 ++++++++++++++++++++++++++++++++++- media/doc/README.WINE | 2 +- 5 files changed, 585 insertions(+), 199 deletions(-) diff --git a/dll/directx/wine/dmusic/collection.c b/dll/directx/wine/dmusic/collection.c index ec9914faa1..28202228bc 100644 --- a/dll/directx/wine/dmusic/collection.c +++ b/dll/directx/wine/dmusic/collection.c @@ -176,210 +176,34 @@ static const IDirectMusicCollectionVtbl DirectMusicCollection_Collection_Vtbl = }; /* IDirectMusicCollectionImpl IDirectMusicObject part: */ -static HRESULT read_from_stream(IStream *stream, void *data, ULONG size) -{ - ULONG read; - HRESULT hr; - - hr = IStream_Read(stream, data, size, &read); - if (FAILED(hr)) { - TRACE("IStream_Read failed: %08x\n", hr); - return hr; - } - if (read < size) { - TRACE("Didn't read full chunk: %u < %u\n", read, size); - return E_FAIL; - } - - return S_OK; -} - -static HRESULT WINAPI IDirectMusicObjectImpl_ParseDescriptor(IDirectMusicObject *iface, +static HRESULT WINAPI col_IDirectMusicObject_ParseDescriptor(IDirectMusicObject *iface, IStream *stream, DMUS_OBJECTDESC *desc) { - struct dmobject *This = impl_from_IDirectMusicObject(iface); - DMUS_PRIVATE_CHUNK chunk; - DWORD StreamSize, StreamCount, ListSize[1], ListCount[1]; - LARGE_INTEGER liMove; /* used when skipping chunks */ + struct chunk_entry riff = {0}; HRESULT hr; - TRACE("(%p)->(%p, %p)\n", This, stream, desc); + TRACE("(%p, %p, %p)\n", iface, stream, desc); - /* FIXME: should this be determined from stream? */ - desc->dwValidData |= DMUS_OBJ_CLASS; - desc->guidClass = This->desc.guidClass; + if (!stream || !desc) + return E_POINTER; - hr = read_from_stream(stream, &chunk, sizeof(FOURCC) + sizeof(DWORD)); - if (FAILED(hr)) + if ((hr = stream_get_chunk(stream, &riff)) != S_OK) return hr; - TRACE_(dmfile)(": %s chunk (size = 0x%04x)", debugstr_fourcc(chunk.fccID), chunk.dwSize); - - if (chunk.fccID != FOURCC_RIFF) { - TRACE_(dmfile)(": unexpected chunk; loading failed)\n"); - liMove.QuadPart = chunk.dwSize; - IStream_Seek(stream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */ - return DMUS_E_INVALIDFILE; + if (riff.id != FOURCC_RIFF || riff.type != FOURCC_DLS) { + TRACE("loading failed: unexpected %s\n", debugstr_chunk(&riff)); + stream_skip_chunk(stream, &riff); + return DMUS_E_NOTADLSCOL; } - hr = read_from_stream(stream, &chunk.fccID, sizeof(FOURCC)); + hr = dmobj_parsedescriptor(stream, &riff, desc, DMUS_OBJ_NAME_INFO|DMUS_OBJ_VERSION); if (FAILED(hr)) return hr; - TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(chunk.fccID)); - StreamSize = chunk.dwSize - sizeof(FOURCC); - - if (chunk.fccID != FOURCC_DLS) { - TRACE_(dmfile)(": unexpected chunk; loading failed)\n"); - liMove.QuadPart = StreamSize; - IStream_Seek(stream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */ - return E_FAIL; - } - - StreamCount = 0; - TRACE_(dmfile)(": collection form\n"); - - do { - hr = read_from_stream(stream, &chunk, sizeof(FOURCC) + sizeof(DWORD)); - if (FAILED(hr)) - return hr; - StreamCount += sizeof(FOURCC) + sizeof(DWORD) + chunk.dwSize; - TRACE_(dmfile)(": %s chunk (size = 0x%04x)", debugstr_fourcc(chunk.fccID), chunk.dwSize); - switch (chunk.fccID) { - case FOURCC_DLID: - TRACE_(dmfile)(": GUID chunk\n"); - desc->dwValidData |= DMUS_OBJ_OBJECT; - hr = read_from_stream(stream, &desc->guidObject, chunk.dwSize); - if (FAILED(hr)) - return hr; - break; - - case DMUS_FOURCC_VERSION_CHUNK: - TRACE_(dmfile)(": version chunk\n"); - desc->dwValidData |= DMUS_OBJ_VERSION; - hr = read_from_stream(stream, &desc->vVersion, chunk.dwSize); - if (FAILED(hr)) - return hr; - break; - - case DMUS_FOURCC_CATEGORY_CHUNK: - TRACE_(dmfile)(": category chunk\n"); - desc->dwValidData |= DMUS_OBJ_CATEGORY; - hr = read_from_stream(stream, desc->wszCategory, chunk.dwSize); - if (FAILED(hr)) - return hr; - break; - - case FOURCC_LIST: - hr = read_from_stream(stream, &chunk.fccID, sizeof(FOURCC)); - if (FAILED(hr)) - return hr; - TRACE_(dmfile)(": LIST chunk of type %s", debugstr_fourcc(chunk.fccID)); - ListSize[0] = chunk.dwSize - sizeof(FOURCC); - ListCount[0] = 0; - switch (chunk.fccID) { - /* pure INFO list, such can be found in dls collections */ - case DMUS_FOURCC_INFO_LIST: - TRACE_(dmfile)(": INFO list\n"); - do { - hr = read_from_stream(stream, &chunk, sizeof(FOURCC) + sizeof(DWORD)); - if (FAILED(hr)) - return hr; - ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + chunk.dwSize; - TRACE_(dmfile)(": %s chunk (size = 0x%04x)", debugstr_fourcc(chunk.fccID), chunk.dwSize); - switch (chunk.fccID) { - case mmioFOURCC('I','N','A','M'): { - CHAR szName[DMUS_MAX_NAME]; - TRACE_(dmfile)(": name chunk\n"); - desc->dwValidData |= DMUS_OBJ_NAME; - hr = read_from_stream(stream, szName, chunk.dwSize); - if (FAILED(hr)) - return hr; - MultiByteToWideChar (CP_ACP, 0, szName, -1, desc->wszName, DMUS_MAX_NAME); - if (even_or_odd(chunk.dwSize)) { - ListCount[0]++; - liMove.QuadPart = 1; - IStream_Seek(stream, liMove, STREAM_SEEK_CUR, NULL); - } - break; - } - - case mmioFOURCC('I','A','R','T'): - TRACE_(dmfile)(": artist chunk (ignored)\n"); - if (even_or_odd(chunk.dwSize)) { - ListCount[0]++; - chunk.dwSize++; - } - liMove.QuadPart = chunk.dwSize; - IStream_Seek(stream, liMove, STREAM_SEEK_CUR, NULL); - break; - - case mmioFOURCC('I','C','O','P'): - TRACE_(dmfile)(": copyright chunk (ignored)\n"); - if (even_or_odd(chunk.dwSize)) { - ListCount[0]++; - chunk.dwSize++; - } - liMove.QuadPart = chunk.dwSize; - IStream_Seek(stream, liMove, STREAM_SEEK_CUR, NULL); - break; - - case mmioFOURCC('I','S','B','J'): - TRACE_(dmfile)(": subject chunk (ignored)\n"); - if (even_or_odd(chunk.dwSize)) { - ListCount[0]++; - chunk.dwSize++; - } - liMove.QuadPart = chunk.dwSize; - IStream_Seek(stream, liMove, STREAM_SEEK_CUR, NULL); - break; - case mmioFOURCC('I','C','M','T'): - TRACE_(dmfile)(": comment chunk (ignored)\n"); - if (even_or_odd(chunk.dwSize)) { - ListCount[0]++; - chunk.dwSize++; - liMove.QuadPart = chunk.dwSize; - IStream_Seek(stream, liMove, STREAM_SEEK_CUR, NULL); - break; - } - - default: - TRACE_(dmfile)(": unknown chunk (irrelevant & skipping)\n"); - if (even_or_odd(chunk.dwSize)) { - ListCount[0] ++; - chunk.dwSize++; - } - liMove.QuadPart = chunk.dwSize; - IStream_Seek(stream, liMove, STREAM_SEEK_CUR, NULL); - break; - } - TRACE_(dmfile)(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]); - } while (ListCount[0] < ListSize[0]); - break; - - default: - TRACE_(dmfile)(": unknown (skipping)\n"); - liMove.QuadPart = chunk.dwSize - sizeof(FOURCC); - IStream_Seek(stream, liMove, STREAM_SEEK_CUR, NULL); - break; - } - break; - - default: - TRACE_(dmfile)(": unknown chunk (irrelevant & skipping)\n"); - liMove.QuadPart = chunk.dwSize; - IStream_Seek(stream, liMove, STREAM_SEEK_CUR, NULL); - break; - } - TRACE_(dmfile)(": StreamCount[0] = %d < StreamSize[0] = %d\n", StreamCount, StreamSize); - } while (StreamCount < StreamSize); - - TRACE_(dmfile)(": reading finished\n"); - - if (TRACE_ON(dmusic)) { - TRACE("Returning descriptor:\n"); - dump_DMUS_OBJECTDESC(desc); - } + desc->guidClass = CLSID_DirectMusicCollection; + desc->dwValidData |= DMUS_OBJ_CLASS; + TRACE("returning descriptor:\n"); + dump_DMUS_OBJECTDESC(desc); return S_OK; } @@ -389,7 +213,7 @@ static const IDirectMusicObjectVtbl dmobject_vtbl = { dmobj_IDirectMusicObject_Release, dmobj_IDirectMusicObject_GetDescriptor, dmobj_IDirectMusicObject_SetDescriptor, - IDirectMusicObjectImpl_ParseDescriptor + col_IDirectMusicObject_ParseDescriptor }; /* IDirectMusicCollectionImpl IPersistStream part: */ diff --git a/dll/directx/wine/dmusic/dmobject.c b/dll/directx/wine/dmusic/dmobject.c index cabb6f74db..0a00fbc7e3 100644 --- a/dll/directx/wine/dmusic/dmobject.c +++ b/dll/directx/wine/dmusic/dmobject.c @@ -21,12 +21,154 @@ */ #define COBJMACROS +#include <assert.h> #include "objbase.h" #include "dmusici.h" +#include "dmusicf.h" #include "dmobject.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(dmobj); +WINE_DECLARE_DEBUG_CHANNEL(dmfile); + +/* RIFF format parsing */ +#define CHUNK_HDR_SIZE (sizeof(FOURCC) + sizeof(DWORD)) + +#ifndef __REACTOS__ +static inline const char *debugstr_fourcc(DWORD fourcc) +{ + if (!fourcc) return "''"; + return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8), + (char)(fourcc >> 16), (char)(fourcc >> 24)); +} +#endif + +const char *debugstr_chunk(const struct chunk_entry *chunk) +{ + const char *type = ""; + + if (!chunk) + return "(null)"; + if (chunk->id == FOURCC_RIFF || chunk->id == FOURCC_LIST) + type = wine_dbg_sprintf("type %s, ", debugstr_fourcc(chunk->type)); + return wine_dbg_sprintf("%s chunk, %ssize %u", debugstr_fourcc(chunk->id), type, chunk->size); +} + +static HRESULT stream_read(IStream *stream, void *data, ULONG size) +{ + ULONG read; + HRESULT hr; + + hr = IStream_Read(stream, data, size, &read); + if (FAILED(hr)) + TRACE_(dmfile)("IStream_Read failed: %08x\n", hr); + else if (!read && read < size) { + /* All or nothing: Handle a partial read due to end of stream as an error */ + TRACE_(dmfile)("Short read: %u < %u\n", read, size); + return E_FAIL; + } + + return hr; +} + +HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk) +{ + static const LARGE_INTEGER zero; + ULONGLONG ck_end = 0, p_end = 0; + HRESULT hr; + + hr = IStream_Seek(stream, zero, STREAM_SEEK_CUR, &chunk->offset); + if (FAILED(hr)) + return hr; + assert(!(chunk->offset.QuadPart & 1)); + if (chunk->parent) { + p_end = chunk->parent->offset.QuadPart + CHUNK_HDR_SIZE + ((chunk->parent->size + 1) & ~1); + if (chunk->offset.QuadPart == p_end) + return S_FALSE; + ck_end = chunk->offset.QuadPart + CHUNK_HDR_SIZE; + if (ck_end > p_end) { + WARN_(dmfile)("No space for sub-chunk header in parent chunk: ends at offset %s > %s\n", + wine_dbgstr_longlong(ck_end), wine_dbgstr_longlong(p_end)); + return E_FAIL; + } + } + + hr = stream_read(stream, chunk, CHUNK_HDR_SIZE); + if (hr != S_OK) + return hr; + if (chunk->parent) { + ck_end += (chunk->size + 1) & ~1; + if (ck_end > p_end) { + WARN_(dmfile)("No space for sub-chunk data in parent chunk: ends at offset %s > %s\n", + wine_dbgstr_longlong(ck_end), wine_dbgstr_longlong(p_end)); + return E_FAIL; + } + } + + if (chunk->id == FOURCC_LIST || chunk->id == FOURCC_RIFF) { + hr = stream_read(stream, &chunk->type, sizeof(FOURCC)); + if (hr != S_OK) + return hr != S_FALSE ? hr : E_FAIL; + } + + TRACE_(dmfile)("Returning %s\n", debugstr_chunk(chunk)); + + return S_OK; +} + +HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk) +{ + LARGE_INTEGER end; + + end.QuadPart = (chunk->offset.QuadPart + CHUNK_HDR_SIZE + chunk->size + 1) & ~(ULONGLONG)1; + + return IStream_Seek(stream, end, STREAM_SEEK_SET, NULL); +} + +HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk) +{ + HRESULT hr; + + if (chunk->id) { + hr = stream_skip_chunk(stream, chunk); + if (FAILED(hr)) + return hr; + } + + return stream_get_chunk(stream, chunk); +} + +HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data, + ULONG size) +{ + if (chunk->size != size) { + WARN_(dmfile)("Chunk %s (size %u, offset %s) doesn't contains the expected data size %u\n", + debugstr_fourcc(chunk->id), chunk->size, + wine_dbgstr_longlong(chunk->offset.QuadPart), size); + return E_FAIL; + } + return stream_read(stream, data, size); +} + +HRESULT stream_chunk_get_wstr(IStream *stream, const struct chunk_entry *chunk, WCHAR *str, + ULONG size) +{ + ULONG len; + HRESULT hr; + + hr = IStream_Read(stream, str, min(chunk->size, size), &len); + if (FAILED(hr)) + return hr; + + /* Don't assume the string is properly zero terminated */ + str[min(len, size - 1)] = 0; + + if (len < chunk->size) + return S_FALSE; + return S_OK; +} + + /* Generic IDirectMusicObject methods */ static inline struct dmobject *impl_from_IDirectMusicObject(IDirectMusicObject *iface) @@ -110,6 +252,78 @@ HRESULT WINAPI dmobj_IDirectMusicObject_SetDescriptor(IDirectMusicObject *iface, return ret; } +/* Helper for IDirectMusicObject::ParseDescriptor */ +static inline void info_get_name(IStream *stream, const struct chunk_entry *info, + DMUS_OBJECTDESC *desc) +{ + struct chunk_entry chunk = {.parent = info}; + char name[DMUS_MAX_NAME]; + ULONG len; + HRESULT hr = E_FAIL; + + while (stream_next_chunk(stream, &chunk) == S_OK) + if (chunk.id == mmioFOURCC('I','N','A','M')) + hr = IStream_Read(stream, name, min(chunk.size, sizeof(name)), &len); + + if (SUCCEEDED(hr)) { + len = MultiByteToWideChar(CP_ACP, 0, name, len, desc->wszName, sizeof(desc->wszName)); + desc->wszName[min(len, sizeof(desc->wszName) - 1)] = 0; + desc->dwValidData |= DMUS_OBJ_NAME; + } +} + +static inline void unfo_get_name(IStream *stream, const struct chunk_entry *unfo, + DMUS_OBJECTDESC *desc, BOOL inam) +{ + struct chunk_entry chunk = {.parent = unfo}; + + while (stream_next_chunk(stream, &chunk) == S_OK) + if (chunk.id == DMUS_FOURCC_UNAM_CHUNK || (inam && chunk.id == mmioFOURCC('I','N','A','M'))) + if (stream_chunk_get_wstr(stream, &chunk, desc->wszName, sizeof(desc->wszName)) == S_OK) + desc->dwValidData |= DMUS_OBJ_NAME; +} + +HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff, + DMUS_OBJECTDESC *desc, DWORD supported) +{ + struct chunk_entry chunk = {.parent = riff}; + HRESULT hr; + + TRACE("Looking for %#x in %p: %s\n", supported, stream, debugstr_chunk(riff)); + + desc->dwValidData = 0; + desc->dwSize = sizeof(*desc); + + while ((hr = stream_next_chunk(stream, &chunk)) == S_OK) { + switch (chunk.id) { + case DMUS_FOURCC_GUID_CHUNK: + if ((supported & DMUS_OBJ_OBJECT) && stream_chunk_get_data(stream, &chunk, + &desc->guidObject, sizeof(desc->guidObject)) == S_OK) + desc->dwValidData |= DMUS_OBJ_OBJECT; + break; + case DMUS_FOURCC_CATEGORY_CHUNK: + if ((supported & DMUS_OBJ_CATEGORY) && stream_chunk_get_wstr(stream, &chunk, + desc->wszCategory, sizeof(desc->wszCategory)) == S_OK) + desc->dwValidData |= DMUS_OBJ_CATEGORY; + break; + case DMUS_FOURCC_VERSION_CHUNK: + if ((supported & DMUS_OBJ_VERSION) && stream_chunk_get_data(stream, &chunk, + &desc->vVersion, sizeof(desc->vVersion)) == S_OK) + desc->dwValidData |= DMUS_OBJ_VERSION; + break; + case FOURCC_LIST: + if (chunk.type == DMUS_FOURCC_UNFO_LIST && (supported & DMUS_OBJ_NAME)) + unfo_get_name(stream, &chunk, desc, supported & DMUS_OBJ_NAME_INAM); + else if (chunk.type == DMUS_FOURCC_INFO_LIST && (supported & DMUS_OBJ_NAME_INFO)) + info_get_name(stream, &chunk, desc); + break; + } + } + TRACE("Found %#x\n", desc->dwValidData); + + return hr; +} + /* Generic IPersistStream methods */ static inline struct dmobject *impl_from_IPersistStream(IPersistStream *iface) { diff --git a/dll/directx/wine/dmusic/dmobject.h b/dll/directx/wine/dmusic/dmobject.h index 5fc9918015..e7b95b7fde 100644 --- a/dll/directx/wine/dmusic/dmobject.h +++ b/dll/directx/wine/dmusic/dmobject.h @@ -21,6 +21,51 @@ #pragma once +#include "wine/debug.h" + +/* RIFF stream parsing */ +struct chunk_entry; +struct chunk_entry { + FOURCC id; + DWORD size; + FOURCC type; /* valid only for LIST and RIFF chunks */ + ULARGE_INTEGER offset; /* chunk offset from start of stream */ + const struct chunk_entry *parent; /* enclosing RIFF or LIST chunk */ +}; + +HRESULT stream_get_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN; +HRESULT stream_next_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN; +HRESULT stream_skip_chunk(IStream *stream, struct chunk_entry *chunk) DECLSPEC_HIDDEN; + +HRESULT stream_chunk_get_data(IStream *stream, const struct chunk_entry *chunk, void *data, + ULONG size) DECLSPEC_HIDDEN; +HRESULT stream_chunk_get_wstr(IStream *stream, const struct chunk_entry *chunk, WCHAR *str, + ULONG size) DECLSPEC_HIDDEN; + +static inline HRESULT stream_reset_chunk_data(IStream *stream, const struct chunk_entry *chunk) +{ + LARGE_INTEGER offset; + + offset.QuadPart = chunk->offset.QuadPart + sizeof(FOURCC) + sizeof(DWORD); + if (chunk->id == FOURCC_RIFF || chunk->id == FOURCC_LIST) + offset.QuadPart += sizeof(FOURCC); + + return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL); +} + +static inline HRESULT stream_reset_chunk_start(IStream *stream, const struct chunk_entry *chunk) +{ + LARGE_INTEGER offset; + + offset.QuadPart = chunk->offset.QuadPart; + + return IStream_Seek(stream, offset, STREAM_SEEK_SET, NULL); +} + +const char *debugstr_chunk(const struct chunk_entry *chunk) DECLSPEC_HIDDEN; + + +/* IDirectMusicObject base object */ struct dmobject { IDirectMusicObject IDirectMusicObject_iface; IPersistStream IPersistStream_iface; @@ -40,6 +85,14 @@ HRESULT WINAPI dmobj_IDirectMusicObject_GetDescriptor(IDirectMusicObject *iface, HRESULT WINAPI dmobj_IDirectMusicObject_SetDescriptor(IDirectMusicObject *iface, DMUS_OBJECTDESC *desc) DECLSPEC_HIDDEN; +/* Helper for IDirectMusicObject::ParseDescriptor */ +HRESULT dmobj_parsedescriptor(IStream *stream, const struct chunk_entry *riff, + DMUS_OBJECTDESC *desc, DWORD supported) DECLSPEC_HIDDEN; +/* Additional supported flags for dmobj_parsedescriptor. + DMUS_OBJ_NAME is 'UNAM' chunk in UNFO list */ +#define DMUS_OBJ_NAME_INAM 0x1000 /* 'INAM' chunk in UNFO list */ +#define DMUS_OBJ_NAME_INFO 0x2000 /* 'INAM' chunk in INFO list */ + /* Generic IPersistStream methods */ HRESULT WINAPI dmobj_IPersistStream_QueryInterface(IPersistStream *iface, REFIID riid, void **ret_iface) DECLSPEC_HIDDEN; diff --git a/dll/directx/wine/dmusic/port.c b/dll/directx/wine/dmusic/port.c index 713175650b..91913a716f 100644 --- a/dll/directx/wine/dmusic/port.c +++ b/dll/directx/wine/dmusic/port.c @@ -21,6 +21,7 @@ #include <assert.h> #include "dmusic_private.h" +#include "wine/heap.h" WINE_DEFAULT_DEBUG_CHANNEL(dmusic); @@ -903,18 +904,312 @@ HRESULT synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_param return hr; } -HRESULT midi_out_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, - DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) +struct midi_port { + IDirectMusicPort IDirectMusicPort_iface; + IDirectMusicThru IDirectMusicThru_iface; + LONG ref; + IReferenceClock *clock; +}; + +static inline struct midi_port *impl_from_IDirectMusicPort(IDirectMusicPort *iface) +{ + return CONTAINING_RECORD(iface, struct midi_port, IDirectMusicPort_iface); +} + +static HRESULT WINAPI midi_IDirectMusicPort_QueryInterface(IDirectMusicPort *iface, REFIID riid, + void **ret_iface) +{ + struct midi_port *This = impl_from_IDirectMusicPort(iface); + + TRACE("(%p, %s, %p)\n", iface, debugstr_dmguid(riid), ret_iface); + + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDirectMusicPort)) + *ret_iface = iface; + else if (IsEqualIID(riid, &IID_IDirectMusicThru)) + *ret_iface = &This->IDirectMusicThru_iface; + else { + WARN("no interface for %s\n", debugstr_dmguid(riid)); + *ret_iface = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown *)*ret_iface); + + return S_OK; +} + +static ULONG WINAPI midi_IDirectMusicPort_AddRef(IDirectMusicPort *iface) +{ + struct midi_port *This = impl_from_IDirectMusicPort(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref = %u\n", iface, ref); + + return ref; +} + +static ULONG WINAPI midi_IDirectMusicPort_Release(IDirectMusicPort *iface) +{ + struct midi_port *This = impl_from_IDirectMusicPort(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref = %u\n", iface, ref); + + if (!ref) { + if (This->clock) + IReferenceClock_Release(This->clock); + heap_free(This); + } + + return ref; +} + +static HRESULT WINAPI midi_IDirectMusicPort_PlayBuffer(IDirectMusicPort *iface, + IDirectMusicBuffer *buffer) { - FIXME("(%p, %p, %p): stub\n", port_params, port_caps, port); + FIXME("(%p, %p) stub!\n", iface, buffer); return E_NOTIMPL; } -HRESULT midi_in_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_params, - DMUS_PORTCAPS *port_caps, IDirectMusicPort **port) +static HRESULT WINAPI midi_IDirectMusicPort_SetReadNotificationHandle(IDirectMusicPort *iface, + HANDLE event) +{ + FIXME("(%p, %p) stub!\n", iface, event); + + return S_OK; +} + +static HRESULT WINAPI midi_IDirectMusicPort_Read(IDirectMusicPort *iface, + IDirectMusicBuffer *buffer) +{ + FIXME("(%p, %p) stub!\n", iface, buffer); + + return E_NOTIMPL; +} + +static HRESULT WINAPI midi_IDirectMusicPort_DownloadInstrument(IDirectMusicPort *iface, + IDirectMusicInstrument *instrument, IDirectMusicDownloadedInstrument **downloaded, + DMUS_NOTERANGE *ranges, DWORD num_ranges) +{ + FIXME("(%p, %p, %p, %p, %u) stub!\n", iface, instrument, downloaded, ranges, num_ranges); + + return E_NOTIMPL; +} + +static HRESULT WINAPI midi_IDirectMusicPort_UnloadInstrument(IDirectMusicPort *iface, + IDirectMusicDownloadedInstrument *downloaded) +{ + FIXME("(%p, %p) stub!\n", iface, downloaded); + + return E_NOTIMPL; +} + +static HRESULT WINAPI midi_IDirectMusicPort_GetLatencyClock(IDirectMusicPort *iface, + IReferenceClock **clock) +{ + struct midi_port *This = impl_from_IDirectMusicPort(iface); + + TRACE("(%p, %p)\n", iface, clock); + + if (!clock) + return E_POINTER; + + *clock = This->clock; + IReferenceClock_AddRef(*clock); + + return S_OK; +} + +static HRESULT WINAPI midi_IDirectMusicPort_GetRunningStats(IDirectMusicPort *iface, + DMUS_SYNTHSTATS *stats) +{ + FIXME("(%p, %p) stub!\n", iface, stats); + + return E_NOTIMPL; +} + +static HRESULT WINAPI midi_IDirectMusicPort_Compact(IDirectMusicPort *iface) +{ + FIXME("(%p) stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT WINAPI midi_IDirectMusicPort_GetCaps(IDirectMusicPort *iface, DMUS_PORTCAPS *caps) +{ + FIXME("(%p, %p) stub!\n", iface, caps); + + return E_NOTIMPL; +} + +static HRESULT WINAPI midi_IDirectMusicPort_DeviceIoControl(IDirectMusicPort *iface, + DWORD io_control_code, void *in, DWORD size_in, void *out, DWORD size_out, DWORD *ret_len, + OVERLAPPED *overlapped) { - FIXME("(%p, %p, %p): stub\n", port_params, port_caps, port); + FIXME("(%p, %u, %p, %u, %p, %u, %p, %p) stub!\n", iface, io_control_code, in, size_in, out + , size_out, ret_len, overlapped); return E_NOTIMPL; } + +static HRESULT WINAPI midi_IDirectMusicPort_SetNumChannelGroups(IDirectMusicPort *iface, + DWORD cgroups) +{ + FIXME("(%p, %u) stub!\n", iface, cgroups); + + return E_NOTIMPL; +} + +static HRESULT WINAPI midi_IDirectMusicPort_GetNumChannelGroups(IDirectMusicPort *iface, + DWORD *cgroups) +{ + FIXME("(%p, %p) stub!\n", iface, cgroups); + + return E_NOTIMPL; +} + +static HRESULT WINAPI midi_IDirectMusicPort_Activate(IDirectMusicPort *iface, BOOL active) +{ + FIXME("(%p, %u) stub!\n", iface, active); + + return S_OK; +} + +static HRESULT WINAPI midi_IDirectMusicPort_SetChannelPriority(IDirectMusicPort *iface, + DWORD channel_group, DWORD channel, DWORD priority) +{ + FIXME("(%p, %u, %u, %u) stub!\n", iface, channel_group, channel, priority); + + return E_NOTIMPL; +} + +static HRESULT WINAPI midi_IDirectMusicPort_GetChannelPriority(IDirectMusicPort *iface, + DWORD channel_group, DWORD channel, DWORD *priority) +{ + FIXME("(%p, %u, %u, %p) stub!\n", iface, channel_group, channel, priority); + + return E_NOTIMPL; +} + +static HRESULT WINAPI midi_IDirectMusicPort_SetDirectSound(IDirectMusicPort *iface, + IDirectSound *dsound, IDirectSoundBuffer *dsbuffer) +{ + FIXME("(%p, %p, %p) stub!\n", iface, dsound, dsbuffer); + + return E_NOTIMPL; +} + +static HRESULT WINAPI midi_IDirectMusicPort_GetFormat(IDirectMusicPort *iface, WAVEFORMATEX *format, + DWORD *format_size, DWORD *buffer_size) +{ + FIXME("(%p, %p, %p, %p) stub!\n", iface, format, format_size, buffer_size); + + return E_NOTIMPL; +} + +static const IDirectMusicPortVtbl midi_port_vtbl = { + midi_IDirectMusicPort_QueryInterface, + midi_IDirectMusicPort_AddRef, + midi_IDirectMusicPort_Release, + midi_IDirectMusicPort_PlayBuffer, + midi_IDirectMusicPort_SetReadNotificationHandle, + midi_IDirectMusicPort_Read, + midi_IDirectMusicPort_DownloadInstrument, + midi_IDirectMusicPort_UnloadInstrument, + midi_IDirectMusicPort_GetLatencyClock, + midi_IDirectMusicPort_GetRunningStats, + midi_IDirectMusicPort_Compact, + midi_IDirectMusicPort_GetCaps, + midi_IDirectMusicPort_DeviceIoControl, + midi_IDirectMusicPort_SetNumChannelGroups, + midi_IDirectMusicPort_GetNumChannelGroups, + midi_IDirectMusicPort_Activate, + midi_IDirectMusicPort_SetChannelPriority, + midi_IDirectMusicPort_GetChannelPriority, + midi_IDirectMusicPort_SetDirectSound, + midi_IDirectMusicPort_GetFormat, +}; + +static inline struct midi_port *impl_from_IDirectMusicThru(IDirectMusicThru *iface) +{ + return CONTAINING_RECORD(iface, struct midi_port, IDirectMusicThru_iface); +} + +static HRESULT WINAPI midi_IDirectMusicThru_QueryInterface(IDirectMusicThru *iface, REFIID riid, + void **ret_iface) +{ + struct midi_port *This = impl_from_IDirectMusicThru(iface); + + return IDirectMusicPort_QueryInterface(&This->IDirectMusicPort_iface, riid, ret_iface); +} + +static ULONG WINAPI midi_IDirectMusicThru_AddRef(IDirectMusicThru *iface) +{ + struct midi_port *This = impl_from_IDirectMusicThru(iface); + + return IDirectMusicPort_AddRef(&This->IDirectMusicPort_iface); +} + +static ULONG WINAPI midi_IDirectMusicThru_Release(IDirectMusicThru *iface) +{ + struct midi_port *This = impl_from_IDirectMusicThru(iface); + + return IDirectMusicPort_Release(&This->IDirectMusicPort_iface); +} + +static HRESULT WINAPI midi_IDirectMusicThru_ThruChannel(IDirectMusicThru *iface, DWORD src_group, + DWORD src_channel, DWORD dest_group, DWORD dest_channel, IDirectMusicPort *dest_port) +{ + FIXME("(%p, %u, %u, %u, %u, %p) stub!\n", iface, src_group, src_channel, dest_group, + dest_channel, dest_port); + + return S_OK; +} + +static const IDirectMusicThruVtbl midi_thru_vtbl = { + midi_IDirectMusicThru_QueryInterface, + midi_IDirectMusicThru_AddRef, + midi_IDirectMusicThru_Release, + midi_IDirectMusicThru_ThruChannel, +}; + +static HRESULT midi_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *params, + DMUS_PORTCAPS *caps, IDirectMusicPort **port) +{ + struct midi_port *obj; + HRESULT hr; + + if (!(obj = heap_alloc_zero(sizeof(*obj)))) + return E_OUTOFMEMORY; + + obj->IDirectMusicPort_iface.lpVtbl = &midi_port_vtbl; + obj->IDirectMusicThru_iface.lpVtbl = &midi_thru_vtbl; + obj->ref = 1; + + hr = DMUSIC_CreateReferenceClockImpl(&IID_IReferenceClock, (void **)&obj->clock, NULL); + if (hr != S_OK) { + HeapFree(GetProcessHeap(), 0, obj); + return hr; + } + + *port = &obj->IDirectMusicPort_iface; + + return S_OK; +} + +HRESULT midi_out_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *params, + DMUS_PORTCAPS *caps, IDirectMusicPort **port) +{ + TRACE("(%p, %p, %p, %p)\n", parent, params, caps, port); + + return midi_port_create(parent, params, caps, port); +} + +HRESULT midi_in_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *params, + DMUS_PORTCAPS *caps, IDirectMusicPort **port) +{ + TRACE("(%p, %p, %p, %p)\n", parent, params, caps, port); + + return midi_port_create(parent, params, caps, port); +} diff --git a/media/doc/README.WINE b/media/doc/README.WINE index df4d66c340..a0bda6e3b5 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-3.17 reactos/dll/directx/wine/dinput8 # Synced to WineStaging-3.3 -reactos/dll/directx/wine/dmusic # Synced to WineStaging-3.9 +reactos/dll/directx/wine/dmusic # Synced to WineStaging-3.17 reactos/dll/directx/wine/dplay # Synced to WineStaging-3.3 reactos/dll/directx/wine/dplayx # Synced to WineStaging-3.3 reactos/dll/directx/wine/dsound # Synced to Wine-1.3.29
6 years, 2 months
1
0
0
0
01/01: [DINPUT_WINETEST] Sync with Wine Staging 3.17. CORE-15127
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5c9588fa7de87b46fd631…
commit 5c9588fa7de87b46fd631ad8c014f03dc4ce0433 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Oct 1 00:21:34 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Oct 1 00:21:34 2018 +0100 [DINPUT_WINETEST] Sync with Wine Staging 3.17. CORE-15127 --- modules/rostests/winetests/dinput/device.c | 4 +- modules/rostests/winetests/dinput/dinput.c | 20 ++--- modules/rostests/winetests/dinput/joystick.c | 8 +- modules/rostests/winetests/dinput/keyboard.c | 112 +++++++++++++++++++-------- 4 files changed, 94 insertions(+), 50 deletions(-) diff --git a/modules/rostests/winetests/dinput/device.c b/modules/rostests/winetests/dinput/device.c index 74940248ff..fa9b6f1436 100644 --- a/modules/rostests/winetests/dinput/device.c +++ b/modules/rostests/winetests/dinput/device.c @@ -51,7 +51,7 @@ static const DIDATAFORMAT data_format = { sizeof(DIOBJECTDATAFORMAT), DIDF_ABSAXIS, 32, - sizeof(obj_data_format) / sizeof(obj_data_format[0]), + ARRAY_SIZE(obj_data_format), (LPDIOBJECTDATAFORMAT)obj_data_format }; @@ -94,7 +94,7 @@ static void test_object_info(IDirectInputDeviceA *device, HWND hwnd) ok(cnt == cnt1, "Enum count changed from %d to %d\n", cnt, cnt1); /* Testing EnumObjects with different types of device objects */ - for (type_index=0; type_index < sizeof(obj_types)/sizeof(obj_types[0]); type_index++) + for (type_index=0; type_index < ARRAY_SIZE(obj_types); type_index++) { hr = IDirectInputDevice_EnumObjects(device, enum_type_callback, &obj_types[type_index], obj_types[type_index]); ok(SUCCEEDED(hr), "EnumObjects() failed: %08x\n", hr); diff --git a/modules/rostests/winetests/dinput/dinput.c b/modules/rostests/winetests/dinput/dinput.c index a5f7c0cfce..7e2da9ff32 100644 --- a/modules/rostests/winetests/dinput/dinput.c +++ b/modules/rostests/winetests/dinput/dinput.c @@ -106,7 +106,7 @@ static void test_preinitialization(void) return; } - for (i = 0; i < sizeof(create_device_tests)/sizeof(create_device_tests[0]); i++) + for (i = 0; i < ARRAY_SIZE(create_device_tests); i++) { if (create_device_tests[i].pdev) pDID = (void *)0xdeadbeef; hr = IDirectInput_CreateDevice(pDI, create_device_tests[i].rguid, @@ -117,7 +117,7 @@ static void test_preinitialization(void) ok(pDID == NULL, "[%d] Output interface pointer is %p\n", i, pDID); } - for (i = 0; i < sizeof(enum_devices_tests)/sizeof(enum_devices_tests[0]); i++) + for (i = 0; i < ARRAY_SIZE(enum_devices_tests); i++) { hr = IDirectInput_EnumDevices(pDI, enum_devices_tests[i].dwDevType, enum_devices_tests[i].lpCallback, @@ -217,7 +217,7 @@ static void test_DirectInputCreateEx(void) return; } - for (i = 0; i < sizeof(invalid_param_list)/sizeof(invalid_param_list[0]); i++) + for (i = 0; i < ARRAY_SIZE(invalid_param_list); i++) { if (invalid_param_list[i].ppdi) pUnk = (void *)0xdeadbeef; hr = pDirectInputCreateEx(invalid_param_list[i].hinst ? hInstance : NULL, @@ -230,7 +230,7 @@ static void test_DirectInputCreateEx(void) ok(pUnk == invalid_param_list[i].expected_ppdi, "[%d] Output interface pointer is %p\n", i, pUnk); } - for (i = 0; i < sizeof(no_interface_list)/sizeof(no_interface_list[0]); i++) + for (i = 0; i < ARRAY_SIZE(no_interface_list); i++) { pUnk = (void *)0xdeadbeef; hr = pDirectInputCreateEx(hInstance, DIRECTINPUT_VERSION, no_interface_list[i], (void **)&pUnk, NULL); @@ -238,7 +238,7 @@ static void test_DirectInputCreateEx(void) ok(pUnk == (void *)0xdeadbeef, "[%d] Output interface pointer is %p\n", i, pUnk); } - for (i = 0; i < sizeof(iid_list)/sizeof(iid_list[0]); i++) + for (i = 0; i < ARRAY_SIZE(iid_list); i++) { pUnk = NULL; hr = pDirectInputCreateEx(hInstance, DIRECTINPUT_VERSION, iid_list[i], (void **)&pUnk, NULL); @@ -249,9 +249,9 @@ static void test_DirectInputCreateEx(void) } /* Examine combinations of requested interfaces and version numbers. */ - for (i = 0; i < sizeof(directinput_version_list)/sizeof(directinput_version_list[0]); i++) + for (i = 0; i < ARRAY_SIZE(directinput_version_list); i++) { - for (j = 0; j < sizeof(iid_list)/sizeof(iid_list[0]); j++) + for (j = 0; j < ARRAY_SIZE(iid_list); j++) { pUnk = NULL; hr = pDirectInputCreateEx(hInstance, directinput_version_list[i], iid_list[j], (void **)&pUnk, NULL); @@ -311,7 +311,7 @@ static void test_QueryInterface(void) hr = IDirectInput_QueryInterface(pDI, &IID_IUnknown, NULL); ok(hr == E_POINTER, "IDirectInput_QueryInterface returned 0x%08x\n", hr); - for (i = 0; i < sizeof(iid_list)/sizeof(iid_list[0]); i++) + for (i = 0; i < ARRAY_SIZE(iid_list); i++) { pUnk = NULL; hr = IDirectInput_QueryInterface(pDI, iid_list[i], (void **)&pUnk); @@ -320,7 +320,7 @@ static void test_QueryInterface(void) if (pUnk) IUnknown_Release(pUnk); } - for (i = 0; i < sizeof(no_interface_list)/sizeof(no_interface_list[0]); i++) + for (i = 0; i < ARRAY_SIZE(no_interface_list); i++) { pUnk = (void *)0xdeadbeef; hr = IDirectInput_QueryInterface(pDI, no_interface_list[i].riid, (void **)&pUnk); @@ -512,7 +512,7 @@ static void test_Initialize(void) hr = IDirectInput_Initialize(pDI, hInstance, 0xcafe); ok(hr == DIERR_OLDDIRECTINPUTVERSION, "IDirectInput_Initialize returned 0x%08x\n", hr); - for (i = 0; i < sizeof(directinput_version_list)/sizeof(directinput_version_list[0]); i++) + for (i = 0; i < ARRAY_SIZE(directinput_version_list); i++) { hr = IDirectInput_Initialize(pDI, hInstance, directinput_version_list[i]); ok(hr == DI_OK, "IDirectInput_Initialize returned 0x%08x\n", hr); diff --git a/modules/rostests/winetests/dinput/joystick.c b/modules/rostests/winetests/dinput/joystick.c index b4ffba5c5d..69e95d0c2d 100644 --- a/modules/rostests/winetests/dinput/joystick.c +++ b/modules/rostests/winetests/dinput/joystick.c @@ -30,8 +30,6 @@ #include "wingdi.h" #include "dinput.h" -#define numObjects(x) (sizeof(x) / sizeof(x[0])) - typedef struct tagUserData { IDirectInputA *pDI; DWORD version; @@ -62,7 +60,7 @@ static const DIDATAFORMAT c_dfDIJoystickTest = { sizeof(DIOBJECTDATAFORMAT), DIDF_ABSAXIS, sizeof(DIJOYSTATE2), - numObjects(dfDIJoystickTest), + ARRAY_SIZE(dfDIJoystickTest), (LPDIOBJECTDATAFORMAT)dfDIJoystickTest }; @@ -178,7 +176,7 @@ static const struct effect_id static const struct effect_id* effect_from_guid(const GUID *guid) { unsigned int i; - for (i = 0; i < sizeof(effect_conversion) / sizeof(effect_conversion[0]); i++) + for (i = 0; i < ARRAY_SIZE(effect_conversion); i++) if (IsEqualGUID(guid, effect_conversion[i].guid)) return &effect_conversion[i]; return NULL; @@ -504,7 +502,7 @@ static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef) effect_data.eff.dwDuration = INFINITE; effect_data.eff.dwGain = DI_FFNOMINALMAX; effect_data.eff.dwTriggerButton = DIEB_NOTRIGGER; - effect_data.eff.cAxes = sizeof(axes) / sizeof(axes[0]); + effect_data.eff.cAxes = ARRAY_SIZE(axes); effect_data.eff.rgdwAxes = axes; effect_data.eff.rglDirection = direction; diff --git a/modules/rostests/winetests/dinput/keyboard.c b/modules/rostests/winetests/dinput/keyboard.c index 576a94cc7d..8ee22fa38e 100644 --- a/modules/rostests/winetests/dinput/keyboard.c +++ b/modules/rostests/winetests/dinput/keyboard.c @@ -101,7 +101,7 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd) df.dwObjSize = sizeof( DIOBJECTDATAFORMAT ); df.dwFlags = DIDF_RELAXIS; df.dwDataSize = sizeof( custom_state ); - df.dwNumObjs = sizeof( dodf )/sizeof( dodf[0] ); + df.dwNumObjs = ARRAY_SIZE(dodf); df.rgodf = dodf; hr = IDirectInput_CreateDevice(pDI, &GUID_SysKeyboard, &pKeyboard, NULL); @@ -139,7 +139,7 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd) memset(custom_state, 0x56, sizeof(custom_state)); IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(custom_state), custom_state); - for (i = 0; i < sizeof(custom_state) / sizeof(custom_state[0]); i++) + for (i = 0; i < ARRAY_SIZE(custom_state); i++) ok(custom_state[i] == 0, "Should be zeroed, got 0x%08x\n", custom_state[i]); /* simulate some keyboard input */ @@ -160,7 +160,7 @@ static void acquire_tests(IDirectInputA *pDI, HWND hwnd) ok(SUCCEEDED(hr), "IDirectInputDevice_Acquire() failed: %08x\n", hr); hr = IDirectInputDevice_GetDeviceState(pKeyboard, sizeof(custom_state), custom_state); ok(SUCCEEDED(hr), "IDirectInputDevice_GetDeviceState failed: %08x\n", hr); - for (i = 0; i < sizeof(custom_state) / sizeof(custom_state[0]); i++) + for (i = 0; i < ARRAY_SIZE(custom_state); i++) ok(custom_state[i] == 0, "Should be zeroed, got 0x%08x\n", custom_state[i]); } keybd_event('Q', 0, KEYEVENTF_KEYUP, 0); @@ -263,6 +263,7 @@ static void test_capabilities(IDirectInputA *pDI, HWND hwnd) HRESULT hr; IDirectInputDeviceA *pKeyboard = NULL; DIDEVCAPS caps; + int kbd_type, kbd_subtype, dev_subtype; hr = IDirectInput_CreateDevice(pDI, &GUID_SysKeyboard, &pKeyboard, NULL); ok(SUCCEEDED(hr), "IDirectInput_CreateDevice() failed: %08x\n", hr); @@ -273,10 +274,23 @@ static void test_capabilities(IDirectInputA *pDI, HWND hwnd) ok (SUCCEEDED(hr), "GetCapabilities failed: 0x%08x\n", hr); ok (caps.dwFlags & DIDC_ATTACHED, "GetCapabilities dwFlags: 0x%08x\n", caps.dwFlags); - ok (LOWORD(LOBYTE(caps.dwDevType)) == DIDEVTYPE_KEYBOARD, + ok (GET_DIDEVICE_TYPE(caps.dwDevType) == DIDEVTYPE_KEYBOARD, "GetCapabilities invalid device type for dwDevType: 0x%08x\n", caps.dwDevType); - ok (LOWORD(HIBYTE(caps.dwDevType)) != DIDEVTYPEKEYBOARD_UNKNOWN, - "GetCapabilities invalid device subtype for dwDevType: 0x%08x\n", caps.dwDevType); + kbd_type = GetKeyboardType(0); + kbd_subtype = GetKeyboardType(1); + dev_subtype = GET_DIDEVICE_SUBTYPE(caps.dwDevType); + if (kbd_type == 4 || (kbd_type == 7 && kbd_subtype == 0)) + ok (dev_subtype == DIDEVTYPEKEYBOARD_PCENH, + "GetCapabilities invalid device subtype for dwDevType: 0x%08x (%04x:%04x)\n", + caps.dwDevType, kbd_type, kbd_subtype); + else if (kbd_type == 7 && kbd_subtype == 2) + ok (dev_subtype == DIDEVTYPEKEYBOARD_JAPAN106, + "GetCapabilities invalid device subtype for dwDevType: 0x%08x (%04x:%04x)\n", + caps.dwDevType, kbd_type, kbd_subtype); + else + ok (dev_subtype != DIDEVTYPEKEYBOARD_UNKNOWN, + "GetCapabilities invalid device subtype for dwDevType: 0x%08x (%04x:%04x)\n", + caps.dwDevType, kbd_type, kbd_subtype); IUnknown_Release(pKeyboard); } @@ -285,38 +299,52 @@ static void test_dik_codes(IDirectInputA *dI, HWND hwnd, LANGID langid) { static const struct key2dik { - BYTE key, dik; + BYTE key, dik, todo; } key2dik_en[] = { - {'Q',DIK_Q}, {'W',DIK_W}, {'E',DIK_E}, {'R',DIK_R}, {'T',DIK_T}, {'Y',DIK_Y} + {'Q',DIK_Q}, {'W',DIK_W}, {'E',DIK_E}, {'R',DIK_R}, {'T',DIK_T}, {'Y',DIK_Y}, + {'[',DIK_LBRACKET}, {']',DIK_RBRACKET}, {'.',DIK_PERIOD} }, key2dik_fr[] = { - {'A',DIK_Q}, {'Z',DIK_W}, {'E',DIK_E}, {'R',DIK_R}, {'T',DIK_T}, {'Y',DIK_Y} + {'A',DIK_Q}, {'Z',DIK_W}, {'E',DIK_E}, {'R',DIK_R}, {'T',DIK_T}, {'Y',DIK_Y}, + {'^',DIK_LBRACKET}, {'$',DIK_RBRACKET}, {':',DIK_PERIOD} }, key2dik_de[] = { - {'Q',DIK_Q}, {'W',DIK_W}, {'E',DIK_E}, {'R',DIK_R}, {'T',DIK_T}, {'Z',DIK_Y} + {'Q',DIK_Q}, {'W',DIK_W}, {'E',DIK_E}, {'R',DIK_R}, {'T',DIK_T}, {'Z',DIK_Y}, + {'\xfc',DIK_LBRACKET,1}, {'+',DIK_RBRACKET}, {'.',DIK_PERIOD} + }, + key2dik_ja[] = + { + {'Q',DIK_Q}, {'W',DIK_W}, {'E',DIK_E}, {'R',DIK_R}, {'T',DIK_T}, {'Y',DIK_Y}, + {'@',DIK_AT}, {']',DIK_RBRACKET}, {'.',DIK_PERIOD} }; static const struct { LANGID langid; const struct key2dik *map; + DWORD type; } expected[] = { - { MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), key2dik_en }, - { MAKELANGID(LANG_FRENCH, SUBLANG_FRENCH), key2dik_fr }, - { MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), key2dik_de }, - { MAKELANGID(LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN), key2dik_en } + { MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), + key2dik_en, DIDEVTYPEKEYBOARD_PCENH }, + { MAKELANGID(LANG_FRENCH, SUBLANG_FRENCH), + key2dik_fr, DIDEVTYPEKEYBOARD_PCENH }, + { MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN), + key2dik_de, DIDEVTYPEKEYBOARD_PCENH }, + { MAKELANGID(LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN), + key2dik_ja, DIDEVTYPEKEYBOARD_JAPAN106 } }; const struct key2dik *map = NULL; UINT i; HRESULT hr; IDirectInputDeviceA *device; + DIDEVCAPS caps; HKL hkl, hkl_orig; MSG msg; - for (i = 0; i < sizeof(expected)/sizeof(expected[0]); i++) + for (i = 0; i < ARRAY_SIZE(expected); i++) { if (expected[i].langid == langid) { @@ -333,6 +361,14 @@ static void test_dik_codes(IDirectInputA *dI, HWND hwnd, LANGID langid) ok(hr == S_OK, "SetDataFormat() failed: %08x\n", hr); hr = IDirectInputDevice_Acquire(device); ok(hr == S_OK, "Acquire() failed: %08x\n", hr); + caps.dwSize = sizeof( caps ); + hr = IDirectInputDevice_GetCapabilities(device, &caps); + ok(hr == S_OK, "GetDeviceInstance() failed: %08x\n", hr); + if (expected[i].type != GET_DIDEVICE_SUBTYPE(caps.dwDevType)) { + skip("Keyboard type(%u) doesn't match for lang %04x\n", + GET_DIDEVICE_SUBTYPE(caps.dwDevType), langid); + goto fail; + } hkl = activate_keyboard_layout(langid, &hkl_orig); if (!hkl) goto fail; @@ -340,42 +376,51 @@ static void test_dik_codes(IDirectInputA *dI, HWND hwnd, LANGID langid) SetFocus(hwnd); pump_messages(); - for (i = 0; i < sizeof(key2dik_en)/sizeof(key2dik_en[0]); i++) + for (i = 0; i < ARRAY_SIZE(key2dik_en); i++) { BYTE kbd_state[256]; UINT n; + WORD vkey, scan; INPUT in; - n = MapVirtualKeyA(map[i].key, MAPVK_VK_TO_CHAR); - ok(n == map[i].key, "%u: expected %c, got %c\n", i, map[i].key, n); - n = MapVirtualKeyA(map[i].key, MAPVK_VK_TO_VSC); - ok(n == map[i].dik, "%u: expected %02x, got %02x\n", i, map[i].dik, n); + n = VkKeyScanExW(map[i].key, hkl); + todo_wine_if(map[i].todo & 1) + ok(n != 0xffff, "%u: failed to get virtual key value for %c(%02x)\n", i, map[i].key, map[i].key); + vkey = LOBYTE(n); + n = MapVirtualKeyExA(vkey, MAPVK_VK_TO_CHAR, hkl) & 0xff; + todo_wine_if(map[i].todo & 1) + ok(n == map[i].key, "%u: expected %c(%02x), got %c(%02x)\n", i, map[i].key, map[i].key, n, n); + scan = MapVirtualKeyExA(vkey, MAPVK_VK_TO_VSC, hkl); + /* scan codes match the DIK_ codes on US keyboard. + however, it isn't true for symbols and punctuations in other layouts. */ + if (isalpha(map[i].key) || langid == MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT)) + ok(scan == map[i].dik, "%u: expected %02x, got %02x\n", i, map[i].dik, n); + else + todo_wine_if(map[i].todo & 1) + ok(scan, "%u: fail to get scan code value, expected %02x (vkey=%02x)\n", + i, map[i].dik, vkey); in.type = INPUT_KEYBOARD; - U(in).ki.wVk = map[i].key; - U(in).ki.wScan = map[i].dik; /* scan codes match the DIK_ codes */ + U(in).ki.wVk = vkey; + U(in).ki.wScan = scan; U(in).ki.dwFlags = 0; U(in).ki.dwExtraInfo = 0; U(in).ki.time = 0; n = SendInput(1, &in, sizeof(in)); ok(n == 1, "got %u\n", n); - if (!PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) - { - win_skip("failed to queue keyboard event\n"); - break; - } - ok(msg.message == WM_KEYDOWN || broken(msg.message != WM_KEYDOWN), "expected WM_KEYDOWN, got %04x\n", msg.message); - /* this never happens on real hardware but tesbot VMs seem to have timing issues */ - if (msg.message != WM_KEYDOWN) + if (!PeekMessageA(&msg, hwnd, 0, 0, PM_REMOVE)) { win_skip("failed to queue keyboard event\n"); break; } + ok(msg.message == WM_KEYDOWN, "expected WM_KEYDOWN, got %04x\n", msg.message); DispatchMessageA(&msg); - trace("keydown wParam: %#lx (%c) lParam: %#lx, MapVirtualKey(MAPVK_VK_TO_CHAR) = %c\n", - msg.wParam, LOWORD(msg.wParam), msg.lParam, MapVirtualKeyA(msg.wParam, MAPVK_VK_TO_CHAR)); + n = MapVirtualKeyExA(msg.wParam, MAPVK_VK_TO_CHAR, hkl); + trace("keydown wParam: %#08lx (%c) lParam: %#08lx, MapVirtualKey(MAPVK_VK_TO_CHAR) = %c\n", + msg.wParam, isprint(LOWORD(msg.wParam)) ? LOWORD(msg.wParam) : '?', + msg.lParam, isprint(n) ? n : '?'); pump_messages(); @@ -389,6 +434,7 @@ static void test_dik_codes(IDirectInputA *dI, HWND hwnd, LANGID langid) break; } + todo_wine_if(map[i].todo) ok(kbd_state[map[i].dik] == 0x80, "DI key %#x has state %#x\n", map[i].dik, kbd_state[map[i].dik]); U(in).ki.dwFlags = KEYEVENTF_KEYUP; @@ -448,7 +494,7 @@ static void keyboard_tests(DWORD version) START_TEST(keyboard) { - pDirectInputCreateA = (void *)GetProcAddress(LoadLibraryA("dinput.dll"), "DirectInputCreateA"); + pDirectInputCreateA = (void *)GetProcAddress(GetModuleHandleA("dinput.dll"), "DirectInputCreateA"); CoInitialize(NULL);
6 years, 2 months
1
0
0
0
← Newer
1
2
3
4
...
23
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
Results per page:
10
25
50
100
200