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
a796b8a3
Commit
a796b8a3
authored
Jun 23, 2006
by
Paul Vriens
Committed by
Alexandre Julliard
Jun 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: PathCombineW should return NULL on invalid parameters.
parent
a880317e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
path.c
dlls/shlwapi/path.c
+1
-1
path.c
dlls/shlwapi/tests/path.c
+35
-0
No files found.
dlls/shlwapi/path.c
View file @
a796b8a3
...
...
@@ -163,7 +163,7 @@ LPWSTR WINAPI PathCombineW(LPWSTR lpszDest, LPCWSTR lpszDir, LPCWSTR lpszFile)
TRACE
(
"(%p,%s,%s)
\n
"
,
lpszDest
,
debugstr_w
(
lpszDir
),
debugstr_w
(
lpszFile
));
if
(
!
lpszDest
||
(
!
lpszDir
&&
!
lpszFile
))
return
lpszDest
;
/* Invalid parameters */
return
NULL
;
/* Invalid parameters */
if
(
!
lpszFile
||
!*
lpszFile
)
{
...
...
dlls/shlwapi/tests/path.c
View file @
a796b8a3
...
...
@@ -31,6 +31,7 @@
static
HMODULE
hShlwapi
;
static
HRESULT
(
WINAPI
*
pPathIsValidCharA
)(
char
,
DWORD
);
static
HRESULT
(
WINAPI
*
pPathIsValidCharW
)(
WCHAR
,
DWORD
);
static
LPWSTR
(
WINAPI
*
pPathCombineW
)(
LPWSTR
,
LPCWSTR
,
LPCWSTR
);
const
char
*
TEST_URL_1
=
"http://www.winehq.org/tests?date=10/10/1923"
;
const
char
*
TEST_URL_2
=
"http://localhost:8080/tests%2e.html?date=Mon%2010/10/1923"
;
...
...
@@ -860,6 +861,37 @@ static void test_PathMatchSpec(void)
ok
(
PathMatchSpecA
(
file
,
spec13
)
==
TRUE
,
"PathMatchSpec: Spec13 failed
\n
"
);
}
static
void
test_PathCombine
(
void
)
{
LPSTR
szString
,
szString2
;
LPWSTR
wszString
,
wszString2
;
szString2
=
HeapAlloc
(
GetProcessHeap
(),
0
,
MAX_PATH
*
sizeof
(
char
));
wszString2
=
HeapAlloc
(
GetProcessHeap
(),
0
,
MAX_PATH
*
sizeof
(
WCHAR
));
/* NULL test */
szString
=
PathCombineA
(
NULL
,
NULL
,
NULL
);
ok
(
szString
==
NULL
,
"Expected a NULL return
\n
"
);
if
(
pPathCombineW
)
{
wszString
=
pPathCombineW
(
NULL
,
NULL
,
NULL
);
ok
(
wszString
==
NULL
,
"Expected a NULL return
\n
"
);
}
/* Some NULL */
szString
=
PathCombineA
(
szString2
,
NULL
,
NULL
);
ok
(
szString
==
NULL
,
"Expected a NULL return
\n
"
);
if
(
pPathCombineW
)
{
wszString
=
pPathCombineW
(
wszString2
,
NULL
,
NULL
);
ok
(
wszString
==
NULL
,
"Expected a NULL return
\n
"
);
}
HeapFree
(
GetProcessHeap
(),
0
,
szString2
);
HeapFree
(
GetProcessHeap
(),
0
,
wszString2
);
}
START_TEST
(
path
)
{
...
...
@@ -893,4 +925,7 @@ START_TEST(path)
pPathIsValidCharW
=
(
void
*
)
GetProcAddress
(
hShlwapi
,
(
LPSTR
)
456
);
if
(
pPathIsValidCharW
)
test_PathIsValidCharW
();
}
pPathCombineW
=
(
void
*
)
GetProcAddress
(
hShlwapi
,
"PathCombineW"
);
test_PathCombine
();
}
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