msvcp: Set correct error code on non-existing path in _Open_dir.

Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gijs Vermeulen 2019-01-25 17:51:40 +01:00 committed by Alexandre Julliard
parent 39876236e8
commit 64aba27f6a
3 changed files with 3 additions and 3 deletions

View File

@ -1837,7 +1837,7 @@ static void test_tr2_sys__dir_operation(void)
result_handle = file;
result_handle = p_tr2_sys__Open_dir(first_file_name, "not_exist", &err, &type);
ok(result_handle == NULL, "tr2_sys__Open_dir(): expect: NULL, got %p\n", result_handle);
todo_wine ok(err == ERROR_BAD_PATHNAME, "tr2_sys__Open_dir(): expect: ERROR_BAD_PATHNAME, got %d\n", err);
ok(err == ERROR_BAD_PATHNAME, "tr2_sys__Open_dir(): expect: ERROR_BAD_PATHNAME, got %d\n", err);
ok((int)type == 0xdeadbeef, "tr2_sys__Open_dir(): expect: 0xdeadbeef, got %d\n", type);
ok(!*first_file_name, "tr2_sys__Open_dir(): expect: 0, got %s\n", first_file_name);

View File

@ -983,7 +983,7 @@ static void test_dir_operation(void)
result_handle = file;
result_handle = p_Open_dir(first_file_name, not_existW, &err, &type);
ok(result_handle == NULL, "_Open_dir(): expect: NULL, got %p\n", result_handle);
todo_wine ok(err == ERROR_BAD_PATHNAME, "_Open_dir(): expect: ERROR_BAD_PATHNAME, got %d\n", err);
ok(err == ERROR_BAD_PATHNAME, "_Open_dir(): expect: ERROR_BAD_PATHNAME, got %d\n", err);
ok((int)type == 0xdeadbeef, "_Open_dir(): expect: 0xdeadbeef, got %d\n", type);
ok(!*first_file_name, "_Open_dir(): expect: 0, got %s\n", wine_dbgstr_w(first_file_name));

View File

@ -14983,7 +14983,7 @@ void* __cdecl tr2_sys__Open_dir_wchar(wchar_t* target, wchar_t const* dest, int*
handle = FindFirstFileW(temppath, &data);
if(handle == INVALID_HANDLE_VALUE) {
*err_code = GetLastError();
*err_code = ERROR_BAD_PATHNAME;
return NULL;
}
while(!wcscmp(data.cFileName, dot) || !wcscmp(data.cFileName, dotdot)) {