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
f46e2394
Commit
f46e2394
authored
Nov 13, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Copy MulDiv() implementation instead of forwarding.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c4550534
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+1
-1
main.c
dlls/kernelbase/main.c
+26
-0
No files found.
dlls/kernelbase/kernelbase.spec
View file @
f46e2394
...
...
@@ -959,7 +959,7 @@
@ stdcall MoveFileExW(wstr wstr long)
# @ stub MoveFileWithProgressTransactedW
@ stdcall MoveFileWithProgressW(wstr wstr ptr ptr long)
@ stdcall MulDiv(long long long)
kernel32.MulDiv
@ stdcall MulDiv(long long long)
@ stdcall MultiByteToWideChar(long long str long ptr long)
# @ stub NamedPipeEventEnum
# @ stub NamedPipeEventSelect
...
...
dlls/kernelbase/main.c
View file @
f46e2394
...
...
@@ -63,6 +63,32 @@ BOOL WINAPI DllMainCRTStartup( HANDLE inst, DWORD reason, LPVOID reserved )
/***********************************************************************
* MulDiv (kernelbase.@)
*/
INT
WINAPI
MulDiv
(
INT
a
,
INT
b
,
INT
c
)
{
LONGLONG
ret
;
if
(
!
c
)
return
-
1
;
/* We want to deal with a positive divisor to simplify the logic. */
if
(
c
<
0
)
{
a
=
-
a
;
c
=
-
c
;
}
/* If the result is positive, we "add" to round. else, we subtract to round. */
if
((
a
<
0
&&
b
<
0
)
||
(
a
>=
0
&&
b
>=
0
))
ret
=
(((
LONGLONG
)
a
*
b
)
+
(
c
/
2
))
/
c
;
else
ret
=
(((
LONGLONG
)
a
*
b
)
-
(
c
/
2
))
/
c
;
if
(
ret
>
2147483647
||
ret
<
-
2147483647
)
return
-
1
;
return
ret
;
}
/***********************************************************************
* AppPolicyGetProcessTerminationMethod (KERNELBASE.@)
*/
LONG
WINAPI
AppPolicyGetProcessTerminationMethod
(
HANDLE
token
,
AppPolicyProcessTerminationMethod
*
policy
)
...
...
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