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
7472ffd8
Commit
7472ffd8
authored
Oct 31, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Use NT instead of Unix calls to identify VxD pseudo-files.
parent
4934b7ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
25 deletions
+14
-25
vxd.c
dlls/kernel32/vxd.c
+14
-25
No files found.
dlls/kernel32/vxd.c
View file @
7472ffd8
...
...
@@ -52,11 +52,10 @@ typedef DWORD (WINAPI *VxDCallProc)(DWORD, CONTEXT86 *);
struct
vxd_module
{
dev_t
dev
;
ino_t
ino
;
HANDLE
handle
;
HMODULE
module
;
DeviceIoProc
proc
;
LARGE_INTEGER
index
;
HANDLE
handle
;
HMODULE
module
;
DeviceIoProc
proc
;
};
struct
vxdcall_service
...
...
@@ -134,30 +133,24 @@ static HANDLE open_vxd_handle( LPCWSTR name )
/* retrieve the DeviceIoControl function for a Vxd given a file handle */
static
DeviceIoProc
get_vxd_proc
(
HANDLE
handle
)
{
struct
stat
st
;
DeviceIoProc
ret
=
NULL
;
int
status
,
i
,
fd
;
int
status
,
i
;
IO_STATUS_BLOCK
io
;
FILE_INTERNAL_INFORMATION
info
;
status
=
wine_server_handle_to_fd
(
handle
,
0
,
&
fd
,
NULL
);
status
=
NtQueryInformationFile
(
handle
,
&
io
,
&
info
,
sizeof
(
info
),
FileInternalInformation
);
if
(
status
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
NULL
;
}
if
(
fstat
(
fd
,
&
st
)
==
-
1
)
{
wine_server_release_fd
(
handle
,
fd
);
SetLastError
(
ERROR_INVALID_HANDLE
);
return
NULL
;
}
wine_server_release_fd
(
handle
,
fd
);
RtlEnterCriticalSection
(
&
vxd_section
);
for
(
i
=
0
;
i
<
MAX_VXD_MODULES
;
i
++
)
{
if
(
!
vxd_modules
[
i
].
module
)
break
;
if
(
vxd_modules
[
i
].
dev
==
st
.
st_dev
&&
vxd_modules
[
i
].
ino
==
st
.
st_ino
)
if
(
vxd_modules
[
i
].
index
.
QuadPart
==
info
.
IndexNumber
.
QuadPart
)
{
if
(
!
(
ret
=
vxd_modules
[
i
].
proc
))
SetLastError
(
ERROR_INVALID_FUNCTION
);
goto
done
;
...
...
@@ -230,8 +223,8 @@ HANDLE VXD_Open( LPCWSTR filenameW, DWORD access, SECURITY_ATTRIBUTES *sa )
}
if
(
!
vxd_modules
[
i
].
module
)
/* new one, register it */
{
struct
stat
st
;
int
fd
;
IO_STATUS_BLOCK
io
;
FILE_INTERNAL_INFORMATION
info
;
/* get a file handle to the dummy file */
if
(
!
(
handle
=
open_vxd_handle
(
name
)))
...
...
@@ -239,16 +232,12 @@ HANDLE VXD_Open( LPCWSTR filenameW, DWORD access, SECURITY_ATTRIBUTES *sa )
FreeLibrary
(
module
);
goto
done
;
}
wine_server_handle_to_fd
(
handle
,
0
,
&
fd
,
NULL
);
if
(
fstat
(
fd
,
&
st
)
!=
-
1
)
{
vxd_modules
[
i
].
dev
=
st
.
st_dev
;
vxd_modules
[
i
].
ino
=
st
.
st_ino
;
}
if
(
!
NtQueryInformationFile
(
handle
,
&
io
,
&
info
,
sizeof
(
info
),
FileInternalInformation
))
vxd_modules
[
i
].
index
=
info
.
IndexNumber
;
vxd_modules
[
i
].
module
=
module
;
vxd_modules
[
i
].
handle
=
handle
;
vxd_modules
[
i
].
proc
=
(
DeviceIoProc
)
GetProcAddress
(
module
,
"DeviceIoControl"
);
wine_server_release_fd
(
handle
,
fd
);
goto
done
;
}
}
...
...
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