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
dc420fe6
Commit
dc420fe6
authored
Sep 12, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 12, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Encode URL in file protocol.
parent
fc4b08d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
file.c
dlls/urlmon/file.c
+16
-2
No files found.
dlls/urlmon/file.c
View file @
dc420fe6
...
...
@@ -102,6 +102,9 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
BINDINFO
bindinfo
;
DWORD
grfBINDF
=
0
;
LARGE_INTEGER
size
;
DWORD
len
;
LPWSTR
url
;
HRESULT
hres
;
static
const
WCHAR
wszFile
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
};
...
...
@@ -116,24 +119,35 @@ static HRESULT WINAPI FileProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl
||
memcmp
(
szUrl
,
wszFile
,
sizeof
(
wszFile
)))
return
MK_E_SYNTAX
;
len
=
lstrlenW
(
szUrl
)
+
16
;
url
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
hres
=
CoInternetParseUrl
(
szUrl
,
PARSE_ENCODE
,
0
,
url
,
len
,
&
len
,
0
);
if
(
FAILED
(
hres
))
{
HeapFree
(
GetProcessHeap
(),
0
,
url
);
return
hres
;
}
/* FIXME:
* Implement MIME type checking
*/
if
(
!
This
->
file
)
{
This
->
file
=
CreateFileW
(
szU
rl
+
sizeof
(
wszFile
)
/
sizeof
(
WCHAR
),
GENERIC_READ
,
FILE_SHARE_READ
,
This
->
file
=
CreateFileW
(
u
rl
+
sizeof
(
wszFile
)
/
sizeof
(
WCHAR
),
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
This
->
file
==
INVALID_HANDLE_VALUE
)
{
This
->
file
=
NULL
;
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
INET_E_RESOURCE_NOT_FOUND
,
GetLastError
(),
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
url
);
return
INET_E_RESOURCE_NOT_FOUND
;
}
IInternetProtocolSink_ReportProgress
(
pOIProtSink
,
BINDSTATUS_CACHEFILENAMEAVAILABLE
,
szU
rl
+
sizeof
(
wszFile
)
/
sizeof
(
WCHAR
));
u
rl
+
sizeof
(
wszFile
)
/
sizeof
(
WCHAR
));
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
S_OK
,
0
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
url
);
}
if
(
GetFileSizeEx
(
This
->
file
,
&
size
))
...
...
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