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
0db689ed
Commit
0db689ed
authored
Jun 30, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add _wsplitpath_s.
Implementation copied from msvcrt. Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
911810c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
0 deletions
+77
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
wcstring.c
dlls/ntdll/wcstring.c
+76
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
0db689ed
...
...
@@ -1554,6 +1554,7 @@
@ cdecl -ret64 _wcstoui64(wstr ptr long)
@ cdecl _wcsupr(wstr)
@ cdecl _wcsupr_s(wstr long)
@ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long)
@ cdecl _wtoi(wstr)
@ cdecl -ret64 _wtoi64(wstr)
@ cdecl _wtol(wstr)
...
...
dlls/ntdll/wcstring.c
View file @
0db689ed
...
...
@@ -1299,3 +1299,79 @@ LONGLONG __cdecl _wtoi64( LPCWSTR str )
return
bMinus
?
-
RunningTotal
:
RunningTotal
;
}
/******************************************************************
* _wsplitpath_s (NTDLL.@)
*/
errno_t
__cdecl
_wsplitpath_s
(
const
wchar_t
*
inpath
,
wchar_t
*
drive
,
size_t
sz_drive
,
wchar_t
*
dir
,
size_t
sz_dir
,
wchar_t
*
fname
,
size_t
sz_fname
,
wchar_t
*
ext
,
size_t
sz_ext
)
{
const
wchar_t
*
p
,
*
end
;
if
(
!
inpath
||
(
!
drive
&&
sz_drive
)
||
(
drive
&&
!
sz_drive
)
||
(
!
dir
&&
sz_dir
)
||
(
dir
&&
!
sz_dir
)
||
(
!
fname
&&
sz_fname
)
||
(
fname
&&
!
sz_fname
)
||
(
!
ext
&&
sz_ext
)
||
(
ext
&&
!
sz_ext
))
return
EINVAL
;
if
(
inpath
[
0
]
&&
inpath
[
1
]
==
':'
)
{
if
(
drive
)
{
if
(
sz_drive
<=
2
)
goto
error
;
drive
[
0
]
=
inpath
[
0
];
drive
[
1
]
=
inpath
[
1
];
drive
[
2
]
=
0
;
}
inpath
+=
2
;
}
else
if
(
drive
)
drive
[
0
]
=
'\0'
;
/* look for end of directory part */
end
=
NULL
;
for
(
p
=
inpath
;
*
p
;
p
++
)
if
(
*
p
==
'/'
||
*
p
==
'\\'
)
end
=
p
+
1
;
if
(
end
)
/* got a directory */
{
if
(
dir
)
{
if
(
sz_dir
<=
end
-
inpath
)
goto
error
;
memcpy
(
dir
,
inpath
,
(
end
-
inpath
)
*
sizeof
(
wchar_t
)
);
dir
[
end
-
inpath
]
=
0
;
}
inpath
=
end
;
}
else
if
(
dir
)
dir
[
0
]
=
0
;
/* look for extension: what's after the last dot */
end
=
NULL
;
for
(
p
=
inpath
;
*
p
;
p
++
)
if
(
*
p
==
'.'
)
end
=
p
;
if
(
!
end
)
end
=
p
;
/* there's no extension */
if
(
fname
)
{
if
(
sz_fname
<=
end
-
inpath
)
goto
error
;
memcpy
(
fname
,
inpath
,
(
end
-
inpath
)
*
sizeof
(
wchar_t
)
);
fname
[
end
-
inpath
]
=
0
;
}
if
(
ext
)
{
if
(
sz_ext
<=
wcslen
(
end
))
goto
error
;
wcscpy
(
ext
,
end
);
}
return
0
;
error:
if
(
drive
)
drive
[
0
]
=
0
;
if
(
dir
)
dir
[
0
]
=
0
;
if
(
fname
)
fname
[
0
]
=
0
;
if
(
ext
)
ext
[
0
]
=
0
;
return
ERANGE
;
}
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