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
91d07f69
Commit
91d07f69
authored
Dec 04, 2007
by
Roy Shea
Committed by
Alexandre Julliard
Dec 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wininet: Added check of dwStructSize required by Windows in calls to InternetCrackUrlA.
parent
7903d7f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
internet.c
dlls/wininet/internet.c
+3
-1
url.c
dlls/wininet/tests/url.c
+19
-0
No files found.
dlls/wininet/internet.c
View file @
91d07f69
...
...
@@ -1069,7 +1069,8 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
TRACE
(
"(%s %u %x %p)
\n
"
,
debugstr_a
(
lpszUrl
),
dwUrlLength
,
dwFlags
,
lpUrlComponents
);
if
(
!
lpszUrl
||
!*
lpszUrl
)
if
(
!
lpszUrl
||
!*
lpszUrl
||
!
lpUrlComponents
||
lpUrlComponents
->
dwStructSize
!=
sizeof
(
URL_COMPONENTSA
))
{
INTERNET_SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
...
...
@@ -1087,6 +1088,7 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
MultiByteToWideChar
(
CP_ACP
,
0
,
lpszUrl
,
dwUrlLength
,
lpwszUrl
,
nLength
);
memset
(
&
UCW
,
0
,
sizeof
(
UCW
));
UCW
.
dwStructSize
=
sizeof
(
URL_COMPONENTSW
);
if
(
lpUrlComponents
->
dwHostNameLength
!=
0
)
UCW
.
dwHostNameLength
=
lpUrlComponents
->
dwHostNameLength
;
if
(
lpUrlComponents
->
dwUserNameLength
!=
0
)
...
...
dlls/wininet/tests/url.c
View file @
91d07f69
...
...
@@ -239,6 +239,25 @@ static void InternetCrackUrl_test(void)
GLE
=
GetLastError
();
ok
(
ret
==
FALSE
,
"Expected InternetCrackUrl to fail
\n
"
);
ok
(
GLE
!=
0xdeadbeef
&&
GLE
!=
ERROR_SUCCESS
,
"Expected GLE to represent a failure
\n
"
);
/* Invalid Call: must set size of components structure (Windows only
* inforces this on the InternetCrackUrlA version of the call) */
copy_compsA
(
&
urlSrc
,
&
urlComponents
,
0
,
1024
,
1024
,
1024
,
2048
,
1024
);
SetLastError
(
0xdeadbeef
);
urlComponents
.
dwStructSize
=
0
;
ret
=
InternetCrackUrlA
(
TEST_URL
,
0
,
0
,
&
urlComponents
);
ok
(
ret
==
FALSE
,
"Expected InternetCrackUrl to fail
\n
"
);
ok
(
GLE
!=
0xdeadbeef
&&
GLE
!=
ERROR_SUCCESS
,
"Expected GLE to represent a failure
\n
"
);
/* Invalid Call: size of dwStructSize must be one of the "standard" sizes
* of the URL_COMPONENTS structure (Windows only inforces this on the
* InternetCrackUrlA version of the call) */
copy_compsA
(
&
urlSrc
,
&
urlComponents
,
0
,
1024
,
1024
,
1024
,
2048
,
1024
);
SetLastError
(
0xdeadbeef
);
urlComponents
.
dwStructSize
=
sizeof
(
urlComponents
)
+
1
;
ret
=
InternetCrackUrlA
(
TEST_URL
,
0
,
0
,
&
urlComponents
);
ok
(
ret
==
FALSE
,
"Expected InternetCrackUrl to fail
\n
"
);
ok
(
GLE
!=
0xdeadbeef
&&
GLE
!=
ERROR_SUCCESS
,
"Expected GLE to represent a failure
\n
"
);
}
static
void
InternetCrackUrlW_test
(
void
)
...
...
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