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
d2abcecd
Commit
d2abcecd
authored
Oct 31, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winedos: Use NT instead of Unix calls to identify DOS device pseudo-files.
parent
7472ffd8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
21 deletions
+15
-21
int21.c
dlls/winedos/int21.c
+15
-21
No files found.
dlls/winedos/int21.c
View file @
d2abcecd
...
...
@@ -267,8 +267,7 @@ struct magic_device
{
WCHAR
name
[
10
];
HANDLE
handle
;
dev_t
dev
;
ino_t
ino
;
LARGE_INTEGER
index
;
void
(
*
ioctl_handler
)(
CONTEXT86
*
);
};
...
...
@@ -278,9 +277,9 @@ static void INT21_IoctlHPScanHandler( CONTEXT86 * );
static
struct
magic_device
magic_devices
[]
=
{
{
{
's'
,
'c'
,
's'
,
'i'
,
'm'
,
'g'
,
'r'
,
'$'
,
0
},
NULL
,
0
,
0
,
INT21_IoctlScsiMgrHandler
},
{
{
'e'
,
'm'
,
'm'
,
'x'
,
'x'
,
'x'
,
'x'
,
'0'
,
0
},
NULL
,
0
,
0
,
INT21_IoctlEMSHandler
},
{
{
'h'
,
'p'
,
's'
,
'c'
,
'a'
,
'n'
,
0
},
NULL
,
0
,
0
,
INT21_IoctlHPScanHandler
},
{
{
's'
,
'c'
,
's'
,
'i'
,
'm'
,
'g'
,
'r'
,
'$'
,
0
},
NULL
,
{
{
0
,
0
}
}
,
INT21_IoctlScsiMgrHandler
},
{
{
'e'
,
'm'
,
'm'
,
'x'
,
'x'
,
'x'
,
'x'
,
'0'
,
0
},
NULL
,
{
{
0
,
0
}
}
,
INT21_IoctlEMSHandler
},
{
{
'h'
,
'p'
,
's'
,
'c'
,
'a'
,
'n'
,
0
},
NULL
,
{
{
0
,
0
}
}
,
INT21_IoctlHPScanHandler
},
};
#define NB_MAGIC_DEVICES (sizeof(magic_devices)/sizeof(magic_devices[0]))
...
...
@@ -911,15 +910,13 @@ static HANDLE INT21_OpenMagicDevice( LPCWSTR name, DWORD access )
if
(
!
magic_devices
[
i
].
handle
)
/* need to open it */
{
int
fd
;
struct
stat
st
;
IO_STATUS_BLOCK
io
;
FILE_INTERNAL_INFORMATION
info
;
if
(
!
(
handle
=
INT21_CreateMagicDeviceHandle
(
magic_devices
[
i
].
name
)))
return
0
;
wine_server_handle_to_fd
(
handle
,
0
,
&
fd
,
NULL
);
fstat
(
fd
,
&
st
);
wine_server_release_fd
(
handle
,
fd
);
magic_devices
[
i
].
dev
=
st
.
st_dev
;
magic_devices
[
i
].
ino
=
st
.
st_ino
;
NtQueryInformationFile
(
handle
,
&
io
,
&
info
,
sizeof
(
info
),
FileInternalInformation
);
magic_devices
[
i
].
index
=
info
.
IndexNumber
;
magic_devices
[
i
].
handle
=
handle
;
}
if
(
!
DuplicateHandle
(
GetCurrentProcess
(),
magic_devices
[
i
].
handle
,
...
...
@@ -2732,12 +2729,13 @@ static void INT21_IoctlHPScanHandler( CONTEXT86 *context )
*/
static
void
INT21_Ioctl_Char
(
CONTEXT86
*
context
)
{
struct
stat
st
;
int
status
,
i
,
fd
;
int
status
,
i
;
int
IsConsoleIOHandle
=
0
;
IO_STATUS_BLOCK
io
;
FILE_INTERNAL_INFORMATION
info
;
HANDLE
handle
=
DosFileHandleToWin32Handle
(
BX_reg
(
context
));
status
=
wine_server_handle_to_fd
(
handle
,
0
,
&
fd
,
NULL
);
status
=
NtQueryInformationFile
(
handle
,
&
io
,
&
info
,
sizeof
(
info
),
FileInternalInformation
);
if
(
status
)
{
if
(
VerifyConsoleIoHandle
(
handle
))
...
...
@@ -2748,14 +2746,10 @@ static void INT21_Ioctl_Char( CONTEXT86 *context )
return
;
}
}
else
{
fstat
(
fd
,
&
st
);
IsConsoleIOHandle
=
isatty
(
fd
);
wine_server_release_fd
(
handle
,
fd
);
for
(
i
=
0
;
i
<
NB_MAGIC_DEVICES
;
i
++
)
{
if
(
!
magic_devices
[
i
].
handle
)
continue
;
if
(
magic_devices
[
i
].
dev
==
st
.
st_dev
&&
magic_devices
[
i
].
ino
==
st
.
st_ino
)
if
(
magic_devices
[
i
].
index
.
QuadPart
==
info
.
IndexNumber
.
QuadPart
)
{
/* found it */
magic_devices
[
i
].
ioctl_handler
(
context
);
...
...
@@ -2770,7 +2764,7 @@ static void INT21_Ioctl_Char( CONTEXT86 *context )
{
case
0x00
:
/* GET DEVICE INFORMATION */
TRACE
(
"IOCTL - GET DEVICE INFORMATION - %d
\n
"
,
BX_reg
(
context
)
);
if
(
IsConsoleIOHandle
||
S_ISCHR
(
st
.
st_mode
)
)
if
(
IsConsoleIOHandle
||
GetFileType
(
handle
)
==
FILE_TYPE_CHAR
)
{
/*
* Returns attribute word in DX:
...
...
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