[3/3] wininet: Reorder error setting in FtpSetCurrentDirectoryW

Zac Brown zac at zacbrown.org
Tue Dec 4 09:01:30 CST 2007


Hi,

Changelog:
* Reorder error setting in FtpSetCurrentDirectoryW to reflect Windows XP behavior
* remove todo_block(s) pertaining to this bug in test case



---
 dlls/wininet/ftp.c       |   12 ++++++------
 dlls/wininet/tests/ftp.c |    1 -
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c
index b31c86c..d7fed70 100644
--- a/dlls/wininet/ftp.c
+++ b/dlls/wininet/ftp.c
@@ -386,12 +386,6 @@ BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
     LPWININETAPPINFOW hIC = NULL;
     BOOL r = FALSE;

-    if (!lpszDirectory)
-    {
-        INTERNET_SetLastError(ERROR_INVALID_PARAMETER);
-        goto lend;
-    }
-
     lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hConnect );
     if (NULL == lpwfs)
     {
@@ -405,6 +399,12 @@ BOOL WINAPI FtpSetCurrentDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
         goto lend;
     }

+    if (!lpszDirectory)
+    {
+        INTERNET_SetLastError(ERROR_INVALID_PARAMETER);
+        goto lend;
+    }
+
     if (lpwfs->download_in_progress != NULL)
     {
         INTERNET_SetLastError(ERROR_FTP_TRANSFER_IN_PROGRESS);
diff --git a/dlls/wininet/tests/ftp.c b/dlls/wininet/tests/ftp.c
index 1bd8aa5..72f1c6b 100644
--- a/dlls/wininet/tests/ftp.c
+++ b/dlls/wininet/tests/ftp.c
@@ -786,7 +786,6 @@ test_set_current_dir(HINTERNET hFtp, HINTERNET hConnect)
     SetLastError(0xdeadbeef);
     bRet = FtpSetCurrentDirectoryA(NULL, NULL);
     ok ( bRet == FALSE, "Expected FtpSetCurrentDirectoryA to fail\n");
-todo_wine
     ok ( GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got: %d\n", GetLastError());

     /* test with NULL handle */
-- 
1.5.2.5



More information about the wine-patches mailing list