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
33141845
Commit
33141845
authored
Feb 29, 2008
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Move InternetQueryDataAvailable to vtbl.
parent
a7c9fbc6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
80 deletions
+81
-80
ftp.c
dlls/wininet/ftp.c
+3
-0
http.c
dlls/wininet/http.c
+52
-0
internet.c
dlls/wininet/internet.c
+25
-80
internet.h
dlls/wininet/internet.h
+1
-0
No files found.
dlls/wininet/ftp.c
View file @
33141845
...
...
@@ -1190,6 +1190,7 @@ static const HANDLEHEADERVtbl FTPFILEVtbl = {
NULL
,
NULL
,
FTPFILE_WriteFile
,
NULL
,
NULL
};
...
...
@@ -2109,6 +2110,7 @@ static const HANDLEHEADERVtbl FTPSESSIONVtbl = {
FTPSESSION_CloseConnection
,
NULL
,
NULL
,
NULL
,
NULL
};
...
...
@@ -3194,6 +3196,7 @@ static const HANDLEHEADERVtbl FTPFINDNEXTVtbl = {
NULL
,
NULL
,
NULL
,
NULL
,
FTPFINDNEXT_FindNextFileW
};
...
...
dlls/wininet/http.c
View file @
33141845
...
...
@@ -1418,11 +1418,62 @@ static BOOL HTTPREQ_WriteFile(WININETHANDLEHEADER *hdr, const void *buffer, DWOR
return
NETCON_send
(
&
lpwhr
->
netConnection
,
buffer
,
size
,
0
,
(
LPINT
)
written
);
}
static
void
HTTPREQ_AsyncQueryDataAvailableProc
(
WORKREQUEST
*
workRequest
)
{
WININETHTTPREQW
*
req
=
(
WININETHTTPREQW
*
)
workRequest
->
hdr
;
INTERNET_ASYNC_RESULT
iar
;
char
buffer
[
4048
];
TRACE
(
"%p
\n
"
,
workRequest
->
hdr
);
iar
.
dwResult
=
NETCON_recv
(
&
req
->
netConnection
,
buffer
,
min
(
sizeof
(
buffer
),
req
->
dwContentLength
-
req
->
dwContentRead
),
MSG_PEEK
,
(
int
*
)
&
iar
.
dwError
);
INTERNET_SendCallback
(
&
req
->
hdr
,
req
->
hdr
.
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
}
static
DWORD
HTTPREQ_QueryDataAvailable
(
WININETHANDLEHEADER
*
hdr
,
DWORD
*
available
,
DWORD
flags
,
DWORD_PTR
ctx
)
{
WININETHTTPREQW
*
req
=
(
WININETHTTPREQW
*
)
hdr
;
BYTE
buffer
[
4048
];
BOOL
async
;
TRACE
(
"(%p %p %x %lx)
\n
"
,
req
,
available
,
flags
,
ctx
);
if
(
!
NETCON_query_data_available
(
&
req
->
netConnection
,
available
)
||
*
available
)
return
ERROR_SUCCESS
;
/* Even if we are in async mode, we need to determine whether
* there is actually more data available. We do this by trying
* to peek only a single byte in async mode. */
async
=
(
req
->
lpHttpSession
->
lpAppInfo
->
hdr
.
dwFlags
&
INTERNET_FLAG_ASYNC
)
!=
0
;
if
(
NETCON_recv
(
&
req
->
netConnection
,
buffer
,
min
(
async
?
1
:
sizeof
(
buffer
),
req
->
dwContentLength
-
req
->
dwContentRead
),
MSG_PEEK
,
(
int
*
)
available
)
&&
async
&&
*
available
)
{
WORKREQUEST
workRequest
;
*
available
=
0
;
workRequest
.
asyncproc
=
HTTPREQ_AsyncQueryDataAvailableProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
req
->
hdr
);
INTERNET_AsyncCall
(
&
workRequest
);
return
ERROR_IO_PENDING
;
}
return
ERROR_SUCCESS
;
}
static
const
HANDLEHEADERVtbl
HTTPREQVtbl
=
{
HTTPREQ_Destroy
,
HTTPREQ_CloseConnection
,
HTTPREQ_SetOption
,
HTTPREQ_WriteFile
,
HTTPREQ_QueryDataAvailable
,
NULL
};
...
...
@@ -2948,6 +2999,7 @@ static const HANDLEHEADERVtbl HTTPSESSIONVtbl = {
NULL
,
NULL
,
NULL
,
NULL
,
NULL
};
...
...
dlls/wininet/internet.c
View file @
33141845
...
...
@@ -476,6 +476,7 @@ static const HANDLEHEADERVtbl APPINFOVtbl = {
NULL
,
NULL
,
NULL
,
NULL
,
NULL
};
...
...
@@ -2399,6 +2400,10 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d
INTERNET_SetLastError
(
ERROR_INVALID_PARAMETER
);
}
break
;
case
66
:
FIXME
(
"66
\n
"
);
bSuccess
=
TRUE
;
break
;
default:
FIXME
(
"Stub! %d
\n
"
,
dwOption
);
break
;
...
...
@@ -2556,6 +2561,9 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
case
INTERNET_OPTION_SECURITY_FLAGS
:
FIXME
(
"Option INTERNET_OPTION_SECURITY_FLAGS; STUB
\n
"
);
break
;
case
86
:
FIXME
(
"86
\n
"
);
break
;
default:
FIXME
(
"Option %d STUB
\n
"
,
dwOption
);
INTERNET_SetLastError
(
ERROR_INTERNET_INVALID_OPTION
);
...
...
@@ -3400,96 +3408,33 @@ lend:
* INTERNET_STATUS_REQUEST_COMPLETE will be sent when more
* data is available.
*/
void
AsyncInternetQueryDataAvailableProc
(
WORKREQUEST
*
workRequest
)
{
LPWININETHTTPREQW
lpwhr
;
INTERNET_ASYNC_RESULT
iar
;
char
buffer
[
4048
];
TRACE
(
"INTERNETQUERYDATAAVAILABLE %p
\n
"
,
workRequest
->
hdr
);
switch
(
workRequest
->
hdr
->
htype
)
{
case
WH_HHTTPREQ
:
lpwhr
=
(
LPWININETHTTPREQW
)
workRequest
->
hdr
;
iar
.
dwResult
=
NETCON_recv
(
&
lpwhr
->
netConnection
,
buffer
,
min
(
sizeof
(
buffer
),
lpwhr
->
dwContentLength
-
lpwhr
->
dwContentRead
),
MSG_PEEK
,
(
int
*
)
&
iar
.
dwError
);
INTERNET_SendCallback
(
workRequest
->
hdr
,
workRequest
->
hdr
->
dwContext
,
INTERNET_STATUS_REQUEST_COMPLETE
,
&
iar
,
sizeof
(
INTERNET_ASYNC_RESULT
));
break
;
default:
FIXME
(
"unsupported file type
\n
"
);
break
;
}
}
BOOL
WINAPI
InternetQueryDataAvailable
(
HINTERNET
hFile
,
LPDWORD
lpdwNumberOfBytesAvailble
,
DWORD
dwFlags
,
DWORD_PTR
dwContext
)
{
LPWININETHTTPREQW
lpwhr
;
BOOL
retval
=
FALSE
;
char
buffer
[
4048
];
WININETHANDLEHEADER
*
hdr
;
DWORD
res
;
lpwhr
=
(
LPWININETHTTPREQW
)
WININET_GetObject
(
hFile
);
if
(
NULL
==
lpwhr
)
{
INTERNET_SetLastError
(
ERROR_NO_MORE_FILES
);
TRACE
(
"(%p %p %x %lx)
\n
"
,
hFile
,
lpdwNumberOfBytesAvailble
,
dwFlags
,
dwContext
);
hdr
=
WININET_GetObject
(
hFile
);
if
(
!
hdr
)
{
INTERNET_SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
TRACE
(
"--> %p %i
\n
"
,
lpwhr
,
lpwhr
->
hdr
.
htype
);
switch
(
lpwhr
->
hdr
.
htype
)
{
case
WH_HHTTPREQ
:
retval
=
TRUE
;
if
(
NETCON_query_data_available
(
&
lpwhr
->
netConnection
,
lpdwNumberOfBytesAvailble
)
&&
!*
lpdwNumberOfBytesAvailble
)
{
/* Even if we are in async mode, we need to determine whether
* there is actually more data available. We do this by trying
* to peek only a single byte in async mode. */
BOOL
async
=
(
lpwhr
->
lpHttpSession
->
lpAppInfo
->
hdr
.
dwFlags
&
INTERNET_FLAG_ASYNC
);
if
(
NETCON_recv
(
&
lpwhr
->
netConnection
,
buffer
,
min
(
async
?
1
:
sizeof
(
buffer
),
lpwhr
->
dwContentLength
-
lpwhr
->
dwContentRead
),
MSG_PEEK
,
(
int
*
)
lpdwNumberOfBytesAvailble
)
&&
async
&&
*
lpdwNumberOfBytesAvailble
)
{
WORKREQUEST
workRequest
;
*
lpdwNumberOfBytesAvailble
=
0
;
workRequest
.
asyncproc
=
AsyncInternetQueryDataAvailableProc
;
workRequest
.
hdr
=
WININET_AddRef
(
&
lpwhr
->
hdr
);
retval
=
INTERNET_AsyncCall
(
&
workRequest
);
if
(
!
retval
)
{
WININET_Release
(
&
lpwhr
->
hdr
);
}
else
{
INTERNET_SetLastError
(
ERROR_IO_PENDING
);
retval
=
FALSE
;
}
}
}
break
;
default:
FIXME
(
"unsupported file type
\n
"
);
break
;
if
(
hdr
->
vtbl
->
QueryDataAvailable
)
{
res
=
hdr
->
vtbl
->
QueryDataAvailable
(
hdr
,
lpdwNumberOfBytesAvailble
,
dwFlags
,
dwContext
);
}
else
{
WARN
(
"wrong handle
\n
"
);
res
=
ERROR_INTERNET_INCORRECT_HANDLE_TYPE
;
}
WININET_Release
(
&
lpwhr
->
hdr
);
TRACE
(
"<-- %i
\n
"
,
retval
);
return
retval
;
WININET_Release
(
hdr
);
if
(
res
!=
ERROR_SUCCESS
)
SetLastError
(
res
);
return
res
==
ERROR_SUCCESS
;
}
...
...
dlls/wininet/internet.h
View file @
33141845
...
...
@@ -140,6 +140,7 @@ typedef struct {
void
(
*
CloseConnection
)(
WININETHANDLEHEADER
*
);
DWORD
(
*
SetOption
)(
WININETHANDLEHEADER
*
,
DWORD
,
void
*
,
DWORD
);
BOOL
(
*
WriteFile
)(
WININETHANDLEHEADER
*
,
const
void
*
,
DWORD
,
DWORD
*
);
DWORD
(
*
QueryDataAvailable
)(
WININETHANDLEHEADER
*
,
DWORD
*
,
DWORD
,
DWORD_PTR
);
DWORD
(
*
FindNextFileW
)(
WININETHANDLEHEADER
*
,
void
*
);
}
HANDLEHEADERVtbl
;
...
...
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