Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
91312d7d
Commit
91312d7d
authored
Oct 29, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 30, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Move ftp FindNextFile implementation to ftp.c.
parent
2a50d52c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
87 deletions
+81
-87
ftp.c
dlls/wininet/ftp.c
+62
-4
internet.c
dlls/wininet/internet.c
+13
-78
internet.h
dlls/wininet/internet.h
+6
-5
No files found.
dlls/wininet/ftp.c
View file @
91312d7d
...
...
@@ -2706,6 +2706,64 @@ static void FTP_CloseSessionHandle(LPWININETHANDLEHEADER hdr)
/***********************************************************************
* FTP_FindNextFileW (Internal)
*
* Continues a file search from a previous call to FindFirstFile
*
* RETURNS
* TRUE on success
* FALSE on failure
*
*/
BOOL
WINAPI
FTP_FindNextFileW
(
LPWININETFTPFINDNEXTW
lpwh
,
LPVOID
lpvFindData
)
{
BOOL
bSuccess
=
TRUE
;
LPWIN32_FIND_DATAW
lpFindFileData
;
TRACE
(
"index(%d) size(%d)
\n
"
,
lpwh
->
index
,
lpwh
->
size
);
assert
(
lpwh
->
hdr
.
htype
==
WH_HFTPFINDNEXT
);
/* Clear any error information */
INTERNET_SetLastError
(
0
);
assert
(
lpwh
->
hdr
.
lpwhparent
->
htype
==
WH_HFTPSESSION
);
lpFindFileData
=
(
LPWIN32_FIND_DATAW
)
lpvFindData
;
ZeroMemory
(
lpFindFileData
,
sizeof
(
WIN32_FIND_DATAA
));
if
(
lpwh
->
index
>=
lpwh
->
size
)
{
INTERNET_SetLastError
(
ERROR_NO_MORE_FILES
);
bSuccess
=
FALSE
;
goto
lend
;
}
FTP_ConvertFileProp
(
&
lpwh
->
lpafp
[
lpwh
->
index
],
lpFindFileData
);
lpwh
->
index
++
;
TRACE
(
"
\n
Name: %s
\n
Size: %d
\n
"
,
debugstr_w
(
lpFindFileData
->
cFileName
),
lpFindFileData
->
nFileSizeLow
);
lend:
if
(
lpwh
->
hdr
.
dwFlags
&
INTERNET_FLAG_ASYNC
)
{
INTERNET_ASYNC_RESULT
iar
;
iar
.
dwResult
=
(
DWORD
)
bSuccess
;
iar
.
dwError
=
iar
.
dwError
=
bSuccess
?
ERROR_SUCCESS
:
INTERNET_GetLastError
();
INTERNET_SendCallback
(
&
lpwh
->
hdr
,
lpwh
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
return
bSuccess
;
}
/***********************************************************************
* FTP_CloseFindNextHandle (internal)
*
* Deallocate session handle
...
...
@@ -2717,7 +2775,7 @@ static void FTP_CloseSessionHandle(LPWININETHANDLEHEADER hdr)
*/
static
void
FTP_CloseFindNextHandle
(
LPWININETHANDLEHEADER
hdr
)
{
LPWININETF
INDNEXTW
lpwfn
=
(
LPWININET
FINDNEXTW
)
hdr
;
LPWININETF
TPFINDNEXTW
lpwfn
=
(
LPWININETFTP
FINDNEXTW
)
hdr
;
DWORD
i
;
TRACE
(
"
\n
"
);
...
...
@@ -2777,7 +2835,7 @@ static HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONW lpwfs, INT nSocket, LP
{
DWORD
dwSize
=
0
;
LPFILEPROPERTIESW
lpafp
=
NULL
;
LPWININETFINDNEXTW
lpwfn
=
NULL
;
LPWININETF
TPF
INDNEXTW
lpwfn
=
NULL
;
HINTERNET
handle
=
0
;
TRACE
(
"(%p,%d,%s,%p,%d)
\n
"
,
lpwfs
,
nSocket
,
debugstr_w
(
lpszSearchFile
),
lpFindFileData
,
dwContext
);
...
...
@@ -2787,10 +2845,10 @@ static HINTERNET FTP_ReceiveFileList(LPWININETFTPSESSIONW lpwfs, INT nSocket, LP
if
(
lpFindFileData
)
FTP_ConvertFileProp
(
lpafp
,
lpFindFileData
);
lpwfn
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
WININETFINDNEXTW
));
lpwfn
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
WININETF
TPF
INDNEXTW
));
if
(
lpwfn
)
{
lpwfn
->
hdr
.
htype
=
WH_HFINDNEXT
;
lpwfn
->
hdr
.
htype
=
WH_HF
TPF
INDNEXT
;
lpwfn
->
hdr
.
lpwhparent
=
WININET_AddRef
(
&
lpwfs
->
hdr
);
lpwfn
->
hdr
.
dwContext
=
dwContext
;
lpwfn
->
hdr
.
dwRefCount
=
1
;
...
...
dlls/wininet/internet.c
View file @
91312d7d
...
...
@@ -85,7 +85,6 @@ typedef struct
}
WITHREADERROR
,
*
LPWITHREADERROR
;
static
VOID
INTERNET_CloseHandle
(
LPWININETHANDLEHEADER
hdr
);
BOOL
WINAPI
INTERNET_FindNextFileW
(
LPWININETFINDNEXTW
lpwh
,
LPVOID
lpvFindData
);
HINTERNET
WINAPI
INTERNET_InternetOpenUrlW
(
LPWININETAPPINFOW
hIC
,
LPCWSTR
lpszUrl
,
LPCWSTR
lpszHeaders
,
DWORD
dwHeadersLength
,
DWORD
dwFlags
,
DWORD
dwContext
);
static
VOID
INTERNET_ExecuteWork
(
void
);
...
...
@@ -943,14 +942,15 @@ BOOL WINAPI InternetFindNextFileA(HINTERNET hFind, LPVOID lpvFindData)
BOOL
WINAPI
InternetFindNextFileW
(
HINTERNET
hFind
,
LPVOID
lpvFindData
)
{
LPWININETAPPINFOW
hIC
=
NULL
;
LPWININETFINDNEXTW
lpwh
;
LPWININETF
TPF
INDNEXTW
lpwh
;
BOOL
bSuccess
=
FALSE
;
TRACE
(
"
\n
"
);
lpwh
=
(
LPWININETFINDNEXTW
)
WININET_GetObject
(
hFind
);
if
(
NULL
==
lpwh
||
lpwh
->
hdr
.
htype
!=
WH_HFINDNEXT
)
lpwh
=
(
LPWININETF
TPF
INDNEXTW
)
WININET_GetObject
(
hFind
);
if
(
NULL
==
lpwh
||
lpwh
->
hdr
.
htype
!=
WH_HF
TPF
INDNEXT
)
{
FIXME
(
"Only FTP supported
\n
"
);
INTERNET_SetLastError
(
ERROR_INTERNET_INCORRECT_HANDLE_TYPE
);
goto
lend
;
}
...
...
@@ -959,18 +959,18 @@ BOOL WINAPI InternetFindNextFileW(HINTERNET hFind, LPVOID lpvFindData)
if
(
hIC
->
hdr
.
dwFlags
&
INTERNET_FLAG_ASYNC
)
{
WORKREQUEST
workRequest
;
struct
WORKREQ_
INTERNET
FINDNEXTW
*
req
;
struct
WORKREQ_
FTP
FINDNEXTW
*
req
;
workRequest
.
asyncall
=
INTERNET
FINDNEXTW
;
workRequest
.
asyncall
=
FTP
FINDNEXTW
;
workRequest
.
hdr
=
WININET_AddRef
(
&
lpwh
->
hdr
);
req
=
&
workRequest
.
u
.
Internet
FindNextW
;
req
=
&
workRequest
.
u
.
Ftp
FindNextW
;
req
->
lpFindFileData
=
lpvFindData
;
bSuccess
=
INTERNET_AsyncCall
(
&
workRequest
);
}
else
{
bSuccess
=
INTERNET
_FindNextFileW
(
lpwh
,
lpvFindData
);
bSuccess
=
FTP
_FindNextFileW
(
lpwh
,
lpvFindData
);
}
lend:
if
(
lpwh
)
...
...
@@ -979,71 +979,6 @@ lend:
}
/***********************************************************************
* INTERNET_FindNextFileW (Internal)
*
* Continues a file search from a previous call to FindFirstFile
*
* RETURNS
* TRUE on success
* FALSE on failure
*
*/
BOOL
WINAPI
INTERNET_FindNextFileW
(
LPWININETFINDNEXTW
lpwh
,
LPVOID
lpvFindData
)
{
BOOL
bSuccess
=
TRUE
;
LPWIN32_FIND_DATAW
lpFindFileData
;
TRACE
(
"
\n
"
);
assert
(
lpwh
->
hdr
.
htype
==
WH_HFINDNEXT
);
/* Clear any error information */
INTERNET_SetLastError
(
0
);
if
(
lpwh
->
hdr
.
lpwhparent
->
htype
!=
WH_HFTPSESSION
)
{
FIXME
(
"Only FTP find next supported
\n
"
);
INTERNET_SetLastError
(
ERROR_INTERNET_INCORRECT_HANDLE_TYPE
);
return
FALSE
;
}
TRACE
(
"index(%d) size(%d)
\n
"
,
lpwh
->
index
,
lpwh
->
size
);
lpFindFileData
=
(
LPWIN32_FIND_DATAW
)
lpvFindData
;
ZeroMemory
(
lpFindFileData
,
sizeof
(
WIN32_FIND_DATAA
));
if
(
lpwh
->
index
>=
lpwh
->
size
)
{
INTERNET_SetLastError
(
ERROR_NO_MORE_FILES
);
bSuccess
=
FALSE
;
goto
lend
;
}
FTP_ConvertFileProp
(
&
lpwh
->
lpafp
[
lpwh
->
index
],
lpFindFileData
);
lpwh
->
index
++
;
TRACE
(
"
\n
Name: %s
\n
Size: %d
\n
"
,
debugstr_w
(
lpFindFileData
->
cFileName
),
lpFindFileData
->
nFileSizeLow
);
lend:
if
(
lpwh
->
hdr
.
dwFlags
&
INTERNET_FLAG_ASYNC
)
{
INTERNET_ASYNC_RESULT
iar
;
iar
.
dwResult
=
(
DWORD
)
bSuccess
;
iar
.
dwError
=
iar
.
dwError
=
bSuccess
?
ERROR_SUCCESS
:
INTERNET_GetLastError
();
INTERNET_SendCallback
(
&
lpwh
->
hdr
,
lpwh
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
return
bSuccess
;
}
/***********************************************************************
* INTERNET_CloseHandle (internal)
*
* Close internet handle
...
...
@@ -3439,15 +3374,15 @@ static VOID INTERNET_ExecuteWork(void)
}
break
;
case
INTERNET
FINDNEXTW
:
case
FTP
FINDNEXTW
:
{
struct
WORKREQ_
INTERNET
FINDNEXTW
*
req
;
LPWININETF
INDNEXTW
lpwh
=
(
LPWININET
FINDNEXTW
)
workRequest
.
hdr
;
struct
WORKREQ_
FTP
FINDNEXTW
*
req
;
LPWININETF
TPFINDNEXTW
lpwh
=
(
LPWININETFTP
FINDNEXTW
)
workRequest
.
hdr
;
TRACE
(
"INTERNETFINDNEXTW %p
\n
"
,
lpwh
);
req
=
&
workRequest
.
u
.
Internet
FindNextW
;
INTERNET
_FindNextFileW
(
lpwh
,
req
->
lpFindFileData
);
req
=
&
workRequest
.
u
.
Ftp
FindNextW
;
FTP
_FindNextFileW
(
lpwh
,
req
->
lpFindFileData
);
}
break
;
...
...
dlls/wininet/internet.h
View file @
91312d7d
...
...
@@ -124,7 +124,7 @@ typedef enum
WH_HGOPHERSESSION
=
INTERNET_HANDLE_TYPE_CONNECT_GOPHER
,
WH_HHTTPSESSION
=
INTERNET_HANDLE_TYPE_CONNECT_HTTP
,
WH_HFILE
=
INTERNET_HANDLE_TYPE_FTP_FILE
,
WH_HFINDNEXT
=
INTERNET_HANDLE_TYPE_FTP_FIND
,
WH_HF
TPF
INDNEXT
=
INTERNET_HANDLE_TYPE_FTP_FIND
,
WH_HHTTPREQ
=
INTERNET_HANDLE_TYPE_HTTP_REQUEST
,
}
WH_TYPE
;
...
...
@@ -241,7 +241,7 @@ typedef struct
DWORD
index
;
DWORD
size
;
LPFILEPROPERTIESW
lpafp
;
}
WININETF
INDNEXTW
,
*
LPWININET
FINDNEXTW
;
}
WININETF
TPFINDNEXTW
,
*
LPWININETFTP
FINDNEXTW
;
typedef
enum
{
...
...
@@ -255,7 +255,7 @@ typedef enum
FTPDELETEFILEW
,
FTPREMOVEDIRECTORYW
,
FTPRENAMEFILEW
,
INTERNET
FINDNEXTW
,
FTP
FINDNEXTW
,
HTTPSENDREQUESTW
,
HTTPOPENREQUESTW
,
SENDCALLBACK
,
...
...
@@ -329,7 +329,7 @@ struct WORKREQ_FTPRENAMEFILEW
LPWSTR
lpszDestFile
;
};
struct
WORKREQ_
INTERNET
FINDNEXTW
struct
WORKREQ_
FTP
FINDNEXTW
{
LPWIN32_FIND_DATAW
lpFindFileData
;
};
...
...
@@ -394,7 +394,7 @@ typedef struct WORKREQ
struct
WORKREQ_FTPDELETEFILEW
FtpDeleteFileW
;
struct
WORKREQ_FTPREMOVEDIRECTORYW
FtpRemoveDirectoryW
;
struct
WORKREQ_FTPRENAMEFILEW
FtpRenameFileW
;
struct
WORKREQ_
INTERNETFINDNEXTW
Internet
FindNextW
;
struct
WORKREQ_
FTPFINDNEXTW
Ftp
FindNextW
;
struct
WORKREQ_HTTPOPENREQUESTW
HttpOpenRequestW
;
struct
WORKREQ_HTTPSENDREQUESTW
HttpSendRequestW
;
struct
WORKREQ_SENDCALLBACK
SendCallback
;
...
...
@@ -441,6 +441,7 @@ BOOLAPI FTP_FtpSetCurrentDirectoryW(LPWININETFTPSESSIONW lpwfs, LPCWSTR lpszDire
BOOLAPI
FTP_FtpCreateDirectoryW
(
LPWININETFTPSESSIONW
lpwfs
,
LPCWSTR
lpszDirectory
);
INTERNETAPI
HINTERNET
WINAPI
FTP_FtpFindFirstFileW
(
LPWININETFTPSESSIONW
lpwfs
,
LPCWSTR
lpszSearchFile
,
LPWIN32_FIND_DATAW
lpFindFileData
,
DWORD
dwFlags
,
DWORD
dwContext
);
BOOL
WINAPI
FTP_FindNextFileW
(
LPWININETFTPFINDNEXTW
lpwh
,
LPVOID
lpvFindData
);
BOOLAPI
FTP_FtpGetCurrentDirectoryW
(
LPWININETFTPSESSIONW
lpwfs
,
LPWSTR
lpszCurrentDirectory
,
LPDWORD
lpdwCurrentDirectory
);
BOOL
FTP_ConvertFileProp
(
LPFILEPROPERTIESW
lpafp
,
LPWIN32_FIND_DATAW
lpFindFileData
);
...
...
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