winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2019
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1019 discussions
Start a n
N
ew thread
Akihiro Sagawa : advapi32: Improve load_string to return error code.
by Alexandre Julliard
13 May '19
13 May '19
Module: wine Branch: master Commit: bfdfe85229b94bc8e9e033ab85f641e23077c6eb URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bfdfe85229b94bc8e9e033ab…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu May 9 22:07:30 2019 +0900 advapi32: Improve load_string to return error code. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/registry.c | 19 +++++++++++-------- dlls/advapi32/tests/registry.c | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index a9a5841..328ae39 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -3112,7 +3112,7 @@ LSTATUS WINAPI RegOpenUserClassesRoot( * avoid importing user32, which is higher level than advapi32. Helper for * RegLoadMUIString. */ -static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars) +static LONG load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMaxChars) { HGLOBAL hMemory; HRSRC hResource; @@ -3125,17 +3125,17 @@ static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMa /* Load the resource into memory and get a pointer to it. */ hResource = FindResourceW(hModule, MAKEINTRESOURCEW(LOWORD(resId >> 4) + 1), (LPWSTR)RT_STRING); - if (!hResource) return 0; + if (!hResource) return ERROR_FILE_NOT_FOUND; hMemory = LoadResource(hModule, hResource); - if (!hMemory) return 0; + if (!hMemory) return ERROR_FILE_NOT_FOUND; pString = LockResource(hMemory); /* Strings are length-prefixed. Lowest nibble of resId is an index. */ idxString = resId & 0xf; while (idxString--) pString += *pString + 1; - /* If no buffer is given, return length of the string. */ - if (!pwszBuffer) return *pString; + /* If no buffer is given, return here. */ + if (!pwszBuffer) return ERROR_MORE_DATA; /* Else copy over the string, respecting the buffer size. */ cMaxChars = (*pString < cMaxChars) ? *pString : (cMaxChars - 1); @@ -3144,7 +3144,7 @@ static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMa pwszBuffer[cMaxChars] = '\0'; } - return cMaxChars; + return ERROR_SUCCESS; } /****************************************************************************** @@ -3263,9 +3263,12 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer /* Load the file */ hModule = LoadLibraryExW(pwszTempBuffer, NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE); - if (!hModule || !load_string(hModule, uiStringId, pwszBuffer, cbBuffer/sizeof(WCHAR))) + if (hModule) { + result = load_string(hModule, uiStringId, pwszBuffer, cbBuffer/sizeof(WCHAR)); + FreeLibrary(hModule); + } + else result = ERROR_BADKEY; - FreeLibrary(hModule); } cleanup: diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index ccda877..cadb936 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -3891,7 +3891,7 @@ static void test_RegLoadMUIString(void) size = 0xdeadbeef; ret = pRegLoadMUIStringW(hkey, tz_valueW, NULL, 0, &size, 0, NULL); - todo_wine ok(ret == ERROR_MORE_DATA, "got %d, expected ERROR_MORE_DATA\n", ret); + ok(ret == ERROR_MORE_DATA, "got %d, expected ERROR_MORE_DATA\n", ret); todo_wine ok(size == text_size, "got %u, expected %u\n", size, text_size); memset(bufW, 0xff, sizeof(bufW));
1
0
0
0
Akihiro Sagawa : advapi32: Improve parameter sanity checks in RegLoadMUIString.
by Alexandre Julliard
13 May '19
13 May '19
Module: wine Branch: master Commit: ec716f74d7a6f1a878138f943f09b8c888a69cd7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ec716f74d7a6f1a878138f94…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu May 9 22:07:28 2019 +0900 advapi32: Improve parameter sanity checks in RegLoadMUIString. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/registry.c | 2 +- dlls/advapi32/tests/registry.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 469818c..a9a5841 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -3183,7 +3183,7 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer cbBuffer, pcbData, dwFlags, debugstr_w(pwszBaseDir)); /* Parameter sanity checks. */ - if (!hKey || !pwszBuffer) + if (!hKey || (!pwszBuffer && cbBuffer) || (cbBuffer % sizeof(WCHAR))) return ERROR_INVALID_PARAMETER; /* Check for value existence and correctness of its type, allocate a buffer and load it. */ diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index d6edb02..ccda877 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -3896,8 +3896,8 @@ static void test_RegLoadMUIString(void) memset(bufW, 0xff, sizeof(bufW)); ret = pRegLoadMUIStringW(hkey, tz_valueW, bufW, sizeof(WCHAR)+1, &size, 0, NULL); - todo_wine ok(ret == ERROR_INVALID_PARAMETER, "got %d, expected ERROR_INVALID_PARAMETER\n", ret); - todo_wine ok(bufW[0] == 0xffff, "got 0x%04x, expected 0xffff\n", bufW[0]); + ok(ret == ERROR_INVALID_PARAMETER, "got %d, expected ERROR_INVALID_PARAMETER\n", ret); + ok(bufW[0] == 0xffff, "got 0x%04x, expected 0xffff\n", bufW[0]); size = 0xdeadbeef; memset(bufW, 0xff, sizeof(bufW));
1
0
0
0
Akihiro Sagawa : advapi32: Support the base directory parameter in RegLoadMUIString.
by Alexandre Julliard
13 May '19
13 May '19
Module: wine Branch: master Commit: 1b7f3698f076458a2bb5aff808ef49f4d2ec8229 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1b7f3698f076458a2bb5aff8…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu May 9 22:07:27 2019 +0900 advapi32: Support the base directory parameter in RegLoadMUIString. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/registry.c | 45 +++++++++++++++++++++++++++++++----------- dlls/advapi32/tests/registry.c | 4 ++-- dlls/kernel32/time.c | 2 +- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 43ea3b3..469818c 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -3161,7 +3161,7 @@ static int load_string(HINSTANCE hModule, UINT resId, LPWSTR pwszBuffer, INT cMa * cbBuffer [I] Size of the destination buffer in bytes. * pcbData [O] Number of bytes written to pszBuffer (optional, may be NULL). * dwFlags [I] None supported yet. - * pszBaseDir [I] Not supported yet. + * pszBaseDir [I] Base directory of loading path. If NULL, use the current directory. * * RETURNS * Success: ERROR_SUCCESS, @@ -3177,7 +3177,7 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer DWORD dwValueType, cbData; LPWSTR pwszTempBuffer = NULL, pwszExpandedBuffer = NULL; LONG result; - + TRACE("(hKey = %p, pwszValue = %s, pwszBuffer = %p, cbBuffer = %d, pcbData = %p, " "dwFlags = %d, pwszBaseDir = %s)\n", hKey, debugstr_w(pwszValue), pwszBuffer, cbBuffer, pcbData, dwFlags, debugstr_w(pwszBaseDir)); @@ -3186,11 +3186,6 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer if (!hKey || !pwszBuffer) return ERROR_INVALID_PARAMETER; - if (pwszBaseDir && *pwszBaseDir) { - FIXME("BaseDir parameter not yet supported!\n"); - return ERROR_INVALID_PARAMETER; - } - /* Check for value existence and correctness of its type, allocate a buffer and load it. */ result = RegQueryValueExW(hKey, pwszValue, NULL, &dwValueType, NULL, &cbData); if (result != ERROR_SUCCESS) goto cleanup; @@ -3215,7 +3210,7 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer result = ERROR_NOT_ENOUGH_MEMORY; goto cleanup; } - ExpandEnvironmentStringsW(pwszTempBuffer, pwszExpandedBuffer, cbData); + ExpandEnvironmentStringsW(pwszTempBuffer, pwszExpandedBuffer, cbData / sizeof(WCHAR)); } else { pwszExpandedBuffer = heap_alloc(cbData); memcpy(pwszExpandedBuffer, pwszTempBuffer, cbData); @@ -3227,8 +3222,10 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer if (*pwszExpandedBuffer != '@') { /* '@' is the prefix for resource based string entries. */ lstrcpynW(pwszBuffer, pwszExpandedBuffer, cbBuffer / sizeof(WCHAR)); } else { - WCHAR *pComma = strrchrW(pwszExpandedBuffer, ','); + WCHAR *pComma = strrchrW(pwszExpandedBuffer, ','), *pNewBuffer; + const WCHAR backslashW[] = {'\\',0}; UINT uiStringId; + DWORD baseDirLen; HMODULE hModule; /* Format of the expanded value is 'path_to_dll,-resId' */ @@ -3236,17 +3233,41 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer result = ERROR_BADKEY; goto cleanup; } - + uiStringId = atoiW(pComma+2); *pComma = '\0'; - hModule = LoadLibraryExW(pwszExpandedBuffer + 1, NULL, + /* Build a resource dll path. */ + baseDirLen = pwszBaseDir ? strlenW(pwszBaseDir) : 0; + cbData = (baseDirLen + 1 + strlenW(pwszExpandedBuffer + 1) + 1) * sizeof(WCHAR); + pNewBuffer = heap_realloc(pwszTempBuffer, cbData); + if (!pNewBuffer) { + result = ERROR_NOT_ENOUGH_MEMORY; + goto cleanup; + } + pwszTempBuffer = pNewBuffer; + pwszTempBuffer[0] = '\0'; + if (baseDirLen) { + strcpyW(pwszTempBuffer, pwszBaseDir); + if (pwszBaseDir[baseDirLen - 1] != '\\') + strcatW(pwszTempBuffer, backslashW); + } + strcatW(pwszTempBuffer, pwszExpandedBuffer + 1); + + /* Verify the file existence. i.e. We don't rely on PATH variable */ + if (GetFileAttributesW(pwszTempBuffer) == INVALID_FILE_ATTRIBUTES) { + result = ERROR_FILE_NOT_FOUND; + goto cleanup; + } + + /* Load the file */ + hModule = LoadLibraryExW(pwszTempBuffer, NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE); if (!hModule || !load_string(hModule, uiStringId, pwszBuffer, cbBuffer/sizeof(WCHAR))) result = ERROR_BADKEY; FreeLibrary(hModule); } - + cleanup: heap_free(pwszTempBuffer); heap_free(pwszExpandedBuffer); diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index f5bcbf3..d6edb02 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -3925,7 +3925,7 @@ static void test_RegLoadMUIString(void) size = 0xdeadbeef; memset(bufW, 0xff, sizeof(bufW)); ret = pRegLoadMUIStringW(hkey, tz_valueW, bufW, ARRAY_SIZE(bufW), &size, 0, sysdirW); - todo_wine ok(ret == ERROR_SUCCESS, "got %d, expected ERROR_SUCCESS\n", ret); + ok(ret == ERROR_SUCCESS, "got %d, expected ERROR_SUCCESS\n", ret); todo_wine ok(size == text_size, "got %u, expected %u\n", size, text_size); size = min(size, sizeof(bufW)); todo_wine ok(!memcmp(textW, bufW, size), "got %s, expected %s\n", @@ -3935,7 +3935,7 @@ static void test_RegLoadMUIString(void) todo_wine ok(ret == ERROR_CALL_NOT_IMPLEMENTED, "got %d, expected ERROR_CALL_NOT_IMPLEMENTED\n", ret); ret = pRegLoadMUIStringW(hkey, tz_valueW, bufW, ARRAY_SIZE(bufW), &size, 0, NULL); - todo_wine ok(ret == ERROR_FILE_NOT_FOUND, "got %d, expected ERROR_FILE_NOT_FOUND\n", ret); + ok(ret == ERROR_FILE_NOT_FOUND, "got %d, expected ERROR_FILE_NOT_FOUND\n", ret); ret = pRegLoadMUIStringA(hkey, tz_value, buf, ARRAY_SIZE(buf), &size, 0, NULL); todo_wine ok(ret == ERROR_CALL_NOT_IMPLEMENTED, "got %d, expected ERROR_CALL_NOT_IMPLEMENTED\n", ret); diff --git a/dlls/kernel32/time.c b/dlls/kernel32/time.c index 4a4c494..256cd62 100644 --- a/dlls/kernel32/time.c +++ b/dlls/kernel32/time.c @@ -380,7 +380,7 @@ static BOOL reg_load_mui_string(HKEY hkey, LPCWSTR value, LPWSTR buffer, DWORD s if (hDll) { pRegLoadMUIStringW = (void *)GetProcAddress(hDll, "RegLoadMUIStringW"); if (pRegLoadMUIStringW && - !pRegLoadMUIStringW(hkey, value, buffer, size, NULL, 0, NULL)) + !pRegLoadMUIStringW(hkey, value, buffer, size, NULL, 0, DIR_System)) ret = TRUE; FreeLibrary(hDll); }
1
0
0
0
Akihiro Sagawa : advapi32/tests: Add basic RegLoadMUIString tests.
by Alexandre Julliard
13 May '19
13 May '19
Module: wine Branch: master Commit: c29a5560a682ac59d87c5d9c3420840d03eede60 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c29a5560a682ac59d87c5d9c…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Thu May 9 22:07:24 2019 +0900 advapi32/tests: Add basic RegLoadMUIString tests. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/advapi32/tests/registry.c | 115 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index d1fe3f0..f5bcbf3 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -51,6 +51,8 @@ static NTSTATUS (WINAPI * pRtlFormatCurrentUserKeyPath)(UNICODE_STRING*); static NTSTATUS (WINAPI * pRtlFreeUnicodeString)(PUNICODE_STRING); static LONG (WINAPI *pRegDeleteKeyValueA)(HKEY,LPCSTR,LPCSTR); static LONG (WINAPI *pRegSetKeyValueW)(HKEY,LPCWSTR,LPCWSTR,DWORD,const void*,DWORD); +static LONG (WINAPI *pRegLoadMUIStringA)(HKEY,LPCSTR,LPSTR,DWORD,LPDWORD,DWORD,LPCSTR); +static LONG (WINAPI *pRegLoadMUIStringW)(HKEY,LPCWSTR,LPWSTR,DWORD,LPDWORD,DWORD,LPCWSTR); static BOOL limited_user; @@ -142,6 +144,8 @@ static void InitFunctionPtrs(void) ADVAPI32_GET_PROC(RegDeleteKeyExA); ADVAPI32_GET_PROC(RegDeleteKeyValueA); ADVAPI32_GET_PROC(RegSetKeyValueW); + ADVAPI32_GET_PROC(RegLoadMUIStringA); + ADVAPI32_GET_PROC(RegLoadMUIStringW); pIsWow64Process = (void *)GetProcAddress( hkernel32, "IsWow64Process" ); pRtlFormatCurrentUserKeyPath = (void *)GetProcAddress( hntdll, "RtlFormatCurrentUserKeyPath" ); @@ -3830,6 +3834,116 @@ todo_wine ok(dwret == ERROR_SUCCESS, "got %u\n", dwret); } +static void test_RegLoadMUIString(void) +{ + HMODULE hUser32, hResDll; + int (WINAPI *pLoadStringW)(HMODULE, UINT, WCHAR *, int); + LONG ret; + HKEY hkey; + DWORD type, size, text_size; + UINT i; + char buf[64], *p, sysdir[MAX_PATH]; + WCHAR textW[64], bufW[64]; + WCHAR curdirW[MAX_PATH], sysdirW[MAX_PATH]; + const static char tz_value[] = "MUI_Std"; + const static WCHAR tz_valueW[] = {'M','U','I','_','S','t','d', 0}; + + if (!pRegLoadMUIStringA || !pRegLoadMUIStringW) + { + win_skip("RegLoadMUIString is not available\n"); + return; + } + + hUser32 = LoadLibraryA("user32.dll"); + ok(hUser32 != NULL, "cannot load user32.dll\n"); + pLoadStringW = (void *)GetProcAddress(hUser32, "LoadStringW"); + ok(pLoadStringW != NULL, "failed to get LoadStringW address\n"); + + ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, + "Software\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones\\UTC", 0, + KEY_READ, &hkey); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + size = ARRAY_SIZE(buf); + ret = RegQueryValueExA(hkey, tz_value, NULL, &type, (BYTE *)buf, &size); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + ok(buf[0] == '@', "got %s\n", buf); + + p = strrchr(buf, ','); + *p = '\0'; + i = atoi(p + 2); /* skip ',-' */ + hResDll = LoadLibraryExA(&buf[1], NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE); + memset(textW, 0xaa, sizeof(textW)); + ret = pLoadStringW(hResDll, i, textW, ARRAY_SIZE(textW)); + ok(ret > 0, "failed to load string resource\n"); + text_size = (ret + 1) * sizeof(WCHAR); + FreeLibrary(hResDll); + FreeLibrary(hUser32); + + ret = GetSystemDirectoryW(sysdirW, ARRAY_SIZE(sysdirW)); + ok(ret > 0, "GetSystemDirectoryW failed\n"); + ret = GetSystemDirectoryA(sysdir, ARRAY_SIZE(sysdir)); + ok(ret > 0, "GetSystemDirectoryA failed\n"); + + /* change the current direcoty to system32 */ + GetCurrentDirectoryW(ARRAY_SIZE(curdirW), curdirW); + SetCurrentDirectoryW(sysdirW); + + size = 0xdeadbeef; + ret = pRegLoadMUIStringW(hkey, tz_valueW, NULL, 0, &size, 0, NULL); + todo_wine ok(ret == ERROR_MORE_DATA, "got %d, expected ERROR_MORE_DATA\n", ret); + todo_wine ok(size == text_size, "got %u, expected %u\n", size, text_size); + + memset(bufW, 0xff, sizeof(bufW)); + ret = pRegLoadMUIStringW(hkey, tz_valueW, bufW, sizeof(WCHAR)+1, &size, 0, NULL); + todo_wine ok(ret == ERROR_INVALID_PARAMETER, "got %d, expected ERROR_INVALID_PARAMETER\n", ret); + todo_wine ok(bufW[0] == 0xffff, "got 0x%04x, expected 0xffff\n", bufW[0]); + + size = 0xdeadbeef; + memset(bufW, 0xff, sizeof(bufW)); + ret = pRegLoadMUIStringW(hkey, tz_valueW, bufW, sizeof(WCHAR)*2, &size, 0, NULL); + todo_wine ok(ret == ERROR_MORE_DATA, "got %d, expected ERROR_MORE_DATA\n", ret); + todo_wine ok(size == text_size || broken(size == text_size + sizeof(WCHAR) /* vista */), + "got %u, expected %u\n", size, text_size); + todo_wine ok(bufW[0] == 0xffff, "got 0x%04x, expected 0xffff\n", bufW[0]); + + size = 0xdeadbeef; + memset(bufW, 0xff, sizeof(bufW)); + ret = pRegLoadMUIStringW(hkey, tz_valueW, bufW, ARRAY_SIZE(bufW), &size, 0, NULL); + ok(ret == ERROR_SUCCESS, "got %d, expected ERROR_SUCCESS\n", ret); + todo_wine ok(size == text_size, "got %u, expected %u\n", size, text_size); + size = min(size, sizeof(bufW)); + todo_wine ok(!memcmp(textW, bufW, size), "got %s, expected %s\n", + wine_dbgstr_wn(bufW, size / sizeof(WCHAR)), wine_dbgstr_wn(textW, text_size / sizeof(WCHAR))); + + ret = pRegLoadMUIStringA(hkey, tz_value, buf, ARRAY_SIZE(buf), &size, 0, NULL); + todo_wine ok(ret == ERROR_CALL_NOT_IMPLEMENTED, "got %d, expected ERROR_CALL_NOT_IMPLEMENTED\n", ret); + + /* change the current direcoty to other than system32 directory */ + SetCurrentDirectoryA("\\"); + + size = 0xdeadbeef; + memset(bufW, 0xff, sizeof(bufW)); + ret = pRegLoadMUIStringW(hkey, tz_valueW, bufW, ARRAY_SIZE(bufW), &size, 0, sysdirW); + todo_wine ok(ret == ERROR_SUCCESS, "got %d, expected ERROR_SUCCESS\n", ret); + todo_wine ok(size == text_size, "got %u, expected %u\n", size, text_size); + size = min(size, sizeof(bufW)); + todo_wine ok(!memcmp(textW, bufW, size), "got %s, expected %s\n", + wine_dbgstr_wn(bufW, size / sizeof(WCHAR)), wine_dbgstr_wn(textW, text_size / sizeof(WCHAR))); + + ret = pRegLoadMUIStringA(hkey, tz_value, buf, ARRAY_SIZE(buf), &size, 0, sysdir); + todo_wine ok(ret == ERROR_CALL_NOT_IMPLEMENTED, "got %d, expected ERROR_CALL_NOT_IMPLEMENTED\n", ret); + + ret = pRegLoadMUIStringW(hkey, tz_valueW, bufW, ARRAY_SIZE(bufW), &size, 0, NULL); + todo_wine ok(ret == ERROR_FILE_NOT_FOUND, "got %d, expected ERROR_FILE_NOT_FOUND\n", ret); + + ret = pRegLoadMUIStringA(hkey, tz_value, buf, ARRAY_SIZE(buf), &size, 0, NULL); + todo_wine ok(ret == ERROR_CALL_NOT_IMPLEMENTED, "got %d, expected ERROR_CALL_NOT_IMPLEMENTED\n", ret); + + RegCloseKey(hkey); + SetCurrentDirectoryW(curdirW); +} + START_TEST(registry) { /* Load pointers for functions that are not available in all Windows versions */ @@ -3866,6 +3980,7 @@ START_TEST(registry) test_RegOpenCurrentUser(); test_RegNotifyChangeKeyValue(); test_RegQueryValueExPerformanceData(); + test_RegLoadMUIString(); /* cleanup */ delete_key( hkey_main );
1
0
0
0
Tim Schumacher : services: Allow reading binary registry values as DWORDs.
by Alexandre Julliard
13 May '19
13 May '19
Module: wine Branch: master Commit: 7b139bbb5cb1da4c443e8163c2a14adc8ba93a29 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7b139bbb5cb1da4c443e8163…
Author: Tim Schumacher <timschumi(a)gmx.de> Date: Sun May 12 23:12:41 2019 +0200 services: Allow reading binary registry values as DWORDs. Some programs/services actually save those values as a registry value of the type REG_BINARY. Signed-off-by: Tim Schumacher <timschumi(a)gmx.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/services/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/services/utils.c b/programs/services/utils.c index c59b003..f787990 100644 --- a/programs/services/utils.c +++ b/programs/services/utils.c @@ -149,7 +149,7 @@ DWORD load_reg_dword(HKEY hKey, LPCWSTR szValue, DWORD *output) return ERROR_SUCCESS; goto failed; } - if (type != REG_DWORD || size != sizeof(DWORD)) + if ((type != REG_DWORD && type != REG_BINARY) || size != sizeof(DWORD)) { err = ERROR_INVALID_DATATYPE; goto failed;
1
0
0
0
Józef Kucia : setupapi: Avoid debugstr buffer overflow.
by Alexandre Julliard
13 May '19
13 May '19
Module: wine Branch: master Commit: 88e28d971bd119f214e29d4ebfa819af9f18f5b7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=88e28d971bd119f214e29d4e…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Sun May 12 15:50:09 2019 +0200 setupapi: Avoid debugstr buffer overflow. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/parser.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/dlls/setupapi/parser.c b/dlls/setupapi/parser.c index c108689..69376c4 100644 --- a/dlls/setupapi/parser.c +++ b/dlls/setupapi/parser.c @@ -1853,13 +1853,8 @@ BOOL WINAPI SetupGetBinaryField( PINFCONTEXT context, DWORD index, BYTE *buffer, } buffer[i - index] = value; } - if (TRACE_ON(setupapi)) - { - TRACE( "%p/%p/%d/%d index %d returning", - context->Inf, context->CurrentInf, context->Section, context->Line, index ); - for (i = index; i < line->nb_fields; i++) TRACE( " %02x", buffer[i - index] ); - TRACE( "\n" ); - } + TRACE( "%p/%p/%d/%d index %d\n", + context->Inf, context->CurrentInf, context->Section, context->Line, index ); return TRUE; }
1
0
0
0
Zebediah Figura : strmbase: Get rid of the "pfnBreakConnect" field from BaseOutputPinFuncTable.
by Alexandre Julliard
13 May '19
13 May '19
Module: wine Branch: master Commit: df05902b96734005f1ab31e689b9ddb1455add32 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=df05902b96734005f1ab31e6…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat May 11 14:46:21 2019 -0500 strmbase: Get rid of the "pfnBreakConnect" field from BaseOutputPinFuncTable. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qcap/avico.c | 7 ------- dlls/qcap/avimux.c | 7 ------- dlls/qcap/smartteefilter.c | 16 ---------------- dlls/qcap/vfwcapture.c | 1 - dlls/quartz/filesource.c | 1 - dlls/quartz/parser.c | 1 - dlls/strmbase/pin.c | 25 ------------------------- dlls/strmbase/transform.c | 1 - dlls/winegstreamer/gstdemux.c | 1 - dlls/wineqtdecoder/qtsplitter.c | 1 - include/wine/strmbase.h | 3 --- 11 files changed, 64 deletions(-) diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index 49ac2d8..f8eade9 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -657,12 +657,6 @@ static HRESULT WINAPI AVICompressorOut_DecideAllocator(BaseOutputPin *base, return BaseOutputPinImpl_DecideAllocator(base, pPin, pAlloc); } -static HRESULT WINAPI AVICompressorOut_BreakConnect(BaseOutputPin *base) -{ - FIXME("(%p)\n", base); - return E_NOTIMPL; -} - static const BaseOutputPinFuncTable AVICompressorBaseOutputPinVtbl = { { NULL, @@ -671,7 +665,6 @@ static const BaseOutputPinFuncTable AVICompressorBaseOutputPinVtbl = { BaseOutputPinImpl_AttemptConnection, AVICompressorOut_DecideBufferSize, AVICompressorOut_DecideAllocator, - AVICompressorOut_BreakConnect }; IUnknown* WINAPI QCAP_createAVICompressor(IUnknown *outer, HRESULT *phr) diff --git a/dlls/qcap/avimux.c b/dlls/qcap/avimux.c index 2bb6e12..dd78d71 100644 --- a/dlls/qcap/avimux.c +++ b/dlls/qcap/avimux.c @@ -1292,12 +1292,6 @@ static HRESULT WINAPI AviMuxOut_DecideAllocator(BaseOutputPin *base, return IMemInputPin_NotifyAllocator(pPin, *pAlloc, TRUE); } -static HRESULT WINAPI AviMuxOut_BreakConnect(BaseOutputPin *base) -{ - FIXME("(%p)\n", base); - return E_NOTIMPL; -} - static const BaseOutputPinFuncTable AviMuxOut_BaseOutputFuncTable = { { AviMuxOut_CheckMediaType, @@ -1306,7 +1300,6 @@ static const BaseOutputPinFuncTable AviMuxOut_BaseOutputFuncTable = { AviMuxOut_AttemptConnection, NULL, AviMuxOut_DecideAllocator, - AviMuxOut_BreakConnect }; static inline AviMux* impl_from_out_IPin(IPin *iface) diff --git a/dlls/qcap/smartteefilter.c b/dlls/qcap/smartteefilter.c index 72794d0..4e22b95 100644 --- a/dlls/qcap/smartteefilter.c +++ b/dlls/qcap/smartteefilter.c @@ -498,13 +498,6 @@ static HRESULT WINAPI SmartTeeFilterCapture_DecideAllocator(BaseOutputPin *base, return IMemInputPin_NotifyAllocator(pPin, This->input->pAllocator, TRUE); } -static HRESULT WINAPI SmartTeeFilterCapture_BreakConnect(BaseOutputPin *base) -{ - SmartTeeFilter *This = impl_from_BasePin(&base->pin); - FIXME("(%p): stub\n", This); - return E_NOTIMPL; -} - static const BaseOutputPinFuncTable SmartTeeFilterCaptureFuncs = { { SmartTeeFilterCapture_CheckMediaType, @@ -513,7 +506,6 @@ static const BaseOutputPinFuncTable SmartTeeFilterCaptureFuncs = { BaseOutputPinImpl_AttemptConnection, NULL, SmartTeeFilterCapture_DecideAllocator, - SmartTeeFilterCapture_BreakConnect }; static ULONG WINAPI SmartTeeFilterPreview_AddRef(IPin *iface) @@ -589,13 +581,6 @@ static HRESULT WINAPI SmartTeeFilterPreview_DecideAllocator(BaseOutputPin *base, return IMemInputPin_NotifyAllocator(pPin, This->input->pAllocator, TRUE); } -static HRESULT WINAPI SmartTeeFilterPreview_BreakConnect(BaseOutputPin *base) -{ - SmartTeeFilter *This = impl_from_BasePin(&base->pin); - FIXME("(%p): stub\n", This); - return E_NOTIMPL; -} - static const BaseOutputPinFuncTable SmartTeeFilterPreviewFuncs = { { SmartTeeFilterPreview_CheckMediaType, @@ -604,7 +589,6 @@ static const BaseOutputPinFuncTable SmartTeeFilterPreviewFuncs = { BaseOutputPinImpl_AttemptConnection, NULL, SmartTeeFilterPreview_DecideAllocator, - SmartTeeFilterPreview_BreakConnect }; IUnknown* WINAPI QCAP_createSmartTeeFilter(IUnknown *outer, HRESULT *phr) { diff --git a/dlls/qcap/vfwcapture.c b/dlls/qcap/vfwcapture.c index 3d737bb..178609a 100644 --- a/dlls/qcap/vfwcapture.c +++ b/dlls/qcap/vfwcapture.c @@ -707,7 +707,6 @@ static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { BaseOutputPinImpl_AttemptConnection, VfwPin_DecideBufferSize, BaseOutputPinImpl_DecideAllocator, - BaseOutputPinImpl_BreakConnect }; static HRESULT diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 293914d..a54e948 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -914,7 +914,6 @@ static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { FileAsyncReaderPin_AttemptConnection, FileAsyncReaderPin_DecideBufferSize, BaseOutputPinImpl_DecideAllocator, - BaseOutputPinImpl_BreakConnect }; static HRESULT FileAsyncReader_Construct(HANDLE hFile, IBaseFilter * pBaseFilter, LPCRITICAL_SECTION pCritSec, IPin ** ppPin) diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index d92161f..c3b69cd 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -428,7 +428,6 @@ static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { BaseOutputPinImpl_AttemptConnection, Parser_OutputPin_DecideBufferSize, Parser_OutputPin_DecideAllocator, - NULL, }; HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PROPERTIES * props, const AM_MEDIA_TYPE * amt) diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c index 58fe0e5..2fa0b9a 100644 --- a/dlls/strmbase/pin.c +++ b/dlls/strmbase/pin.c @@ -639,31 +639,6 @@ HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin *This) return hr; } -/* replaces OutputPin_DeliverDisconnect */ -HRESULT WINAPI BaseOutputPinImpl_BreakConnect(BaseOutputPin *This) -{ - HRESULT hr; - - TRACE("(%p)->()\n", This); - - EnterCriticalSection(This->pin.pCritSec); - { - if (!This->pin.pConnectedTo || !This->pMemInputPin) - hr = VFW_E_NOT_CONNECTED; - else - { - hr = IMemAllocator_Decommit(This->pAllocator); - - if (SUCCEEDED(hr)) - hr = IPin_Disconnect(This->pin.pConnectedTo); - } - IPin_Disconnect(&This->pin.IPin_iface); - } - LeaveCriticalSection(This->pin.pCritSec); - - return hr; -} - HRESULT WINAPI BaseOutputPinImpl_InitAllocator(BaseOutputPin *This, IMemAllocator **pMemAlloc) { return CoCreateInstance(&CLSID_MemoryAllocator, NULL, CLSCTX_INPROC_SERVER, &IID_IMemAllocator, (LPVOID*)pMemAlloc); diff --git a/dlls/strmbase/transform.c b/dlls/strmbase/transform.c index 1ce6283..544b77a 100644 --- a/dlls/strmbase/transform.c +++ b/dlls/strmbase/transform.c @@ -165,7 +165,6 @@ static const BaseOutputPinFuncTable tf_output_BaseOutputFuncTable = { BaseOutputPinImpl_AttemptConnection, TransformFilter_Output_DecideBufferSize, BaseOutputPinImpl_DecideAllocator, - BaseOutputPinImpl_BreakConnect }; static HRESULT TransformFilter_Init(const IBaseFilterVtbl *pVtbl, const CLSID* pClsid, const TransformFilterFuncTable* pFuncsTable, TransformFilter* pTransformFilter) diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 1a369a1..32b871d 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1879,7 +1879,6 @@ static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { BaseOutputPinImpl_AttemptConnection, GSTOutPin_DecideBufferSize, GSTOutPin_DecideAllocator, - NULL, }; static HRESULT GST_AddPin(GSTImpl *This, const PIN_INFO *piOutput, const AM_MEDIA_TYPE *amt) diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index cd146db..4855069 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -1520,7 +1520,6 @@ static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { BaseOutputPinImpl_AttemptConnection, QTOutPin_DecideBufferSize, QTOutPin_DecideAllocator, - NULL, }; static const OutputQueueFuncTable output_OutputQueueFuncTable = { diff --git a/include/wine/strmbase.h b/include/wine/strmbase.h index cb7112b..120642c 100644 --- a/include/wine/strmbase.h +++ b/include/wine/strmbase.h @@ -67,7 +67,6 @@ typedef struct BaseOutputPin typedef HRESULT (WINAPI *BaseOutputPin_AttemptConnection)(BaseOutputPin *pin, IPin *peer, const AM_MEDIA_TYPE *mt); typedef HRESULT (WINAPI *BaseOutputPin_DecideBufferSize)(BaseOutputPin *This, IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES *ppropInputRequest); typedef HRESULT (WINAPI *BaseOutputPin_DecideAllocator)(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc); -typedef HRESULT (WINAPI *BaseOutputPin_BreakConnect)(BaseOutputPin * This); typedef struct BaseOutputPinFuncTable { BasePinFuncTable base; @@ -78,7 +77,6 @@ typedef struct BaseOutputPinFuncTable { BaseOutputPin_DecideBufferSize pfnDecideBufferSize; /* Required for BaseOutputPinImpl_AttemptConnection */ BaseOutputPin_DecideAllocator pfnDecideAllocator; - BaseOutputPin_BreakConnect pfnBreakConnect; } BaseOutputPinFuncTable; typedef struct BaseInputPin @@ -129,7 +127,6 @@ HRESULT WINAPI BaseOutputPinImpl_EndFlush(IPin * iface); HRESULT WINAPI BaseOutputPinImpl_GetDeliveryBuffer(BaseOutputPin * This, IMediaSample ** ppSample, REFERENCE_TIME * tStart, REFERENCE_TIME * tStop, DWORD dwFlags); HRESULT WINAPI BaseOutputPinImpl_Deliver(BaseOutputPin * This, IMediaSample * pSample); -HRESULT WINAPI BaseOutputPinImpl_BreakConnect(BaseOutputPin * This); HRESULT WINAPI BaseOutputPinImpl_Active(BaseOutputPin * This); HRESULT WINAPI BaseOutputPinImpl_Inactive(BaseOutputPin * This); HRESULT WINAPI BaseOutputPinImpl_InitAllocator(BaseOutputPin *This, IMemAllocator **pMemAlloc);
1
0
0
0
Zebediah Figura : wineqtdecoder: Make QTOutPin_BreakConnect() a local helper.
by Alexandre Julliard
13 May '19
13 May '19
Module: wine Branch: master Commit: 7c46e56ce2a0bd3524f6cad61a09fbf982d467f9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7c46e56ce2a0bd3524f6cad6…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat May 11 14:46:20 2019 -0500 wineqtdecoder: Make QTOutPin_BreakConnect() a local helper. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wineqtdecoder/qtsplitter.c | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/dlls/wineqtdecoder/qtsplitter.c b/dlls/wineqtdecoder/qtsplitter.c index 33edf25..cd146db 100644 --- a/dlls/wineqtdecoder/qtsplitter.c +++ b/dlls/wineqtdecoder/qtsplitter.c @@ -810,6 +810,25 @@ static const IBaseFilterVtbl QT_Vtbl = { BaseFilterImpl_QueryVendorInfo }; +static HRESULT break_source_connection(BaseOutputPin *pin) +{ + HRESULT hr; + + EnterCriticalSection(pin->pin.pCritSec); + if (!pin->pin.pConnectedTo || !pin->pMemInputPin) + hr = VFW_E_NOT_CONNECTED; + else + { + hr = IMemAllocator_Decommit(pin->pAllocator); + if (SUCCEEDED(hr)) + hr = IPin_Disconnect(pin->pin.pConnectedTo); + IPin_Disconnect(&pin->pin.IPin_iface); + } + LeaveCriticalSection(pin->pin.pCritSec); + + return hr; +} + /* * Input Pin */ @@ -821,7 +840,7 @@ static HRESULT QT_RemoveOutputPins(QTSplitter *This) if (This->pVideo_Pin) { OutputQueue_Destroy(This->pVideo_Pin->queue); - hr = BaseOutputPinImpl_BreakConnect(&This->pVideo_Pin->pin); + hr = break_source_connection(&This->pVideo_Pin->pin); TRACE("Disconnect: %08x\n", hr); IPin_Release(&This->pVideo_Pin->pin.pin.IPin_iface); This->pVideo_Pin = NULL; @@ -829,7 +848,7 @@ static HRESULT QT_RemoveOutputPins(QTSplitter *This) if (This->pAudio_Pin) { OutputQueue_Destroy(This->pAudio_Pin->queue); - hr = BaseOutputPinImpl_BreakConnect(&This->pAudio_Pin->pin); + hr = break_source_connection(&This->pAudio_Pin->pin); TRACE("Disconnect: %08x\n", hr); IPin_Release(&This->pAudio_Pin->pin.pin.IPin_iface); This->pAudio_Pin = NULL; @@ -1426,25 +1445,6 @@ static HRESULT WINAPI QTOutPin_DecideAllocator(BaseOutputPin *iface, IMemInputPi return hr; } -static HRESULT WINAPI QTOutPin_BreakConnect(BaseOutputPin *This) -{ - HRESULT hr; - - TRACE("(%p)->()\n", This); - - EnterCriticalSection(This->pin.pCritSec); - if (!This->pin.pConnectedTo || !This->pMemInputPin) - hr = VFW_E_NOT_CONNECTED; - else - { - hr = IPin_Disconnect(This->pin.pConnectedTo); - IPin_Disconnect(&This->pin.IPin_iface); - } - LeaveCriticalSection(This->pin.pCritSec); - - return hr; -} - static const IPinVtbl QT_OutputPin_Vtbl = { QTOutPin_QueryInterface, BasePinImpl_AddRef, @@ -1520,7 +1520,7 @@ static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { BaseOutputPinImpl_AttemptConnection, QTOutPin_DecideBufferSize, QTOutPin_DecideAllocator, - QTOutPin_BreakConnect + NULL, }; static const OutputQueueFuncTable output_OutputQueueFuncTable = {
1
0
0
0
Zebediah Figura : winegstreamer: Make GSTOutPin_BreakConnect() a local helper.
by Alexandre Julliard
13 May '19
13 May '19
Module: wine Branch: master Commit: 797672182be30fbd6d54732267cd2869f4af42c1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=797672182be30fbd6d547322…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat May 11 14:46:19 2019 -0500 winegstreamer: Make GSTOutPin_BreakConnect() a local helper. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/gstdemux.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/winegstreamer/gstdemux.c b/dlls/winegstreamer/gstdemux.c index 3c32107..1a369a1 100644 --- a/dlls/winegstreamer/gstdemux.c +++ b/dlls/winegstreamer/gstdemux.c @@ -1829,7 +1829,7 @@ static HRESULT WINAPI GSTOutPin_DecideAllocator(BaseOutputPin *iface, IMemInputP return hr; } -static HRESULT WINAPI GSTOutPin_BreakConnect(BaseOutputPin *This) +static HRESULT break_source_connection(BaseOutputPin *This) { HRESULT hr; @@ -1840,7 +1840,9 @@ static HRESULT WINAPI GSTOutPin_BreakConnect(BaseOutputPin *This) hr = VFW_E_NOT_CONNECTED; else { - hr = IPin_Disconnect(This->pin.pConnectedTo); + hr = IMemAllocator_Decommit(This->pAllocator); + if (SUCCEEDED(hr)) + hr = IPin_Disconnect(This->pin.pConnectedTo); IPin_Disconnect((IPin *)This); } LeaveCriticalSection(This->pin.pCritSec); @@ -1877,7 +1879,7 @@ static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { BaseOutputPinImpl_AttemptConnection, GSTOutPin_DecideBufferSize, GSTOutPin_DecideAllocator, - GSTOutPin_BreakConnect + NULL, }; static HRESULT GST_AddPin(GSTImpl *This, const PIN_INFO *piOutput, const AM_MEDIA_TYPE *amt) @@ -1920,7 +1922,7 @@ static HRESULT GST_RemoveOutputPins(GSTImpl *This) This->my_src = This->their_sink = NULL; for (i = 0; i < This->cStreams; i++) { - hr = BaseOutputPinImpl_BreakConnect(&This->ppPins[i]->pin); + hr = break_source_connection(&This->ppPins[i]->pin); TRACE("Disconnect: %08x\n", hr); IPin_Release(&This->ppPins[i]->pin.pin.IPin_iface); }
1
0
0
0
Zebediah Figura : quartz: Make Parser_OutputPin_BreakConnect() a local helper.
by Alexandre Julliard
13 May '19
13 May '19
Module: wine Branch: master Commit: f789c70dddf1e608f92ffb81dc5848abba1520e2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f789c70dddf1e608f92ffb81…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Sat May 11 14:46:18 2019 -0500 quartz: Make Parser_OutputPin_BreakConnect() a local helper. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/parser.c | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/dlls/quartz/parser.c b/dlls/quartz/parser.c index 9278a58..d92161f 100644 --- a/dlls/quartz/parser.c +++ b/dlls/quartz/parser.c @@ -46,7 +46,6 @@ static HRESULT WINAPI Parser_OutputPin_DecideBufferSize(BaseOutputPin *iface, IM static HRESULT WINAPI Parser_OutputPin_CheckMediaType(BasePin *pin, const AM_MEDIA_TYPE *pmt); static HRESULT WINAPI Parser_OutputPin_GetMediaType(BasePin *iface, int iPosition, AM_MEDIA_TYPE *pmt); static HRESULT WINAPI Parser_OutputPin_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc); -static HRESULT WINAPI Parser_OutputPin_BreakConnect(BaseOutputPin *This); static inline ParserImpl *impl_from_IMediaSeeking( IMediaSeeking *iface ) { @@ -429,7 +428,7 @@ static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { BaseOutputPinImpl_AttemptConnection, Parser_OutputPin_DecideBufferSize, Parser_OutputPin_DecideAllocator, - Parser_OutputPin_BreakConnect + NULL, }; HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PROPERTIES * props, const AM_MEDIA_TYPE * amt) @@ -468,6 +467,22 @@ HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PR return hr; } +static HRESULT WINAPI break_connection(IPin *iface) +{ + Parser_OutputPin *pin = unsafe_impl_Parser_OutputPin_from_IPin(iface); + HRESULT hr; + + if (!pin->pin.pin.pConnectedTo || !pin->pin.pMemInputPin) + hr = VFW_E_NOT_CONNECTED; + else + { + hr = IPin_Disconnect(pin->pin.pin.pConnectedTo); + IPin_Disconnect(iface); + } + + return hr; +} + static HRESULT Parser_RemoveOutputPins(ParserImpl * This) { /* NOTE: should be in critical section when calling this function */ @@ -483,7 +498,7 @@ static HRESULT Parser_RemoveOutputPins(ParserImpl * This) for (i = 0; i < This->cStreams; i++) { - hr = ((BaseOutputPin *)ppOldPins[i + 1])->pFuncsTable->pfnBreakConnect((BaseOutputPin *)ppOldPins[i + 1]); + hr = break_connection(ppOldPins[i + 1]); TRACE("Disconnect: %08x\n", hr); IPin_Release(ppOldPins[i + 1]); } @@ -609,26 +624,6 @@ static HRESULT WINAPI Parser_OutputPin_DecideAllocator(BaseOutputPin *iface, IMe return hr; } -static HRESULT WINAPI Parser_OutputPin_BreakConnect(BaseOutputPin *This) -{ - HRESULT hr; - - TRACE("(%p)->()\n", This); - - EnterCriticalSection(This->pin.pCritSec); - if (!This->pin.pConnectedTo || !This->pMemInputPin) - hr = VFW_E_NOT_CONNECTED; - else - { - hr = IPin_Disconnect(This->pin.pConnectedTo); - IPin_Disconnect(&This->pin.IPin_iface); - } - LeaveCriticalSection(This->pin.pCritSec); - - return hr; -} - - static HRESULT WINAPI Parser_OutputPin_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv) { Parser_OutputPin *This = unsafe_impl_Parser_OutputPin_from_IPin(iface);
1
0
0
0
← Newer
1
...
69
70
71
72
73
74
75
...
102
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Results per page:
10
25
50
100
200