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
5854c4d5
Commit
5854c4d5
authored
Sep 12, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 12, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added *ProtocolInfo::ParseUrl implementation.
parent
b241d517
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
137 additions
and
8 deletions
+137
-8
protocol.c
dlls/mshtml/protocol.c
+56
-4
protocol.c
dlls/mshtml/tests/protocol.c
+81
-4
No files found.
dlls/mshtml/protocol.c
View file @
5854c4d5
...
...
@@ -400,9 +400,25 @@ static HRESULT WINAPI AboutProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, L
PARSEACTION
ParseAction
,
DWORD
dwParseFlags
,
LPWSTR
pwzResult
,
DWORD
cchResult
,
DWORD
*
pcchResult
,
DWORD
dwReserved
)
{
FIXM
E
(
"%p)->(%s %08x %08lx %p %ld %p %ld)
\n
"
,
iface
,
debugstr_w
(
pwzUrl
),
ParseAction
,
TRAC
E
(
"%p)->(%s %08x %08lx %p %ld %p %ld)
\n
"
,
iface
,
debugstr_w
(
pwzUrl
),
ParseAction
,
dwParseFlags
,
pwzResult
,
cchResult
,
pcchResult
,
dwReserved
);
return
E_NOTIMPL
;
if
(
ParseAction
==
PARSE_SECURITY_URL
)
{
int
len
=
lstrlenW
(
pwzUrl
);
if
(
len
>=
cchResult
)
return
S_FALSE
;
memcpy
(
pwzResult
,
pwzUrl
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
return
S_OK
;
}
if
(
ParseAction
==
PARSE_DOMAIN
)
{
/* Tests show that we don't have to do anything here */
return
S_OK
;
}
return
INET_E_DEFAULT_ACTION
;
}
static
HRESULT
WINAPI
AboutProtocolInfo_CombineUrl
(
IInternetProtocolInfo
*
iface
,
LPCWSTR
pwzBaseUrl
,
...
...
@@ -749,9 +765,45 @@ static HRESULT WINAPI ResProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPC
PARSEACTION
ParseAction
,
DWORD
dwParseFlags
,
LPWSTR
pwzResult
,
DWORD
cchResult
,
DWORD
*
pcchResult
,
DWORD
dwReserved
)
{
FIXME
(
"%p)->(%s %08x %08
lx %p %ld %p %ld)
\n
"
,
iface
,
debugstr_w
(
pwzUrl
),
ParseAction
,
TRACE
(
"%p)->(%s %d %
lx %p %ld %p %ld)
\n
"
,
iface
,
debugstr_w
(
pwzUrl
),
ParseAction
,
dwParseFlags
,
pwzResult
,
cchResult
,
pcchResult
,
dwReserved
);
return
E_NOTIMPL
;
if
(
ParseAction
==
PARSE_SECURITY_URL
)
{
WCHAR
*
ptr
;
DWORD
size
;
static
const
WCHAR
wszFile
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
':'
,
'/'
,
'/'
};
static
const
WCHAR
wszRes
[]
=
{
'r'
,
'e'
,
's'
,
':'
,
'/'
,
'/'
};
if
(
strlenW
(
pwzUrl
)
<=
sizeof
(
wszRes
)
/
sizeof
(
WCHAR
)
||
memcmp
(
pwzUrl
,
wszRes
,
sizeof
(
wszRes
)))
return
MK_E_SYNTAX
;
ptr
=
strchrW
(
pwzUrl
+
sizeof
(
wszRes
)
/
sizeof
(
WCHAR
),
'/'
);
if
(
!
ptr
)
return
MK_E_SYNTAX
;
size
=
ptr
-
pwzUrl
+
sizeof
(
wszFile
)
/
sizeof
(
WCHAR
)
-
sizeof
(
wszRes
)
/
sizeof
(
WCHAR
);
if
(
size
>=
cchResult
)
return
S_FALSE
;
/* FIXME: return full path */
memcpy
(
pwzResult
,
wszFile
,
sizeof
(
wszFile
));
memcpy
(
pwzResult
+
sizeof
(
wszFile
)
/
sizeof
(
WCHAR
),
pwzUrl
+
sizeof
(
wszRes
)
/
sizeof
(
WCHAR
),
size
*
sizeof
(
WCHAR
)
-
sizeof
(
wszFile
));
pwzResult
[
size
]
=
0
;
if
(
pcchResult
)
*
pcchResult
=
size
;
return
S_OK
;
}
if
(
ParseAction
==
PARSE_DOMAIN
)
{
/* Tests show that we don't have to do anything here */
return
S_OK
;
}
return
INET_E_DEFAULT_ACTION
;
}
static
HRESULT
WINAPI
ResProtocolInfo_CombineUrl
(
IInternetProtocolInfo
*
iface
,
LPCWSTR
pwzBaseUrl
,
...
...
dlls/mshtml/tests/protocol.c
View file @
5854c4d5
...
...
@@ -247,8 +247,48 @@ static void test_res_protocol(void)
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IInternetProtocolInfo
,
(
void
**
)
&
protocol_info
);
ok
(
hres
==
S_OK
,
"Could not get IInternetProtocolInfo interface: %08lx
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
/* TODO: test IInternetProtocol interface */
IInternetProtocol_Release
(
protocol_info
);
WCHAR
buf
[
128
];
DWORD
size
;
int
i
;
for
(
i
=
PARSE_CANONICALIZE
;
i
<=
PARSE_UNESCAPE
;
i
++
)
{
if
(
i
!=
PARSE_SECURITY_URL
&&
i
!=
PARSE_DOMAIN
)
{
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
blank_url
,
i
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
&
size
,
0
);
ok
(
hres
==
INET_E_DEFAULT_ACTION
,
"[%d] failed: %08lx, expected INET_E_DEFAULT_ACTION
\n
"
,
i
,
hres
);
}
}
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
blank_url
,
PARSE_SECURITY_URL
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
&
size
,
0
);
ok
(
hres
==
S_OK
,
"ParseUrl failed: %08lx
\n
"
,
hres
);
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
blank_url
,
PARSE_SECURITY_URL
,
0
,
buf
,
3
,
&
size
,
0
);
ok
(
hres
==
S_FALSE
,
"ParseUrl failed: %08lx, expected S_FALSE
\n
"
,
hres
);
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
wrong_url1
,
PARSE_SECURITY_URL
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
&
size
,
0
);
ok
(
hres
==
MK_E_SYNTAX
,
"ParseUrl failed: %08lx, expected MK_E_SYNTAX
\n
"
,
hres
);
buf
[
0
]
=
'?'
;
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
blank_url
,
PARSE_DOMAIN
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
&
size
,
0
);
ok
(
hres
==
S_OK
,
"ParseUrl failed: %08lx
\n
"
,
hres
);
ok
(
buf
[
0
]
==
'?'
,
"buf changed
\n
"
);
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
wrong_url1
,
PARSE_DOMAIN
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
&
size
,
0
);
ok
(
hres
==
S_OK
,
"ParseUrl failed: %08lx, expected MK_E_SYNTAX
\n
"
,
hres
);
ok
(
buf
[
0
]
==
'?'
,
"buf changed
\n
"
);
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
blank_url
,
PARSE_UNESCAPE
+
1
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
&
size
,
0
);
ok
(
hres
==
INET_E_DEFAULT_ACTION
,
"ParseUrl failed: %08lx, expected INET_E_DEFAULT_ACTION
\n
"
,
hres
);
IInternetProtocolInfo_Release
(
protocol_info
);
}
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IClassFactory
,
(
void
**
)
&
factory
);
...
...
@@ -352,8 +392,45 @@ static void test_about_protocol(void)
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IInternetProtocolInfo
,
(
void
**
)
&
protocol_info
);
ok
(
hres
==
S_OK
,
"Could not get IInternetProtocolInfo interface: %08lx
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
/* TODO: test IInternetProtocol interface */
IInternetProtocol_Release
(
protocol_info
);
WCHAR
buf
[
128
];
DWORD
size
;
int
i
;
for
(
i
=
PARSE_CANONICALIZE
;
i
<=
PARSE_UNESCAPE
;
i
++
)
{
if
(
i
!=
PARSE_SECURITY_URL
&&
i
!=
PARSE_DOMAIN
)
{
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
blank_url
,
i
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
&
size
,
0
);
ok
(
hres
==
INET_E_DEFAULT_ACTION
,
"[%d] failed: %08lx, expected INET_E_DEFAULT_ACTION
\n
"
,
i
,
hres
);
}
}
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
blank_url
,
PARSE_SECURITY_URL
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
&
size
,
0
);
ok
(
hres
==
S_OK
,
"ParseUrl failed: %08lx
\n
"
,
hres
);
ok
(
!
lstrcmpW
(
blank_url
,
buf
),
"buf != blank_url
\n
"
);
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
blank_url
,
PARSE_SECURITY_URL
,
0
,
buf
,
3
,
&
size
,
0
);
ok
(
hres
==
S_FALSE
,
"ParseUrl failed: %08lx, expected S_FALSE
\n
"
,
hres
);
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
test_url
,
PARSE_SECURITY_URL
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
&
size
,
0
);
ok
(
hres
==
S_OK
,
"ParseUrl failed: %08lx
\n
"
,
hres
);
ok
(
!
lstrcmpW
(
test_url
,
buf
),
"buf != test_url
\n
"
);
buf
[
0
]
=
'?'
;
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
blank_url
,
PARSE_DOMAIN
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
&
size
,
0
);
ok
(
hres
==
S_OK
,
"ParseUrl failed: %08lx
\n
"
,
hres
);
ok
(
buf
[
0
]
==
'?'
,
"buf changed
\n
"
);
hres
=
IInternetProtocolInfo_ParseUrl
(
protocol_info
,
blank_url
,
PARSE_UNESCAPE
+
1
,
0
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
&
size
,
0
);
ok
(
hres
==
INET_E_DEFAULT_ACTION
,
"ParseUrl failed: %08lx, expected INET_E_DEFAULT_ACTION
\n
"
,
hres
);
IInternetProtocolInfo_Release
(
protocol_info
);
}
hres
=
IUnknown_QueryInterface
(
unk
,
&
IID_IClassFactory
,
(
void
**
)
&
factory
);
...
...
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