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
b45f9488
Commit
b45f9488
authored
Jul 20, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
krnl386.exe16: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fdc9f3dc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
int21.c
dlls/krnl386.exe16/int21.c
+3
-3
interrupts.c
dlls/krnl386.exe16/interrupts.c
+2
-2
relay.c
dlls/krnl386.exe16/relay.c
+2
-2
snoop.c
dlls/krnl386.exe16/snoop.c
+2
-2
vxd.c
dlls/krnl386.exe16/vxd.c
+3
-3
No files found.
dlls/krnl386.exe16/int21.c
View file @
b45f9488
...
...
@@ -814,8 +814,8 @@ static HANDLE INT21_CreateMagicDeviceHandle( LPCWSTR name )
return
0
;
}
memcpy
(
nameW
.
Buffer
,
prefixW
,
sizeof
(
prefixW
)
);
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
dir
,
-
1
,
nameW
.
Buffer
+
sizeof
(
prefixW
)
/
sizeof
(
WCHAR
),
len
);
len
+=
sizeof
(
prefixW
)
/
sizeof
(
WCHAR
);
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
dir
,
-
1
,
nameW
.
Buffer
+
ARRAY_SIZE
(
prefixW
),
len
);
len
+=
ARRAY_SIZE
(
prefixW
);
nameW
.
Buffer
[
len
-
1
]
=
'/'
;
strcpyW
(
nameW
.
Buffer
+
len
,
name
);
...
...
@@ -3264,7 +3264,7 @@ static BOOL INT21_NetworkFunc (CONTEXT *context)
case
0x00
:
/* Get machine name. */
{
WCHAR
dstW
[
MAX_COMPUTERNAME_LENGTH
+
1
];
DWORD
s
=
sizeof
(
dstW
)
/
sizeof
(
WCHAR
);
DWORD
s
=
ARRAY_SIZE
(
dstW
);
int
len
;
char
*
dst
=
CTX_SEG_OFF_TO_LIN
(
context
,
context
->
SegDs
,
context
->
Edx
);
...
...
dlls/krnl386.exe16/interrupts.c
View file @
b45f9488
...
...
@@ -103,7 +103,7 @@ static void WINAPI DOSVM_DefaultHandler( CONTEXT *context )
*/
static
INTPROC
DOSVM_GetBuiltinHandler
(
BYTE
intnum
)
{
if
(
intnum
<
sizeof
(
DOSVM_VectorsBuiltin
)
/
sizeof
(
INTPROC
))
{
if
(
intnum
<
ARRAY_SIZE
(
DOSVM_VectorsBuiltin
))
{
INTPROC
proc
=
DOSVM_VectorsBuiltin
[
intnum
];
if
(
proc
)
return
proc
;
...
...
@@ -274,7 +274,7 @@ BOOL DOSVM_EmulateInterruptPM( CONTEXT *context, BYTE intnum )
else
if
(
wine_ldt_is_system
(
context
->
SegCs
))
{
INTPROC
proc
;
if
(
intnum
>=
sizeof
(
DOSVM_VectorsBuiltin
)
/
sizeof
(
INTPROC
))
return
FALSE
;
if
(
intnum
>=
ARRAY_SIZE
(
DOSVM_VectorsBuiltin
))
return
FALSE
;
if
(
!
(
proc
=
DOSVM_VectorsBuiltin
[
intnum
]))
return
FALSE
;
proc
(
context
);
}
...
...
dlls/krnl386.exe16/relay.c
View file @
b45f9488
...
...
@@ -345,7 +345,7 @@ static int relay_call_from_16_no_debug( void *entry_point, unsigned char *args16
int
args32
[
20
];
/* look for the ret instruction */
for
(
j
=
0
;
j
<
sizeof
(
call
->
ret
)
/
sizeof
(
call
->
ret
[
0
]
);
j
++
)
for
(
j
=
0
;
j
<
ARRAY_SIZE
(
call
->
ret
);
j
++
)
if
(
call
->
ret
[
j
]
==
0xca66
||
call
->
ret
[
j
]
==
0xcb66
)
break
;
if
(
call
->
ret
[
j
]
==
0xcb66
)
/* cdecl */
...
...
@@ -449,7 +449,7 @@ int relay_call_from_16( void *entry_point, unsigned char *args16, CONTEXT *conte
TRACE
(
"
\1
Call %s.%d: %s("
,
module
,
ordinal
,
func
);
/* look for the ret instruction */
for
(
j
=
0
;
j
<
sizeof
(
call
->
ret
)
/
sizeof
(
call
->
ret
[
0
]
);
j
++
)
for
(
j
=
0
;
j
<
ARRAY_SIZE
(
call
->
ret
);
j
++
)
if
(
call
->
ret
[
j
]
==
0xca66
||
call
->
ret
[
j
]
==
0xcb66
)
break
;
if
(
call
->
ret
[
j
]
==
0xcb66
)
/* cdecl */
...
...
dlls/krnl386.exe16/snoop.c
View file @
b45f9488
...
...
@@ -262,10 +262,10 @@ static void WINAPI SNOOP16_Entry(FARPROC proc, LPBYTE args, CONTEXT *context) {
return
;
/* oops */
}
while
(
*
rets
)
{
for
(
i
=
0
;
i
<
sizeof
((
*
rets
)
->
entry
)
/
sizeof
((
*
rets
)
->
entry
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
((
*
rets
)
->
entry
);
i
++
)
if
(
!
(
*
rets
)
->
entry
[
i
].
origreturn
)
break
;
if
(
i
!=
sizeof
((
*
rets
)
->
entry
)
/
sizeof
((
*
rets
)
->
entry
[
0
]
))
if
(
i
!=
ARRAY_SIZE
((
*
rets
)
->
entry
))
break
;
rets
=
&
((
*
rets
)
->
next
);
}
...
...
dlls/krnl386.exe16/vxd.c
View file @
b45f9488
...
...
@@ -129,8 +129,8 @@ static HANDLE open_vxd_handle( LPCWSTR name )
return
0
;
}
memcpy
(
nameW
.
Buffer
,
prefixW
,
sizeof
(
prefixW
)
);
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
dir
,
-
1
,
nameW
.
Buffer
+
sizeof
(
prefixW
)
/
sizeof
(
WCHAR
),
len
);
len
+=
sizeof
(
prefixW
)
/
sizeof
(
WCHAR
);
MultiByteToWideChar
(
CP_UNIXCP
,
0
,
dir
,
-
1
,
nameW
.
Buffer
+
ARRAY_SIZE
(
prefixW
),
len
);
len
+=
ARRAY_SIZE
(
prefixW
);
nameW
.
Buffer
[
len
-
1
]
=
'/'
;
strcpyW
(
nameW
.
Buffer
+
len
,
name
);
...
...
@@ -201,7 +201,7 @@ HANDLE __wine_vxd_open( LPCWSTR filenameW, DWORD access, SECURITY_ATTRIBUTES *sa
/* normalize the filename */
if
(
strlenW
(
filenameW
)
>=
sizeof
(
name
)
/
sizeof
(
WCHAR
)
-
4
||
if
(
strlenW
(
filenameW
)
>=
ARRAY_SIZE
(
name
)
-
4
||
strchrW
(
filenameW
,
'/'
)
||
strchrW
(
filenameW
,
'\\'
))
{
SetLastError
(
ERROR_FILE_NOT_FOUND
);
...
...
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