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
097750cf
Commit
097750cf
authored
Sep 14, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added MIME type checking to FileProtocol::Start.
parent
53a0c300
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
file.c
dlls/urlmon/file.c
+10
-6
protocol.c
dlls/urlmon/tests/protocol.c
+4
-4
No files found.
dlls/urlmon/file.c
View file @
097750cf
...
@@ -103,7 +103,7 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
...
@@ -103,7 +103,7 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
DWORD
grfBINDF
=
0
;
DWORD
grfBINDF
=
0
;
LARGE_INTEGER
size
;
LARGE_INTEGER
size
;
DWORD
len
;
DWORD
len
;
LPWSTR
url
;
LPWSTR
url
,
mime
=
NULL
;
HRESULT
hres
;
HRESULT
hres
;
static
const
WCHAR
wszFile
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
};
static
const
WCHAR
wszFile
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
};
...
@@ -127,9 +127,9 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
...
@@ -127,9 +127,9 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
return
hres
;
return
hres
;
}
}
/* FIXME:
hres
=
FindMimeFromData
(
NULL
,
url
,
NULL
,
0
,
NULL
,
0
,
&
mime
,
0
);
* Implement MIME type checking
if
(
SUCCEEDED
(
hres
))
*/
IInternetProtocolSink_ReportProgress
(
pOIProtSink
,
BINDSTATUS_DIRECTBIND
,
mime
);
if
(
!
This
->
file
)
{
if
(
!
This
->
file
)
{
This
->
file
=
CreateFileW
(
url
+
sizeof
(
wszFile
)
/
sizeof
(
WCHAR
),
GENERIC_READ
,
FILE_SHARE_READ
,
This
->
file
=
CreateFileW
(
url
+
sizeof
(
wszFile
)
/
sizeof
(
WCHAR
),
GENERIC_READ
,
FILE_SHARE_READ
,
...
@@ -140,16 +140,20 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
...
@@ -140,16 +140,20 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
INET_E_RESOURCE_NOT_FOUND
,
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
INET_E_RESOURCE_NOT_FOUND
,
GetLastError
(),
NULL
);
GetLastError
(),
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
url
);
HeapFree
(
GetProcessHeap
(),
0
,
url
);
CoTaskMemFree
(
mime
);
return
INET_E_RESOURCE_NOT_FOUND
;
return
INET_E_RESOURCE_NOT_FOUND
;
}
}
IInternetProtocolSink_ReportProgress
(
pOIProtSink
,
BINDSTATUS_CACHEFILENAMEAVAILABLE
,
IInternetProtocolSink_ReportProgress
(
pOIProtSink
,
BINDSTATUS_CACHEFILENAMEAVAILABLE
,
url
+
sizeof
(
wszFile
)
/
sizeof
(
WCHAR
));
url
+
sizeof
(
wszFile
)
/
sizeof
(
WCHAR
));
if
(
mime
)
IInternetProtocolSink_ReportProgress
(
pOIProtSink
,
BINDSTATUS_MIMETYPEAVAILABLE
,
mime
);
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
S_OK
,
0
,
NULL
);
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
S_OK
,
0
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
url
);
}
}
CoTaskMemFree
(
mime
);
HeapFree
(
GetProcessHeap
(),
0
,
url
);
if
(
GetFileSizeEx
(
This
->
file
,
&
size
))
if
(
GetFileSizeEx
(
This
->
file
,
&
size
))
IInternetProtocolSink_ReportData
(
pOIProtSink
,
IInternetProtocolSink_ReportData
(
pOIProtSink
,
BSCF_FIRSTDATANOTIFICATION
|
BSCF_LASTDATANOTIFICATION
,
BSCF_FIRSTDATANOTIFICATION
|
BSCF_LASTDATANOTIFICATION
,
...
...
dlls/urlmon/tests/protocol.c
View file @
097750cf
...
@@ -215,10 +215,10 @@ static void file_protocol_start(IInternetProtocol *protocol, LPCWSTR url, BOOL i
...
@@ -215,10 +215,10 @@ static void file_protocol_start(IInternetProtocol *protocol, LPCWSTR url, BOOL i
ok
(
hres
==
S_OK
,
"Start failed: %08lx
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"Start failed: %08lx
\n
"
,
hres
);
CHECK_CALLED
(
GetBindInfo
);
CHECK_CALLED
(
GetBindInfo
);
todo_wine
{
CHECK_CALLED
(
ReportProgress_DIRECTBIND
);
}
CHECK_CALLED
(
ReportProgress_DIRECTBIND
);
if
(
is_first
)
{
if
(
is_first
)
{
CHECK_CALLED
(
ReportProgress_CACHEFILENAMEAVAILABLE
);
CHECK_CALLED
(
ReportProgress_CACHEFILENAMEAVAILABLE
);
todo_wine
{
CHECK_CALLED
(
ReportProgress_MIMETYPEAVAILABLE
);
}
CHECK_CALLED
(
ReportProgress_MIMETYPEAVAILABLE
);
CHECK_CALLED
(
ReportResult
);
CHECK_CALLED
(
ReportResult
);
}
}
CHECK_CALLED
(
ReportData
);
CHECK_CALLED
(
ReportData
);
...
@@ -373,7 +373,7 @@ static void test_file_protocol(void) {
...
@@ -373,7 +373,7 @@ static void test_file_protocol(void) {
ok
(
hres
==
INET_E_RESOURCE_NOT_FOUND
,
ok
(
hres
==
INET_E_RESOURCE_NOT_FOUND
,
"Start failed: %08lx expected INET_E_RESOURCE_NOT_FOUND
\n
"
,
hres
);
"Start failed: %08lx expected INET_E_RESOURCE_NOT_FOUND
\n
"
,
hres
);
CHECK_CALLED
(
GetBindInfo
);
CHECK_CALLED
(
GetBindInfo
);
todo_wine
{
CHECK_CALLED
(
ReportProgress_DIRECTBIND
);
}
CHECK_CALLED
(
ReportProgress_DIRECTBIND
);
CHECK_CALLED
(
ReportResult
);
CHECK_CALLED
(
ReportResult
);
IInternetProtocol_Release
(
protocol
);
IInternetProtocol_Release
(
protocol
);
...
@@ -392,7 +392,7 @@ static void test_file_protocol(void) {
...
@@ -392,7 +392,7 @@ static void test_file_protocol(void) {
ok
(
hres
==
INET_E_RESOURCE_NOT_FOUND
,
ok
(
hres
==
INET_E_RESOURCE_NOT_FOUND
,
"Start failed: %08lx, expected INET_E_RESOURCE_NOT_FOUND
\n
"
,
hres
);
"Start failed: %08lx, expected INET_E_RESOURCE_NOT_FOUND
\n
"
,
hres
);
CHECK_CALLED
(
GetBindInfo
);
CHECK_CALLED
(
GetBindInfo
);
todo_wine
{
CHECK_CALLED
(
ReportProgress_DIRECTBIND
);
}
CHECK_CALLED
(
ReportProgress_DIRECTBIND
);
CHECK_CALLED
(
ReportResult
);
CHECK_CALLED
(
ReportResult
);
IInternetProtocol_Release
(
protocol
);
IInternetProtocol_Release
(
protocol
);
...
...
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