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
7c08c6f0
Commit
7c08c6f0
authored
Nov 26, 2018
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Nov 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Implement PathCchAppend.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9bd8254a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
2 deletions
+60
-2
api-ms-win-core-path-l1-1-0.spec
...-ms-win-core-path-l1-1-0/api-ms-win-core-path-l1-1-0.spec
+1
-1
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+1
-1
path.c
dlls/kernelbase/path.c
+7
-0
path.c
dlls/kernelbase/tests/path.c
+50
-0
pathcch.h
include/pathcch.h
+1
-0
No files found.
dlls/api-ms-win-core-path-l1-1-0/api-ms-win-core-path-l1-1-0.spec
View file @
7c08c6f0
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
@ stdcall PathCchAddBackslash(wstr long) kernelbase.PathCchAddBackslash
@ stdcall PathCchAddBackslash(wstr long) kernelbase.PathCchAddBackslash
@ stdcall PathCchAddBackslashEx(wstr long ptr ptr) kernelbase.PathCchAddBackslashEx
@ stdcall PathCchAddBackslashEx(wstr long ptr ptr) kernelbase.PathCchAddBackslashEx
@ stdcall PathCchAddExtension(wstr long wstr) kernelbase.PathCchAddExtension
@ stdcall PathCchAddExtension(wstr long wstr) kernelbase.PathCchAddExtension
@ st
ub
PathCchAppend
@ st
dcall PathCchAppend(wstr long wstr) kernelbase.
PathCchAppend
@ stdcall PathCchAppendEx(wstr long wstr long) kernelbase.PathCchAppendEx
@ stdcall PathCchAppendEx(wstr long wstr long) kernelbase.PathCchAppendEx
@ stdcall PathCchCanonicalize(ptr long wstr) kernelbase.PathCchCanonicalize
@ stdcall PathCchCanonicalize(ptr long wstr) kernelbase.PathCchCanonicalize
@ stdcall PathCchCanonicalizeEx(ptr long wstr long) kernelbase.PathCchCanonicalizeEx
@ stdcall PathCchCanonicalizeEx(ptr long wstr long) kernelbase.PathCchCanonicalizeEx
...
...
dlls/kernelbase/kernelbase.spec
View file @
7c08c6f0
...
@@ -1032,7 +1032,7 @@
...
@@ -1032,7 +1032,7 @@
@ stdcall PathCchAddBackslash(wstr long)
@ stdcall PathCchAddBackslash(wstr long)
@ stdcall PathCchAddBackslashEx(wstr long ptr ptr)
@ stdcall PathCchAddBackslashEx(wstr long ptr ptr)
@ stdcall PathCchAddExtension(wstr long wstr)
@ stdcall PathCchAddExtension(wstr long wstr)
# @ stub PathCchAppend
@ stdcall PathCchAppend(wstr long wstr)
@ stdcall PathCchAppendEx(wstr long wstr long)
@ stdcall PathCchAppendEx(wstr long wstr long)
@ stdcall PathCchCanonicalize(ptr long wstr)
@ stdcall PathCchCanonicalize(ptr long wstr)
@ stdcall PathCchCanonicalizeEx(ptr long wstr long)
@ stdcall PathCchCanonicalizeEx(ptr long wstr long)
...
...
dlls/kernelbase/path.c
View file @
7c08c6f0
...
@@ -446,6 +446,13 @@ HRESULT WINAPI PathCchAddExtension(WCHAR *path, SIZE_T size, const WCHAR *extens
...
@@ -446,6 +446,13 @@ HRESULT WINAPI PathCchAddExtension(WCHAR *path, SIZE_T size, const WCHAR *extens
return
S_OK
;
return
S_OK
;
}
}
HRESULT
WINAPI
PathCchAppend
(
WCHAR
*
path1
,
SIZE_T
size
,
const
WCHAR
*
path2
)
{
TRACE
(
"%s %lu %s
\n
"
,
wine_dbgstr_w
(
path1
),
size
,
wine_dbgstr_w
(
path2
));
return
PathCchAppendEx
(
path1
,
size
,
path2
,
PATHCCH_NONE
);
}
HRESULT
WINAPI
PathCchAppendEx
(
WCHAR
*
path1
,
SIZE_T
size
,
const
WCHAR
*
path2
,
DWORD
flags
)
HRESULT
WINAPI
PathCchAppendEx
(
WCHAR
*
path1
,
SIZE_T
size
,
const
WCHAR
*
path2
,
DWORD
flags
)
{
{
HRESULT
hr
;
HRESULT
hr
;
...
...
dlls/kernelbase/tests/path.c
View file @
7c08c6f0
...
@@ -35,6 +35,7 @@ HRESULT (WINAPI *pPathAllocCombine)(const WCHAR *path1, const WCHAR *path2, DWOR
...
@@ -35,6 +35,7 @@ HRESULT (WINAPI *pPathAllocCombine)(const WCHAR *path1, const WCHAR *path2, DWOR
HRESULT
(
WINAPI
*
pPathCchAddBackslash
)(
WCHAR
*
out
,
SIZE_T
size
);
HRESULT
(
WINAPI
*
pPathCchAddBackslash
)(
WCHAR
*
out
,
SIZE_T
size
);
HRESULT
(
WINAPI
*
pPathCchAddBackslashEx
)(
WCHAR
*
out
,
SIZE_T
size
,
WCHAR
**
endptr
,
SIZE_T
*
remaining
);
HRESULT
(
WINAPI
*
pPathCchAddBackslashEx
)(
WCHAR
*
out
,
SIZE_T
size
,
WCHAR
**
endptr
,
SIZE_T
*
remaining
);
HRESULT
(
WINAPI
*
pPathCchAddExtension
)(
WCHAR
*
path
,
SIZE_T
size
,
const
WCHAR
*
extension
);
HRESULT
(
WINAPI
*
pPathCchAddExtension
)(
WCHAR
*
path
,
SIZE_T
size
,
const
WCHAR
*
extension
);
HRESULT
(
WINAPI
*
pPathCchAppend
)(
WCHAR
*
path1
,
SIZE_T
size
,
const
WCHAR
*
path2
);
HRESULT
(
WINAPI
*
pPathCchAppendEx
)(
WCHAR
*
path1
,
SIZE_T
size
,
const
WCHAR
*
path2
,
DWORD
flags
);
HRESULT
(
WINAPI
*
pPathCchAppendEx
)(
WCHAR
*
path1
,
SIZE_T
size
,
const
WCHAR
*
path2
,
DWORD
flags
);
HRESULT
(
WINAPI
*
pPathCchCanonicalize
)(
WCHAR
*
out
,
SIZE_T
size
,
const
WCHAR
*
in
);
HRESULT
(
WINAPI
*
pPathCchCanonicalize
)(
WCHAR
*
out
,
SIZE_T
size
,
const
WCHAR
*
in
);
HRESULT
(
WINAPI
*
pPathCchCanonicalizeEx
)(
WCHAR
*
out
,
SIZE_T
size
,
const
WCHAR
*
in
,
DWORD
flags
);
HRESULT
(
WINAPI
*
pPathCchCanonicalizeEx
)(
WCHAR
*
out
,
SIZE_T
size
,
const
WCHAR
*
in
,
DWORD
flags
);
...
@@ -855,6 +856,53 @@ static const struct append_test append_tests[] =
...
@@ -855,6 +856,53 @@ static const struct append_test append_tests[] =
{
"a"
,
"b"
,
"a
\\
b"
}
{
"a"
,
"b"
,
"a
\\
b"
}
};
};
static
void
test_PathCchAppend
(
void
)
{
WCHAR
path1W
[
PATHCCH_MAX_CCH
];
WCHAR
path2W
[
PATHCCH_MAX_CCH
];
CHAR
path1A
[
PATHCCH_MAX_CCH
];
HRESULT
hr
;
INT
i
;
if
(
!
pPathCchAppend
)
{
win_skip
(
"PathCchAppend() is not available.
\n
"
);
return
;
}
MultiByteToWideChar
(
CP_ACP
,
0
,
"
\\
a"
,
-
1
,
path1W
,
ARRAY_SIZE
(
path1W
));
MultiByteToWideChar
(
CP_ACP
,
0
,
"
\\
b"
,
-
1
,
path2W
,
ARRAY_SIZE
(
path2W
));
hr
=
pPathCchAppend
(
NULL
,
PATHCCH_MAX_CCH
,
path2W
);
ok
(
hr
==
E_INVALIDARG
,
"expect hr %#x, got %#x
\n
"
,
E_INVALIDARG
,
hr
);
hr
=
pPathCchAppend
(
path1W
,
0
,
path2W
);
ok
(
hr
==
E_INVALIDARG
,
"expect hr %#x, got %#x
\n
"
,
E_INVALIDARG
,
hr
);
hr
=
pPathCchAppend
(
path1W
,
PATHCCH_MAX_CCH
+
1
,
path2W
);
ok
(
hr
==
E_INVALIDARG
,
"expect hr %#x, got %#x
\n
"
,
E_INVALIDARG
,
hr
);
hr
=
pPathCchAppend
(
path1W
,
PATHCCH_MAX_CCH
,
NULL
);
ok
(
hr
==
S_OK
,
"expect hr %#x, got %#x
\n
"
,
S_OK
,
hr
);
WideCharToMultiByte
(
CP_ACP
,
0
,
path1W
,
-
1
,
path1A
,
ARRAY_SIZE
(
path1A
),
NULL
,
NULL
);
ok
(
!
lstrcmpA
(
path1A
,
"
\\
a"
),
"expect
\\
a, got %s
\n
"
,
path1A
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
append_tests
);
i
++
)
{
const
struct
append_test
*
t
=
append_tests
+
i
;
MultiByteToWideChar
(
CP_ACP
,
0
,
t
->
path1
,
-
1
,
path1W
,
ARRAY_SIZE
(
path1W
));
MultiByteToWideChar
(
CP_ACP
,
0
,
t
->
path2
,
-
1
,
path2W
,
ARRAY_SIZE
(
path2W
));
hr
=
pPathCchAppend
(
path1W
,
PATHCCH_MAX_CCH
,
path2W
);
ok
(
hr
==
S_OK
,
"append
\"
%s
\"
\"
%s
\"
expect hr %#x, got %#x
\n
"
,
t
->
path1
,
t
->
path2
,
S_OK
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
WideCharToMultiByte
(
CP_ACP
,
0
,
path1W
,
-
1
,
path1A
,
ARRAY_SIZE
(
path1A
),
NULL
,
NULL
);
ok
(
!
lstrcmpA
(
path1A
,
t
->
result
),
"append
\"
%s
\"
\"
%s
\"
expect result
\"
%s
\"
, got
\"
%s
\"\n
"
,
t
->
path1
,
t
->
path2
,
t
->
result
,
path1A
);
}
}
}
static
void
test_PathCchAppendEx
(
void
)
static
void
test_PathCchAppendEx
(
void
)
{
{
WCHAR
path1W
[
PATHCCH_MAX_CCH
];
WCHAR
path1W
[
PATHCCH_MAX_CCH
];
...
@@ -2230,6 +2278,7 @@ START_TEST(path)
...
@@ -2230,6 +2278,7 @@ START_TEST(path)
pPathCchAddBackslash
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchAddBackslash"
);
pPathCchAddBackslash
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchAddBackslash"
);
pPathCchAddBackslashEx
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchAddBackslashEx"
);
pPathCchAddBackslashEx
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchAddBackslashEx"
);
pPathCchAddExtension
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchAddExtension"
);
pPathCchAddExtension
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchAddExtension"
);
pPathCchAppend
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchAppend"
);
pPathCchAppendEx
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchAppendEx"
);
pPathCchAppendEx
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchAppendEx"
);
pPathCchCanonicalize
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchCanonicalize"
);
pPathCchCanonicalize
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchCanonicalize"
);
pPathCchCanonicalizeEx
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchCanonicalizeEx"
);
pPathCchCanonicalizeEx
=
(
void
*
)
GetProcAddress
(
hmod
,
"PathCchCanonicalizeEx"
);
...
@@ -2252,6 +2301,7 @@ START_TEST(path)
...
@@ -2252,6 +2301,7 @@ START_TEST(path)
test_PathCchAddBackslash
();
test_PathCchAddBackslash
();
test_PathCchAddBackslashEx
();
test_PathCchAddBackslashEx
();
test_PathCchAddExtension
();
test_PathCchAddExtension
();
test_PathCchAppend
();
test_PathCchAppendEx
();
test_PathCchAppendEx
();
test_PathCchCanonicalize
();
test_PathCchCanonicalize
();
test_PathCchCanonicalizeEx
();
test_PathCchCanonicalizeEx
();
...
...
include/pathcch.h
View file @
7c08c6f0
...
@@ -31,6 +31,7 @@ HRESULT WINAPI PathAllocCombine(const WCHAR *path1, const WCHAR *path2, DWORD fl
...
@@ -31,6 +31,7 @@ HRESULT WINAPI PathAllocCombine(const WCHAR *path1, const WCHAR *path2, DWORD fl
HRESULT
WINAPI
PathCchAddBackslash
(
WCHAR
*
path
,
SIZE_T
size
);
HRESULT
WINAPI
PathCchAddBackslash
(
WCHAR
*
path
,
SIZE_T
size
);
HRESULT
WINAPI
PathCchAddBackslashEx
(
WCHAR
*
path
,
SIZE_T
size
,
WCHAR
**
end
,
SIZE_T
*
remaining
);
HRESULT
WINAPI
PathCchAddBackslashEx
(
WCHAR
*
path
,
SIZE_T
size
,
WCHAR
**
end
,
SIZE_T
*
remaining
);
HRESULT
WINAPI
PathCchAddExtension
(
WCHAR
*
path
,
SIZE_T
size
,
const
WCHAR
*
extension
);
HRESULT
WINAPI
PathCchAddExtension
(
WCHAR
*
path
,
SIZE_T
size
,
const
WCHAR
*
extension
);
HRESULT
WINAPI
PathCchAppend
(
WCHAR
*
path1
,
SIZE_T
size
,
const
WCHAR
*
path2
);
HRESULT
WINAPI
PathCchAppendEx
(
WCHAR
*
path1
,
SIZE_T
size
,
const
WCHAR
*
path2
,
DWORD
flags
);
HRESULT
WINAPI
PathCchAppendEx
(
WCHAR
*
path1
,
SIZE_T
size
,
const
WCHAR
*
path2
,
DWORD
flags
);
HRESULT
WINAPI
PathCchCanonicalize
(
WCHAR
*
out
,
SIZE_T
size
,
const
WCHAR
*
in
);
HRESULT
WINAPI
PathCchCanonicalize
(
WCHAR
*
out
,
SIZE_T
size
,
const
WCHAR
*
in
);
HRESULT
WINAPI
PathCchCanonicalizeEx
(
WCHAR
*
out
,
SIZE_T
size
,
const
WCHAR
*
in
,
DWORD
flags
);
HRESULT
WINAPI
PathCchCanonicalizeEx
(
WCHAR
*
out
,
SIZE_T
size
,
const
WCHAR
*
in
,
DWORD
flags
);
...
...
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