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
c45abb8a
Commit
c45abb8a
authored
Jun 30, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add _i64tow_s.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
703212b6
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
+3
-0
wcstring.c
dlls/ntdll/wcstring.c
+74
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
c45abb8a
...
...
@@ -1504,12 +1504,15 @@
@ cdecl -arch=i386 -ret64 _ftol()
@ cdecl _i64toa(int64 ptr long)
@ cdecl _i64tow(int64 ptr long)
@ cdecl _i64tow_s(int64 ptr long long)
@ cdecl _itoa(long ptr long)
@ cdecl _itow(long ptr long)
@ cdecl _itow_s(long ptr long long)
@ cdecl _lfind(ptr ptr ptr long ptr)
@ stdcall -arch=x86_64,arm64 _local_unwind(ptr ptr)
@ cdecl _ltoa(long ptr long)
@ cdecl _ltow(long ptr long)
@ cdecl _ltow_s(long ptr long long)
@ cdecl _memccpy(ptr ptr long long)
@ cdecl _memicmp(str str long)
@ varargs _snprintf(ptr long str) NTDLL__snprintf
...
...
dlls/ntdll/wcstring.c
View file @
c45abb8a
...
...
@@ -1128,6 +1128,80 @@ errno_t __cdecl _ultow_s( __msvcrt_ulong value, wchar_t *str, size_t size, int r
/*********************************************************************
* _i64tow_s (NTDLL.@)
*/
errno_t
__cdecl
_i64tow_s
(
__int64
value
,
wchar_t
*
str
,
size_t
size
,
int
radix
)
{
unsigned
__int64
val
;
BOOL
is_negative
;
wchar_t
buffer
[
65
],
*
pos
;
if
(
!
str
||
!
size
)
return
EINVAL
;
if
(
radix
<
2
||
radix
>
36
)
{
str
[
0
]
=
0
;
return
EINVAL
;
}
if
(
value
<
0
&&
radix
==
10
)
{
is_negative
=
TRUE
;
val
=
-
value
;
}
else
{
is_negative
=
FALSE
;
val
=
value
;
}
pos
=
buffer
+
64
;
*
pos
=
0
;
do
{
unsigned
int
digit
=
val
%
radix
;
val
/=
radix
;
if
(
digit
<
10
)
*--
pos
=
'0'
+
digit
;
else
*--
pos
=
'a'
+
digit
-
10
;
}
while
(
val
!=
0
);
if
(
is_negative
)
*--
pos
=
'-'
;
if
(
buffer
-
pos
+
65
>
size
)
{
str
[
0
]
=
0
;
return
ERANGE
;
}
memcpy
(
str
,
pos
,
(
buffer
-
pos
+
65
)
*
sizeof
(
wchar_t
)
);
return
0
;
}
/*********************************************************************
* _ltow_s (NTDLL.@)
*/
errno_t
__cdecl
_ltow_s
(
__msvcrt_long
value
,
wchar_t
*
str
,
size_t
size
,
int
radix
)
{
if
(
value
<
0
&&
radix
==
10
)
return
_i64tow_s
(
value
,
str
,
size
,
radix
);
return
_ui64tow_s
(
(
__msvcrt_ulong
)
value
,
str
,
size
,
radix
);
}
/*********************************************************************
* _itow_s (NTDLL.@)
*/
errno_t
__cdecl
_itow_s
(
int
value
,
wchar_t
*
str
,
size_t
size
,
int
radix
)
{
if
(
value
<
0
&&
radix
==
10
)
return
_i64tow_s
(
value
,
str
,
size
,
radix
);
return
_ui64tow_s
(
(
unsigned
int
)
value
,
str
,
size
,
radix
);
}
/*********************************************************************
* _wtol (NTDLL.@)
*
* Converts a unicode string to a long integer.
...
...
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