advapi32: Remove useless RegLoadMUIStringA implementation.

This commit avoids brokeness in advance.
Otherwise, it will be broken when we support ERROR_MORE_DATA in
RegLoadMUIStringW.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2019-05-09 22:07:32 +09:00 committed by Alexandre Julliard
parent bfdfe85229
commit 2d9a7cd39d
2 changed files with 5 additions and 33 deletions

View File

@ -3280,40 +3280,12 @@ cleanup:
/******************************************************************************
* RegLoadMUIStringA [ADVAPI32.@]
*
* See RegLoadMUIStringW
* Not implemented on native.
*/
LSTATUS WINAPI RegLoadMUIStringA(HKEY hKey, LPCSTR pszValue, LPSTR pszBuffer, DWORD cbBuffer,
LPDWORD pcbData, DWORD dwFlags, LPCSTR pszBaseDir)
{
UNICODE_STRING valueW, baseDirW;
WCHAR *pwszBuffer;
DWORD cbData = cbBuffer * sizeof(WCHAR);
LONG result;
valueW.Buffer = baseDirW.Buffer = pwszBuffer = NULL;
if (!RtlCreateUnicodeStringFromAsciiz(&valueW, pszValue) ||
!RtlCreateUnicodeStringFromAsciiz(&baseDirW, pszBaseDir) ||
!(pwszBuffer = heap_alloc(cbData)))
{
result = ERROR_NOT_ENOUGH_MEMORY;
goto cleanup;
}
result = RegLoadMUIStringW(hKey, valueW.Buffer, pwszBuffer, cbData, NULL, dwFlags,
baseDirW.Buffer);
if (result == ERROR_SUCCESS) {
cbData = WideCharToMultiByte(CP_ACP, 0, pwszBuffer, -1, pszBuffer, cbBuffer, NULL, NULL);
if (pcbData)
*pcbData = cbData;
}
cleanup:
heap_free(pwszBuffer);
RtlFreeUnicodeString(&baseDirW);
RtlFreeUnicodeString(&valueW);
return result;
return ERROR_CALL_NOT_IMPLEMENTED;
}
/******************************************************************************

View File

@ -3917,7 +3917,7 @@ static void test_RegLoadMUIString(void)
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);
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("\\");
@ -3932,13 +3932,13 @@ static void test_RegLoadMUIString(void)
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);
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);
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);
ok(ret == ERROR_CALL_NOT_IMPLEMENTED, "got %d, expected ERROR_CALL_NOT_IMPLEMENTED\n", ret);
RegCloseKey(hkey);
SetCurrentDirectoryW(curdirW);