Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com ---
FindFirstFileW sets last error to ERROR_PATH_NOT_FOUND in this case. Tests seem to prove that this is correct, but _Open_dir sets err to ERROR_BAD_PATHNAME.
dlls/msvcp120/tests/msvcp120.c | 2 +- dlls/msvcp140/tests/msvcp140.c | 2 +- dlls/msvcp90/ios.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c index ac38aa61a0..6d72f9fd68 100644 --- a/dlls/msvcp120/tests/msvcp120.c +++ b/dlls/msvcp120/tests/msvcp120.c @@ -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);
diff --git a/dlls/msvcp140/tests/msvcp140.c b/dlls/msvcp140/tests/msvcp140.c index 229741a52d..1bae2b914d 100644 --- a/dlls/msvcp140/tests/msvcp140.c +++ b/dlls/msvcp140/tests/msvcp140.c @@ -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));
diff --git a/dlls/msvcp90/ios.c b/dlls/msvcp90/ios.c index bf7eea2e6f..32bd2e7ccd 100644 --- a/dlls/msvcp90/ios.c +++ b/dlls/msvcp90/ios.c @@ -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)) {
Signed-off-by: Piotr Caban piotr@codeweavers.com
On 1/25/19 1:59 AM, Gijs Vermeulen wrote:
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c index ac38aa61a0..6d72f9fd68 100644 --- a/dlls/msvcp120/tests/msvcp120.c +++ b/dlls/msvcp120/tests/msvcp120.c @@ -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);
While you're at it, could you please also change the memset in tests to fill first_file_name buffer with e.g. 0xff bytes and fix the implementation?
Thanks, Piotr
Hi Piotr,
Op vr 25 jan. 2019 om 12:01 schreef Piotr Caban piotr@codeweavers.com:
While you're at it, could you please also change the memset in tests to fill first_file_name buffer with e.g. 0xff bytes and fix the implementation?
Thanks, Piotr
Thank you for the quick review. I have resent this patch with an extra patch to fix what you mentioned.
Kind regards, Gijs