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
59e81ec1
Commit
59e81ec1
authored
Nov 12, 2002
by
Robert Shearman
Committed by
Alexandre Julliard
Nov 12, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented RtlUnicodeStringToInteger.
parent
7daf45a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
1 deletion
+74
-1
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-1
rtlstr.c
dlls/ntdll/rtlstr.c
+73
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
59e81ec1
...
...
@@ -528,7 +528,7 @@
@ stdcall RtlUnicodeStringToAnsiSize(ptr) RtlUnicodeStringToAnsiSize
@ stdcall RtlUnicodeStringToAnsiString(ptr ptr long) RtlUnicodeStringToAnsiString
@ stub RtlUnicodeStringToCountedOemString
@ st
ub
RtlUnicodeStringToInteger
@ st
dcall RtlUnicodeStringToInteger(ptr long ptr)
RtlUnicodeStringToInteger
@ stdcall RtlUnicodeStringToOemSize(ptr) RtlUnicodeStringToOemSize
@ stdcall RtlUnicodeStringToOemString(ptr ptr long) RtlUnicodeStringToOemString
@ stub RtlUnicodeToCustomCPN
...
...
dlls/ntdll/rtlstr.c
View file @
59e81ec1
...
...
@@ -835,3 +835,76 @@ out:
*
pf
=
out_flags
;
return
len
;
}
/**************************************************************************
* RtlUnicodeStringToInteger (NTDLL.@)
*
* Convert a text buffer into its integer form
*/
NTSTATUS
WINAPI
RtlUnicodeStringToInteger
(
const
UNICODE_STRING
*
str
,
int
base
,
int
*
pdest
)
{
LPWSTR
lpwstr
=
str
->
Buffer
;
WCHAR
wchCurrent
=
0
;
int
CharsParsed
=
0
;
int
RunningTotal
=
0
;
char
bMinus
=
0
;
/* no checking done on UNICODE_STRING and int* in native DLL either */
TRACE
(
"(%p, %d, %p)"
,
str
,
base
,
pdest
);
switch
(
base
)
{
case
0
:
base
=
10
;
break
;
case
2
:
case
8
:
case
10
:
case
16
:
break
;
default:
return
STATUS_INVALID_PARAMETER
;
}
if
((
str
->
Length
)
>=
4
&&
(
base
==
10
)
&&
(
*
lpwstr
==
'0'
)
&&
(
*
(
lpwstr
+
1
)
==
'x'
))
{
lpwstr
+=
2
;
base
=
16
;
}
*
pdest
=
0
;
for
(;
(
CharsParsed
*
sizeof
(
WCHAR
)
<
str
->
Length
)
&&
(
*
lpwstr
<=
' '
);
lpwstr
++
)
CharsParsed
++
;
if
(
*
lpwstr
==
'+'
)
lpwstr
++
;
else
if
(
*
lpwstr
==
'-'
)
{
bMinus
=
1
;
lpwstr
++
;
}
for
(;
(
CharsParsed
*
sizeof
(
WCHAR
)
<
str
->
Length
)
&&
(
*
lpwstr
!=
'\0'
);
lpwstr
++
)
{
CharsParsed
++
;
wchCurrent
=
*
lpwstr
;
if
(
wchCurrent
>=
'A'
)
wchCurrent
=
'0'
+
10
+
wchCurrent
-
'A'
;
if
((
wchCurrent
-
'0'
)
>=
base
||
wchCurrent
<
'0'
)
{
*
pdest
=
bMinus
?
-
RunningTotal
:
RunningTotal
;
return
STATUS_SUCCESS
;
}
/*
* increase significance of previous digits each time
* we find another valid one and add on this valid one
*/
RunningTotal
=
wchCurrent
-
'0'
+
RunningTotal
*
base
;
}
*
pdest
=
bMinus
?
-
RunningTotal
:
RunningTotal
;
return
STATUS_SUCCESS
;
}
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