wininet/ftp.c: Fix some returned error codes.
This commit is contained in:
parent
31bbe886f0
commit
6c05048756
|
@ -1384,12 +1384,24 @@ BOOL WINAPI FtpDeleteFileW(HINTERNET hFtpSession, LPCWSTR lpszFileName)
|
||||||
BOOL r = FALSE;
|
BOOL r = FALSE;
|
||||||
|
|
||||||
lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hFtpSession );
|
lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hFtpSession );
|
||||||
if (NULL == lpwfs || WH_HFTPSESSION != lpwfs->hdr.htype)
|
if (!lpwfs)
|
||||||
|
{
|
||||||
|
INTERNET_SetLastError(ERROR_INVALID_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WH_HFTPSESSION != lpwfs->hdr.htype)
|
||||||
{
|
{
|
||||||
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
|
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
|
||||||
goto lend;
|
goto lend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!lpszFileName)
|
||||||
|
{
|
||||||
|
INTERNET_SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
goto lend;
|
||||||
|
}
|
||||||
|
|
||||||
hIC = lpwfs->lpAppInfo;
|
hIC = lpwfs->lpAppInfo;
|
||||||
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
|
if (hIC->hdr.dwFlags & INTERNET_FLAG_ASYNC)
|
||||||
{
|
{
|
||||||
|
@ -1409,7 +1421,6 @@ BOOL WINAPI FtpDeleteFileW(HINTERNET hFtpSession, LPCWSTR lpszFileName)
|
||||||
}
|
}
|
||||||
|
|
||||||
lend:
|
lend:
|
||||||
if( lpwfs )
|
|
||||||
WININET_Release( &lpwfs->hdr );
|
WININET_Release( &lpwfs->hdr );
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
|
|
@ -167,7 +167,6 @@ static void test_deletefile(void)
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
bRet = FtpDeleteFileA(NULL, "non_existent_file_deadbeef");
|
bRet = FtpDeleteFileA(NULL, "non_existent_file_deadbeef");
|
||||||
ok ( bRet == FALSE, "Expected FtpDeleteFileA to fail\n");
|
ok ( bRet == FALSE, "Expected FtpDeleteFileA to fail\n");
|
||||||
todo_wine
|
|
||||||
ok ( GetLastError() == ERROR_INVALID_HANDLE,
|
ok ( GetLastError() == ERROR_INVALID_HANDLE,
|
||||||
"Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
|
"Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
|
||||||
|
|
||||||
|
@ -186,7 +185,6 @@ static void test_deletefile(void)
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
bRet = FtpDeleteFileA(hFtp, NULL);
|
bRet = FtpDeleteFileA(hFtp, NULL);
|
||||||
ok ( bRet == FALSE, "Expected FtpDeleteFileA to fail\n");
|
ok ( bRet == FALSE, "Expected FtpDeleteFileA to fail\n");
|
||||||
todo_wine
|
|
||||||
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
|
ok ( GetLastError() == ERROR_INVALID_PARAMETER,
|
||||||
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue