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
38ba364c
Commit
38ba364c
authored
Jul 05, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
krnl386.exe16: Avoid ARRAY_SIZE-like macros.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
de8c478c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
12 deletions
+6
-12
error.c
dlls/krnl386.exe16/error.c
+2
-4
int21.c
dlls/krnl386.exe16/int21.c
+3
-5
vxd.c
dlls/krnl386.exe16/vxd.c
+1
-3
No files found.
dlls/krnl386.exe16/error.c
View file @
38ba364c
...
@@ -193,8 +193,6 @@ static const struct {
...
@@ -193,8 +193,6 @@ static const struct {
};
};
#undef ErrorString
#undef ErrorString
#define ErrorStringCount (sizeof(ErrorStrings) / sizeof(ErrorStrings[0]))
#define ParamErrorStringCount (sizeof(ParamErrorStrings) / sizeof(ParamErrorStrings[0]))
/***********************************************************************
/***********************************************************************
* GetErrorString (internal)
* GetErrorString (internal)
...
@@ -204,7 +202,7 @@ static const char *GetErrorString(UINT16 uErr)
...
@@ -204,7 +202,7 @@ static const char *GetErrorString(UINT16 uErr)
static
char
buffer
[
80
];
static
char
buffer
[
80
];
unsigned
int
n
;
unsigned
int
n
;
for
(
n
=
0
;
n
<
ErrorStringCount
;
n
++
)
{
for
(
n
=
0
;
n
<
ARRAY_SIZE
(
ErrorStrings
)
;
n
++
)
{
if
(
uErr
==
ErrorStrings
[
n
].
constant
)
if
(
uErr
==
ErrorStrings
[
n
].
constant
)
return
ErrorStrings
[
n
].
name
;
return
ErrorStrings
[
n
].
name
;
}
}
...
@@ -229,7 +227,7 @@ static const char *GetParamErrorString(UINT16 uErr) {
...
@@ -229,7 +227,7 @@ static const char *GetParamErrorString(UINT16 uErr) {
{
{
unsigned
int
n
;
unsigned
int
n
;
for
(
n
=
0
;
n
<
ParamErrorStringCount
;
n
++
)
{
for
(
n
=
0
;
n
<
ARRAY_SIZE
(
ParamErrorStrings
)
;
n
++
)
{
if
(
uErr
==
ParamErrorStrings
[
n
].
constant
)
{
if
(
uErr
==
ParamErrorStrings
[
n
].
constant
)
{
strcat
(
buffer
,
ParamErrorStrings
[
n
].
name
);
strcat
(
buffer
,
ParamErrorStrings
[
n
].
name
);
return
buffer
;
return
buffer
;
...
...
dlls/krnl386.exe16/int21.c
View file @
38ba364c
...
@@ -282,8 +282,6 @@ static struct magic_device magic_devices[] =
...
@@ -282,8 +282,6 @@ static struct magic_device magic_devices[] =
{
{
'h'
,
'p'
,
's'
,
'c'
,
'a'
,
'n'
,
0
},
NULL
,
{
{
0
,
0
}
},
INT21_IoctlHPScanHandler
},
{
{
'h'
,
'p'
,
's'
,
'c'
,
'a'
,
'n'
,
0
},
NULL
,
{
{
0
,
0
}
},
INT21_IoctlHPScanHandler
},
};
};
#define NB_MAGIC_DEVICES (sizeof(magic_devices)/sizeof(magic_devices[0]))
/* Many calls translate a drive argument like this:
/* Many calls translate a drive argument like this:
drive number (00h = default, 01h = A:, etc)
drive number (00h = default, 01h = A:, etc)
...
@@ -856,13 +854,13 @@ static HANDLE INT21_OpenMagicDevice( LPCWSTR name, DWORD access )
...
@@ -856,13 +854,13 @@ static HANDLE INT21_OpenMagicDevice( LPCWSTR name, DWORD access )
if
((
p
=
strrchrW
(
name
,
'/'
)))
name
=
p
+
1
;
if
((
p
=
strrchrW
(
name
,
'/'
)))
name
=
p
+
1
;
if
((
p
=
strrchrW
(
name
,
'\\'
)))
name
=
p
+
1
;
if
((
p
=
strrchrW
(
name
,
'\\'
)))
name
=
p
+
1
;
for
(
i
=
0
;
i
<
NB_MAGIC_DEVICES
;
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
magic_devices
)
;
i
++
)
{
{
int
len
=
strlenW
(
magic_devices
[
i
].
name
);
int
len
=
strlenW
(
magic_devices
[
i
].
name
);
if
(
!
strncmpiW
(
magic_devices
[
i
].
name
,
name
,
len
)
&&
if
(
!
strncmpiW
(
magic_devices
[
i
].
name
,
name
,
len
)
&&
(
!
name
[
len
]
||
name
[
len
]
==
'.'
||
name
[
len
]
==
':'
))
break
;
(
!
name
[
len
]
||
name
[
len
]
==
'.'
||
name
[
len
]
==
':'
))
break
;
}
}
if
(
i
==
NB_MAGIC_DEVICES
)
return
0
;
if
(
i
==
ARRAY_SIZE
(
magic_devices
)
)
return
0
;
if
(
!
magic_devices
[
i
].
handle
)
/* need to open it */
if
(
!
magic_devices
[
i
].
handle
)
/* need to open it */
{
{
...
@@ -2639,7 +2637,7 @@ static void INT21_Ioctl_Char( CONTEXT *context )
...
@@ -2639,7 +2637,7 @@ static void INT21_Ioctl_Char( CONTEXT *context )
}
}
}
else
{
}
else
{
UINT
i
;
UINT
i
;
for
(
i
=
0
;
i
<
NB_MAGIC_DEVICES
;
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
magic_devices
)
;
i
++
)
{
{
if
(
!
magic_devices
[
i
].
handle
)
continue
;
if
(
!
magic_devices
[
i
].
handle
)
continue
;
if
(
magic_devices
[
i
].
index
.
QuadPart
==
info
.
IndexNumber
.
QuadPart
)
if
(
magic_devices
[
i
].
index
.
QuadPart
==
info
.
IndexNumber
.
QuadPart
)
...
...
dlls/krnl386.exe16/vxd.c
View file @
38ba364c
...
@@ -80,8 +80,6 @@ static struct vxdcall_service vxd_services[] =
...
@@ -80,8 +80,6 @@ static struct vxdcall_service vxd_services[] =
{
{
'v'
,
'w'
,
'i'
,
'n'
,
'3'
,
'2'
,
'.'
,
'v'
,
'x'
,
'd'
,
0
},
0x002a
,
NULL
,
NULL
}
{
{
'v'
,
'w'
,
'i'
,
'n'
,
'3'
,
'2'
,
'.'
,
'v'
,
'x'
,
'd'
,
0
},
0x002a
,
NULL
,
NULL
}
};
};
#define NB_VXD_SERVICES (sizeof(vxd_services)/sizeof(vxd_services[0]))
#define W32S_APP2WINE(addr) ((addr)? (DWORD)(addr) + W32S_offset : 0)
#define W32S_APP2WINE(addr) ((addr)? (DWORD)(addr) + W32S_offset : 0)
#define W32S_WINE2APP(addr) ((addr)? (DWORD)(addr) - W32S_offset : 0)
#define W32S_WINE2APP(addr) ((addr)? (DWORD)(addr) - W32S_offset : 0)
...
@@ -293,7 +291,7 @@ void WINAPI DECLSPEC_HIDDEN __regs_VxDCall( CONTEXT *context )
...
@@ -293,7 +291,7 @@ void WINAPI DECLSPEC_HIDDEN __regs_VxDCall( CONTEXT *context )
DWORD
service
=
stack32_pop
(
context
);
DWORD
service
=
stack32_pop
(
context
);
RtlEnterCriticalSection
(
&
vxd_section
);
RtlEnterCriticalSection
(
&
vxd_section
);
for
(
i
=
0
;
i
<
NB_VXD_SERVICES
;
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
vxd_services
)
;
i
++
)
{
{
if
(
HIWORD
(
service
)
!=
vxd_services
[
i
].
service
)
continue
;
if
(
HIWORD
(
service
)
!=
vxd_services
[
i
].
service
)
continue
;
if
(
!
vxd_services
[
i
].
module
)
/* need to load it */
if
(
!
vxd_services
[
i
].
module
)
/* need to load it */
...
...
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