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
635d8166
Commit
635d8166
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 ResProtocol::Start.
parent
fa1a9860
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
17 deletions
+25
-17
protocol.c
dlls/mshtml/protocol.c
+25
-17
No files found.
dlls/mshtml/protocol.c
View file @
635d8166
...
@@ -547,13 +547,12 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
...
@@ -547,13 +547,12 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
DWORD
grfPI
,
DWORD
dwReserved
)
DWORD
grfPI
,
DWORD
dwReserved
)
{
{
ResProtocol
*
This
=
PROTOCOL_THIS
(
iface
);
ResProtocol
*
This
=
PROTOCOL_THIS
(
iface
);
DWORD
grfBINDF
=
0
;
DWORD
grfBINDF
=
0
,
len
;
BINDINFO
bindinfo
;
BINDINFO
bindinfo
;
int
len
;
LPWSTR
url_dll
,
url_file
,
url
;
WCHAR
dll
[
MAX_PATH
];
LPCWSTR
url_dll
,
url_file
;
HMODULE
hdll
;
HMODULE
hdll
;
HRSRC
src
;
HRSRC
src
;
HRESULT
hres
;
static
const
WCHAR
wszRes
[]
=
{
'r'
,
'e'
,
's'
,
':'
,
'/'
,
'/'
};
static
const
WCHAR
wszRes
[]
=
{
'r'
,
'e'
,
's'
,
':'
,
'/'
,
'/'
};
...
@@ -567,36 +566,45 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
...
@@ -567,36 +566,45 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
/* FIXME:
/* FIXME:
* Implement MIME type checking
* Implement MIME type checking
* Use CoInternetParseUrl (not implemented yet)
*/
*/
len
=
strlenW
(
szUrl
);
len
=
strlenW
(
szUrl
)
+
16
;
if
(
len
<
sizeof
(
wszRes
)
/
sizeof
(
wszRes
[
0
])
||
memcmp
(
szUrl
,
wszRes
,
sizeof
(
wszRes
)))
{
url
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
WARN
(
"Wrong protocol of url: %s
\n
"
,
debugstr_w
(
szUrl
));
hres
=
CoInternetParseUrl
(
szUrl
,
PARSE_ENCODE
,
0
,
url
,
len
,
&
len
,
0
);
if
(
FAILED
(
hres
))
{
WARN
(
"CoInternetParseUrl failed: %08lx
\n
"
,
hres
);
HeapFree
(
GetProcessHeap
(),
0
,
url
);
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
hres
,
0
,
NULL
);
return
hres
;
}
if
(
len
<
sizeof
(
wszRes
)
/
sizeof
(
wszRes
[
0
])
||
memcmp
(
url
,
wszRes
,
sizeof
(
wszRes
)))
{
WARN
(
"Wrong protocol of url: %s
\n
"
,
debugstr_w
(
url
));
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
MK_E_SYNTAX
,
0
,
NULL
);
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
MK_E_SYNTAX
,
0
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
url
);
return
MK_E_SYNTAX
;
return
MK_E_SYNTAX
;
}
}
url_dll
=
szU
rl
+
sizeof
(
wszRes
)
/
sizeof
(
wszRes
[
0
]);
url_dll
=
u
rl
+
sizeof
(
wszRes
)
/
sizeof
(
wszRes
[
0
]);
if
(
!
(
url_file
=
strchrW
(
url_dll
,
'/'
)))
{
if
(
!
(
url_file
=
strchrW
(
url_dll
,
'/'
)))
{
WARN
(
"wrong url: %s
\n
"
,
debugstr_w
(
szU
rl
));
WARN
(
"wrong url: %s
\n
"
,
debugstr_w
(
u
rl
));
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
MK_E_SYNTAX
,
0
,
NULL
);
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
MK_E_SYNTAX
,
0
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
url
);
return
MK_E_SYNTAX
;
return
MK_E_SYNTAX
;
}
}
memcpy
(
dll
,
url_dll
,
(
url_file
-
url_dll
)
*
sizeof
(
WCHAR
));
*
url_file
++
=
0
;
dll
[
url_file
-
url_dll
]
=
0
;
hdll
=
LoadLibraryExW
(
url_dll
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
);
hdll
=
LoadLibraryExW
(
dll
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
);
if
(
!
hdll
)
{
if
(
!
hdll
)
{
WARN
(
"Could not open dll: %s
\n
"
,
debugstr_w
(
dll
));
WARN
(
"Could not open dll: %s
\n
"
,
debugstr_w
(
url_
dll
));
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
HRESULT_FROM_WIN32
(
GetLastError
()),
0
,
NULL
);
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
HRESULT_FROM_WIN32
(
GetLastError
()),
0
,
NULL
);
return
HRESULT_FROM_WIN32
(
GetLastError
());
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
}
src
=
FindResourceW
(
hdll
,
++
url_file
,
(
LPCWSTR
)
RT_HTML
);
src
=
FindResourceW
(
hdll
,
url_file
,
(
LPCWSTR
)
RT_HTML
);
HeapFree
(
GetProcessHeap
(),
0
,
url
);
if
(
!
src
)
{
if
(
!
src
)
{
WARN
(
"Could not find resource
: %s
\n
"
,
debugstr_w
(
url_file
)
);
WARN
(
"Could not find resource
\n
"
);
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
HRESULT_FROM_WIN32
(
GetLastError
()),
0
,
NULL
);
IInternetProtocolSink_ReportResult
(
pOIProtSink
,
HRESULT_FROM_WIN32
(
GetLastError
()),
0
,
NULL
);
return
HRESULT_FROM_WIN32
(
GetLastError
());
return
HRESULT_FROM_WIN32
(
GetLastError
());
}
}
...
...
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