mirror of
https://github.com/reactos/wine.git
synced 2025-04-02 16:12:04 +00:00
wininet/ftp.c: Fix some returned error codes.
This commit is contained in:
parent
4f976741a4
commit
1f5e5a2b75
@ -507,12 +507,24 @@ BOOL WINAPI FtpCreateDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
|
|||||||
BOOL r = FALSE;
|
BOOL r = FALSE;
|
||||||
|
|
||||||
lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hConnect );
|
lpwfs = (LPWININETFTPSESSIONW) WININET_GetObject( hConnect );
|
||||||
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 (!lpszDirectory)
|
||||||
|
{
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
@ -531,8 +543,7 @@ BOOL WINAPI FtpCreateDirectoryW(HINTERNET hConnect, LPCWSTR lpszDirectory)
|
|||||||
r = FTP_FtpCreateDirectoryW(lpwfs, lpszDirectory);
|
r = FTP_FtpCreateDirectoryW(lpwfs, lpszDirectory);
|
||||||
}
|
}
|
||||||
lend:
|
lend:
|
||||||
if( lpwfs )
|
WININET_Release( &lpwfs->hdr );
|
||||||
WININET_Release( &lpwfs->hdr );
|
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,6 @@ static void test_createdir(void)
|
|||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
bRet = FtpCreateDirectoryA(NULL, "new_directory_deadbeef");
|
bRet = FtpCreateDirectoryA(NULL, "new_directory_deadbeef");
|
||||||
ok ( bRet == FALSE, "Expected FtpCreateDirectoryA to fail\n");
|
ok ( bRet == FALSE, "Expected FtpCreateDirectoryA 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());
|
||||||
|
|
||||||
@ -125,7 +124,6 @@ static void test_createdir(void)
|
|||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
bRet = FtpCreateDirectoryA(hFtp, NULL);
|
bRet = FtpCreateDirectoryA(hFtp, NULL);
|
||||||
ok ( bRet == FALSE, "Expected FtpCreateDirectoryA to fail\n");
|
ok ( bRet == FALSE, "Expected FtpCreateDirectoryA 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…
x
Reference in New Issue
Block a user