Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
53e76f83
Commit
53e76f83
authored
Mar 08, 2007
by
Francois Gouget
Committed by
Alexandre Julliard
Mar 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Check file handles against INVALID_HANDLE_VALUE, not NULL.
Simplify the file handle handling in FTP_FtpPutFileW().
parent
d3245723
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
ftp.c
dlls/wininet/ftp.c
+3
-4
ftp.c
dlls/wininet/tests/ftp.c
+0
-2
No files found.
dlls/wininet/ftp.c
View file @
53e76f83
...
@@ -271,7 +271,7 @@ lend:
...
@@ -271,7 +271,7 @@ lend:
BOOL
WINAPI
FTP_FtpPutFileW
(
LPWININETFTPSESSIONW
lpwfs
,
LPCWSTR
lpszLocalFile
,
BOOL
WINAPI
FTP_FtpPutFileW
(
LPWININETFTPSESSIONW
lpwfs
,
LPCWSTR
lpszLocalFile
,
LPCWSTR
lpszNewRemoteFile
,
DWORD
dwFlags
,
DWORD
dwContext
)
LPCWSTR
lpszNewRemoteFile
,
DWORD
dwFlags
,
DWORD
dwContext
)
{
{
HANDLE
hFile
=
NULL
;
HANDLE
hFile
;
BOOL
bSuccess
=
FALSE
;
BOOL
bSuccess
=
FALSE
;
LPWININETAPPINFOW
hIC
=
NULL
;
LPWININETAPPINFOW
hIC
=
NULL
;
INT
nResCode
;
INT
nResCode
;
...
@@ -324,8 +324,7 @@ BOOL WINAPI FTP_FtpPutFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszLocalFile,
...
@@ -324,8 +324,7 @@ BOOL WINAPI FTP_FtpPutFileW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszLocalFile,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
}
if
(
hFile
)
CloseHandle
(
hFile
);
CloseHandle
(
hFile
);
return
bSuccess
;
return
bSuccess
;
}
}
...
@@ -1350,7 +1349,7 @@ lend:
...
@@ -1350,7 +1349,7 @@ lend:
if
(
lpwfs
->
lstnSocket
!=
-
1
)
if
(
lpwfs
->
lstnSocket
!=
-
1
)
closesocket
(
lpwfs
->
lstnSocket
);
closesocket
(
lpwfs
->
lstnSocket
);
if
(
hFile
)
if
(
INVALID_HANDLE_VALUE
!=
hFile
)
CloseHandle
(
hFile
);
CloseHandle
(
hFile
);
hIC
=
lpwfs
->
lpAppInfo
;
hIC
=
lpwfs
->
lpAppInfo
;
...
...
dlls/wininet/tests/ftp.c
View file @
53e76f83
...
@@ -380,7 +380,6 @@ static void test_getfile(void)
...
@@ -380,7 +380,6 @@ static void test_getfile(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
bRet
=
FtpGetFileA
(
hFtp
,
"welcome.msg"
,
"should_be_non_existing_deadbeef"
,
TRUE
,
FILE_ATTRIBUTE_NORMAL
,
FTP_TRANSFER_TYPE_UNKNOWN
,
0
);
bRet
=
FtpGetFileA
(
hFtp
,
"welcome.msg"
,
"should_be_non_existing_deadbeef"
,
TRUE
,
FILE_ATTRIBUTE_NORMAL
,
FTP_TRANSFER_TYPE_UNKNOWN
,
0
);
ok
(
bRet
==
FALSE
,
"Expected FtpGetFileA to fail
\n
"
);
ok
(
bRet
==
FALSE
,
"Expected FtpGetFileA to fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_FILE_EXISTS
,
ok
(
GetLastError
()
==
ERROR_FILE_EXISTS
,
"Expected ERROR_FILE_EXISTS, got %d
\n
"
,
GetLastError
());
"Expected ERROR_FILE_EXISTS, got %d
\n
"
,
GetLastError
());
...
@@ -388,7 +387,6 @@ static void test_getfile(void)
...
@@ -388,7 +387,6 @@ static void test_getfile(void)
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
bRet
=
FtpGetFileA
(
hFtp
,
"should_be_non_existing_deadbeef"
,
"should_be_non_existing_deadbeef"
,
TRUE
,
FILE_ATTRIBUTE_NORMAL
,
FTP_TRANSFER_TYPE_UNKNOWN
,
0
);
bRet
=
FtpGetFileA
(
hFtp
,
"should_be_non_existing_deadbeef"
,
"should_be_non_existing_deadbeef"
,
TRUE
,
FILE_ATTRIBUTE_NORMAL
,
FTP_TRANSFER_TYPE_UNKNOWN
,
0
);
ok
(
bRet
==
FALSE
,
"Expected FtpGetFileA to fail
\n
"
);
ok
(
bRet
==
FALSE
,
"Expected FtpGetFileA to fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_FILE_EXISTS
,
ok
(
GetLastError
()
==
ERROR_FILE_EXISTS
,
"Expected ERROR_FILE_EXISTS, got %d
\n
"
,
GetLastError
());
"Expected ERROR_FILE_EXISTS, got %d
\n
"
,
GetLastError
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment