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
1d2d2d6b
Commit
1d2d2d6b
authored
May 25, 2004
by
Kevin Koltzau
Committed by
Alexandre Julliard
May 25, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move all FTP functions to unicode.
Improve FTP LIST parsing.
parent
94d74b5f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
131 additions
and
87 deletions
+131
-87
ftp.c
dlls/wininet/ftp.c
+0
-0
internet.c
dlls/wininet/internet.c
+0
-0
internet.h
dlls/wininet/internet.h
+108
-71
utility.c
dlls/wininet/utility.c
+17
-10
wininet.spec
dlls/wininet/wininet.spec
+6
-6
No files found.
dlls/wininet/ftp.c
View file @
1d2d2d6b
This diff is collapsed.
Click to expand it.
dlls/wininet/internet.c
View file @
1d2d2d6b
This diff is collapsed.
Click to expand it.
dlls/wininet/internet.h
View file @
1d2d2d6b
...
...
@@ -70,6 +70,42 @@ inline static LPWSTR WININET_strdupW( LPCWSTR str )
return
ret
;
}
inline
static
LPWSTR
WININET_strdup_AtoW
(
LPCSTR
str
)
{
int
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
LPWSTR
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
);
if
(
ret
)
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
return
ret
;
}
inline
static
LPSTR
WININET_strdup_WtoA
(
LPCWSTR
str
)
{
int
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
LPSTR
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
if
(
ret
)
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
,
NULL
,
NULL
);
return
ret
;
}
inline
static
void
WININET_find_data_WtoA
(
LPWIN32_FIND_DATAW
dataW
,
LPWIN32_FIND_DATAA
dataA
)
{
dataA
->
dwFileAttributes
=
dataW
->
dwFileAttributes
;
dataA
->
ftCreationTime
=
dataW
->
ftCreationTime
;
dataA
->
ftLastAccessTime
=
dataW
->
ftLastAccessTime
;
dataA
->
ftLastWriteTime
=
dataW
->
ftLastWriteTime
;
dataA
->
nFileSizeHigh
=
dataW
->
nFileSizeHigh
;
dataA
->
nFileSizeLow
=
dataW
->
nFileSizeLow
;
dataA
->
dwReserved0
=
dataW
->
dwReserved0
;
dataA
->
dwReserved1
=
dataW
->
dwReserved1
;
WideCharToMultiByte
(
CP_ACP
,
0
,
dataW
->
cFileName
,
-
1
,
dataA
->
cFileName
,
sizeof
(
dataA
->
cFileName
),
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
dataW
->
cAlternateFileName
,
-
1
,
dataA
->
cAlternateFileName
,
sizeof
(
dataA
->
cAlternateFileName
),
NULL
,
NULL
);
}
typedef
enum
{
WH_HINIT
=
INTERNET_HANDLE_TYPE_INTERNET
,
...
...
@@ -82,6 +118,7 @@ typedef enum
}
WH_TYPE
;
#define INET_OPENURL 0x0001
#define INET_CALLBACKW 0x0002
typedef
struct
_WININETHANDLEHEADER
{
...
...
@@ -161,19 +198,19 @@ typedef struct
struct
sockaddr_in
socketAddress
;
struct
sockaddr_in
lstnSocketAddress
;
struct
hostent
*
phostent
;
LPSTR
lpszPassword
;
LPSTR
lpszUserName
;
}
WININETFTPSESSION
A
,
*
LPWININETFTPSESSIONA
;
LP
W
STR
lpszPassword
;
LP
W
STR
lpszUserName
;
}
WININETFTPSESSION
W
,
*
LPWININETFTPSESSIONW
;
typedef
struct
{
BOOL
bIsDirectory
;
LPSTR
lpszName
;
LP
W
STR
lpszName
;
DWORD
nSize
;
struct
tm
tmLastModified
;
unsigned
short
permissions
;
}
FILEPROPERTIES
A
,
*
LPFILEPROPERTIESA
;
}
FILEPROPERTIES
W
,
*
LPFILEPROPERTIESW
;
typedef
struct
...
...
@@ -181,97 +218,97 @@ typedef struct
WININETHANDLEHEADER
hdr
;
int
index
;
DWORD
size
;
LPFILEPROPERTIES
A
lpafp
;
}
WININETFINDNEXT
A
,
*
LPWININETFINDNEXTA
;
LPFILEPROPERTIES
W
lpafp
;
}
WININETFINDNEXT
W
,
*
LPWININETFINDNEXTW
;
typedef
enum
{
FTPPUTFILE
A
,
FTPSETCURRENTDIRECTORY
A
,
FTPCREATEDIRECTORY
A
,
FTPFINDFIRSTFILE
A
,
FTPGETCURRENTDIRECTORY
A
,
FTPOPENFILE
A
,
FTPGETFILE
A
,
FTPDELETEFILE
A
,
FTPREMOVEDIRECTORY
A
,
FTPRENAMEFILE
A
,
INTERNETFINDNEXT
A
,
FTPPUTFILE
W
,
FTPSETCURRENTDIRECTORY
W
,
FTPCREATEDIRECTORY
W
,
FTPFINDFIRSTFILE
W
,
FTPGETCURRENTDIRECTORY
W
,
FTPOPENFILE
W
,
FTPGETFILE
W
,
FTPDELETEFILE
W
,
FTPREMOVEDIRECTORY
W
,
FTPRENAMEFILE
W
,
INTERNETFINDNEXT
W
,
HTTPSENDREQUESTW
,
HTTPOPENREQUESTW
,
SENDCALLBACK
,
INTERNETOPENURLW
,
}
ASYNC_FUNC
;
struct
WORKREQ_FTPPUTFILE
A
struct
WORKREQ_FTPPUTFILE
W
{
LPSTR
lpszLocalFile
;
LPSTR
lpszNewRemoteFile
;
LP
W
STR
lpszLocalFile
;
LP
W
STR
lpszNewRemoteFile
;
DWORD
dwFlags
;
DWORD
dwContext
;
};
struct
WORKREQ_FTPSETCURRENTDIRECTORY
A
struct
WORKREQ_FTPSETCURRENTDIRECTORY
W
{
LPSTR
lpszDirectory
;
LP
W
STR
lpszDirectory
;
};
struct
WORKREQ_FTPCREATEDIRECTORY
A
struct
WORKREQ_FTPCREATEDIRECTORY
W
{
LPSTR
lpszDirectory
;
LP
W
STR
lpszDirectory
;
};
struct
WORKREQ_FTPFINDFIRSTFILE
A
struct
WORKREQ_FTPFINDFIRSTFILE
W
{
LPSTR
lpszSearchFile
;
LPWIN32_FIND_DATA
A
lpFindFileData
;
LP
W
STR
lpszSearchFile
;
LPWIN32_FIND_DATA
W
lpFindFileData
;
DWORD
dwFlags
;
DWORD
dwContext
;
};
struct
WORKREQ_FTPGETCURRENTDIRECTORY
A
struct
WORKREQ_FTPGETCURRENTDIRECTORY
W
{
LPSTR
lpszDirectory
;
LP
W
STR
lpszDirectory
;
DWORD
*
lpdwDirectory
;
};
struct
WORKREQ_FTPOPENFILE
A
struct
WORKREQ_FTPOPENFILE
W
{
LPSTR
lpszFilename
;
LP
W
STR
lpszFilename
;
DWORD
dwAccess
;
DWORD
dwFlags
;
DWORD
dwContext
;
};
struct
WORKREQ_FTPGETFILE
A
struct
WORKREQ_FTPGETFILE
W
{
LPSTR
lpszRemoteFile
;
LPSTR
lpszNewFile
;
LP
W
STR
lpszRemoteFile
;
LP
W
STR
lpszNewFile
;
BOOL
fFailIfExists
;
DWORD
dwLocalFlagsAttribute
;
DWORD
dwFlags
;
DWORD
dwContext
;
};
struct
WORKREQ_FTPDELETEFILE
A
struct
WORKREQ_FTPDELETEFILE
W
{
LPSTR
lpszFilename
;
LP
W
STR
lpszFilename
;
};
struct
WORKREQ_FTPREMOVEDIRECTORY
A
struct
WORKREQ_FTPREMOVEDIRECTORY
W
{
LPSTR
lpszDirectory
;
LP
W
STR
lpszDirectory
;
};
struct
WORKREQ_FTPRENAMEFILE
A
struct
WORKREQ_FTPRENAMEFILE
W
{
LPSTR
lpszSrcFile
;
LPSTR
lpszDestFile
;
LP
W
STR
lpszSrcFile
;
LP
W
STR
lpszDestFile
;
};
struct
WORKREQ_INTERNETFINDNEXT
A
struct
WORKREQ_INTERNETFINDNEXT
W
{
LPWIN32_FIND_DATA
A
lpFindFileData
;
LPWIN32_FIND_DATA
W
lpFindFileData
;
};
struct
WORKREQ_HTTPOPENREQUESTW
...
...
@@ -318,17 +355,17 @@ typedef struct WORKREQ
HINTERNET
handle
;
union
{
struct
WORKREQ_FTPPUTFILE
A
FtpPutFileA
;
struct
WORKREQ_FTPSETCURRENTDIRECTORY
A
FtpSetCurrentDirectoryA
;
struct
WORKREQ_FTPCREATEDIRECTORY
A
FtpCreateDirectoryA
;
struct
WORKREQ_FTPFINDFIRSTFILE
A
FtpFindFirstFileA
;
struct
WORKREQ_FTPGETCURRENTDIRECTORY
A
FtpGetCurrentDirectoryA
;
struct
WORKREQ_FTPOPENFILE
A
FtpOpenFileA
;
struct
WORKREQ_FTPGETFILE
A
FtpGetFileA
;
struct
WORKREQ_FTPDELETEFILE
A
FtpDeleteFileA
;
struct
WORKREQ_FTPREMOVEDIRECTORY
A
FtpRemoveDirectoryA
;
struct
WORKREQ_FTPRENAMEFILE
A
FtpRenameFileA
;
struct
WORKREQ_INTERNETFINDNEXT
A
InternetFindNextA
;
struct
WORKREQ_FTPPUTFILE
W
FtpPutFileW
;
struct
WORKREQ_FTPSETCURRENTDIRECTORY
W
FtpSetCurrentDirectoryW
;
struct
WORKREQ_FTPCREATEDIRECTORY
W
FtpCreateDirectoryW
;
struct
WORKREQ_FTPFINDFIRSTFILE
W
FtpFindFirstFileW
;
struct
WORKREQ_FTPGETCURRENTDIRECTORY
W
FtpGetCurrentDirectoryW
;
struct
WORKREQ_FTPOPENFILE
W
FtpOpenFileW
;
struct
WORKREQ_FTPGETFILE
W
FtpGetFileW
;
struct
WORKREQ_FTPDELETEFILE
W
FtpDeleteFileW
;
struct
WORKREQ_FTPREMOVEDIRECTORY
W
FtpRemoveDirectoryW
;
struct
WORKREQ_FTPRENAMEFILE
W
FtpRenameFileW
;
struct
WORKREQ_INTERNETFINDNEXT
W
InternetFindNextW
;
struct
WORKREQ_HTTPOPENREQUESTW
HttpOpenRequestW
;
struct
WORKREQ_HTTPSENDREQUESTW
HttpSendRequestW
;
struct
WORKREQ_SENDCALLBACK
SendCallback
;
...
...
@@ -364,26 +401,26 @@ void INTERNET_SetLastError(DWORD dwError);
DWORD
INTERNET_GetLastError
();
BOOL
INTERNET_AsyncCall
(
LPWORKREQUEST
lpWorkRequest
);
LPSTR
INTERNET_GetResponseBuffer
();
LPSTR
INTERNET_GetNextLine
(
INT
nSocket
,
LP
STR
lpszBuffer
,
LPDWORD
dwBuffer
);
LPSTR
INTERNET_GetNextLine
(
INT
nSocket
,
LP
DWORD
dwLen
);
BOOL
FTP_CloseSessionHandle
(
LPWININETFTPSESSION
A
lpwfs
);
BOOL
FTP_CloseFindNextHandle
(
LPWININETFINDNEXT
A
lpwfn
);
BOOL
FTP_CloseSessionHandle
(
LPWININETFTPSESSION
W
lpwfs
);
BOOL
FTP_CloseFindNextHandle
(
LPWININETFINDNEXT
W
lpwfn
);
BOOL
FTP_CloseFileTransferHandle
(
LPWININETFILE
lpwfn
);
BOOLAPI
FTP_FtpPutFile
A
(
HINTERNET
hConnect
,
LPC
STR
lpszLocalFile
,
LPCSTR
lpszNewRemoteFile
,
DWORD
dwFlags
,
DWORD
dwContext
);
BOOLAPI
FTP_FtpSetCurrentDirectory
A
(
HINTERNET
hConnect
,
LPC
STR
lpszDirectory
);
BOOLAPI
FTP_FtpCreateDirectory
A
(
HINTERNET
hConnect
,
LPC
STR
lpszDirectory
);
INTERNETAPI
HINTERNET
WINAPI
FTP_FtpFindFirstFile
A
(
HINTERNET
hConnect
,
LPC
STR
lpszSearchFile
,
LPWIN32_FIND_DATAA
lpFindFileData
,
DWORD
dwFlags
,
DWORD
dwContext
);
BOOLAPI
FTP_FtpGetCurrentDirectory
A
(
HINTERNET
hFtpSession
,
LP
STR
lpszCurrentDirectory
,
BOOLAPI
FTP_FtpPutFile
W
(
HINTERNET
hConnect
,
LPCW
STR
lpszLocalFile
,
LPC
W
STR
lpszNewRemoteFile
,
DWORD
dwFlags
,
DWORD
dwContext
);
BOOLAPI
FTP_FtpSetCurrentDirectory
W
(
HINTERNET
hConnect
,
LPCW
STR
lpszDirectory
);
BOOLAPI
FTP_FtpCreateDirectory
W
(
HINTERNET
hConnect
,
LPCW
STR
lpszDirectory
);
INTERNETAPI
HINTERNET
WINAPI
FTP_FtpFindFirstFile
W
(
HINTERNET
hConnect
,
LPC
WSTR
lpszSearchFile
,
LPWIN32_FIND_DATAW
lpFindFileData
,
DWORD
dwFlags
,
DWORD
dwContext
);
BOOLAPI
FTP_FtpGetCurrentDirectory
W
(
HINTERNET
hFtpSession
,
LPW
STR
lpszCurrentDirectory
,
LPDWORD
lpdwCurrentDirectory
);
BOOL
FTP_ConvertFileProp
(
LPFILEPROPERTIES
A
lpafp
,
LPWIN32_FIND_DATAA
lpFindFileData
);
BOOL
FTP_FtpRenameFile
A
(
HINTERNET
hFtpSession
,
LPCSTR
lpszSrc
,
LPC
STR
lpszDest
);
BOOL
FTP_FtpRemoveDirectory
A
(
HINTERNET
hFtpSession
,
LPC
STR
lpszDirectory
);
BOOL
FTP_FtpDeleteFile
A
(
HINTERNET
hFtpSession
,
LPC
STR
lpszFileName
);
HINTERNET
FTP_FtpOpenFile
A
(
HINTERNET
hFtpSession
,
LPC
STR
lpszFileName
,
BOOL
FTP_ConvertFileProp
(
LPFILEPROPERTIES
W
lpafp
,
LPWIN32_FIND_DATAW
lpFindFileData
);
BOOL
FTP_FtpRenameFile
W
(
HINTERNET
hFtpSession
,
LPCWSTR
lpszSrc
,
LPCW
STR
lpszDest
);
BOOL
FTP_FtpRemoveDirectory
W
(
HINTERNET
hFtpSession
,
LPCW
STR
lpszDirectory
);
BOOL
FTP_FtpDeleteFile
W
(
HINTERNET
hFtpSession
,
LPCW
STR
lpszFileName
);
HINTERNET
FTP_FtpOpenFile
W
(
HINTERNET
hFtpSession
,
LPCW
STR
lpszFileName
,
DWORD
fdwAccess
,
DWORD
dwFlags
,
DWORD
dwContext
);
BOOLAPI
FTP_FtpGetFile
A
(
HINTERNET
hInternet
,
LPCSTR
lpszRemoteFile
,
LPC
STR
lpszNewFile
,
BOOLAPI
FTP_FtpGetFile
W
(
HINTERNET
hInternet
,
LPCWSTR
lpszRemoteFile
,
LPCW
STR
lpszNewFile
,
BOOL
fFailIfExists
,
DWORD
dwLocalFlagsAttribute
,
DWORD
dwInternetFlags
,
DWORD
dwContext
);
...
...
dlls/wininet/utility.c
View file @
1d2d2d6b
...
...
@@ -219,20 +219,27 @@ VOID SendAsyncCallbackInt(LPWININETAPPINFOW hIC, HINTERNET hHttpSession,
DWORD
dwContext
,
DWORD
dwInternetStatus
,
LPVOID
lpvStatusInfo
,
DWORD
dwStatusInfoLength
)
{
if
(
!
(
hIC
->
lpfnStatusCB
))
return
;
LPVOID
lpvNewInfo
=
NULL
;
if
(
!
(
hIC
->
lpfnStatusCB
))
return
;
/* the IE5 version of wininet does not
send callbacks if dwContext is zero */
if
(
!
dwContext
)
return
;
/* the IE5 version of wininet does not
send callbacks if dwContext is zero */
if
(
!
dwContext
)
return
;
TRACE
(
"--> Callback %ld (%s)
\n
"
,
dwInternetStatus
,
get_callback_name
(
dwInternetStatus
));
TRACE
(
"--> Callback %ld (%s)
\n
"
,
dwInternetStatus
,
get_callback_name
(
dwInternetStatus
));
hIC
->
lpfnStatusCB
(
hHttpSession
,
dwContext
,
dwInternetStatus
,
lpvStatusInfo
,
dwStatusInfoLength
);
if
(
!
(
hIC
->
hdr
.
dwInternalFlags
&
INET_CALLBACKW
))
{
if
(
dwInternetStatus
==
INTERNET_STATUS_RESOLVING_NAME
)
lpvNewInfo
=
WININET_strdup_WtoA
(
lpvStatusInfo
);
}
hIC
->
lpfnStatusCB
(
hHttpSession
,
dwContext
,
dwInternetStatus
,
lpvNewInfo
?
lpvNewInfo
:
lpvStatusInfo
,
dwStatusInfoLength
);
if
(
lpvNewInfo
)
HeapFree
(
GetProcessHeap
(),
0
,
lpvNewInfo
);
TRACE
(
"<-- Callback %ld (%s)
\n
"
,
dwInternetStatus
,
get_callback_name
(
dwInternetStatus
));
TRACE
(
"<-- Callback %ld (%s)
\n
"
,
dwInternetStatus
,
get_callback_name
(
dwInternetStatus
));
}
...
...
dlls/wininet/wininet.spec
View file @
1d2d2d6b
...
...
@@ -54,7 +54,7 @@
@ stdcall FtpCreateDirectoryA(ptr str)
@ stdcall FtpCreateDirectoryW(ptr wstr)
@ stdcall FtpDeleteFileA(ptr str)
@ st
ub FtpDeleteFileW
@ st
dcall FtpDeleteFileW(ptr wstr)
@ stdcall FtpFindFirstFileA(ptr str ptr long long)
@ stdcall FtpFindFirstFileW(ptr wstr ptr long long)
@ stdcall FtpGetCurrentDirectoryA(ptr str ptr)
...
...
@@ -64,11 +64,11 @@
@ stdcall FtpOpenFileA(ptr str long long long)
@ stdcall FtpOpenFileW(ptr wstr long long long)
@ stdcall FtpPutFileA(ptr str str long long)
@ st
ub FtpPutFileW
@ st
dcall FtpPutFileW(ptr wstr wstr long long)
@ stdcall FtpRemoveDirectoryA(ptr str)
@ st
ub FtpRemoveDirectoryW
@ st
dcall FtpRemoveDirectoryW(ptr wstr)
@ stdcall FtpRenameFileA(ptr str str)
@ st
ub FtpRenameFileW
@ st
dcall FtpRenameFileW(ptr wstr wstr)
@ stdcall FtpSetCurrentDirectoryA(ptr str)
@ stdcall FtpSetCurrentDirectoryW(ptr wstr)
@ stdcall GetUrlCacheConfigInfoA(ptr ptr long)
...
...
@@ -123,7 +123,7 @@
@ stub InternetDial
@ stdcall InternetErrorDlg(long long long long ptr)
@ stdcall InternetFindNextFileA(ptr ptr)
@ st
ub InternetFindNextFileW
@ st
dcall InternetFindNextFileW(ptr ptr)
@ stub InternetGetCertByURL
@ stdcall InternetGetConnectedState(ptr long)
@ stdcall InternetGetConnectedStateExW(ptr ptr long long)
...
...
@@ -156,7 +156,7 @@
@ stdcall InternetSetOptionExW(ptr long ptr long long)
@ stdcall InternetSetStatusCallback(ptr ptr) InternetSetStatusCallbackA
@ stdcall InternetSetStatusCallbackA(ptr ptr)
@ st
ub InternetSetStatusCallbackW
@ st
dcall InternetSetStatusCallbackW(ptr ptr)
@ stub InternetShowSecurityInfoByURL
@ stub InternetTimeFromSystemTime
@ stub InternetTimeToSystemTime
...
...
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