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
c4ff18f7
Commit
c4ff18f7
authored
Aug 26, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Call kernelbase DeviceIoControl() in kernel32 DeviceIoControl().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8d37962b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
49 deletions
+10
-49
file.c
dlls/kernel32/file.c
+9
-48
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-1
No files found.
dlls/kernel32/file.c
View file @
c4ff18f7
...
...
@@ -389,21 +389,16 @@ HANDLE WINAPI OpenVxDHandle(HANDLE hHandleRing3)
/****************************************************************************
* DeviceIoControl (KERNEL32.@)
*/
BOOL
WINAPI
DeviceIoControl
(
HANDLE
hDevice
,
DWORD
dwIoControlCode
,
LPVOID
lpvInBuffer
,
DWORD
cbInBuffer
,
LPVOID
lpvOutBuffer
,
DWORD
cbOutBuffer
,
LPDWORD
lpcbBytesReturned
,
LPOVERLAPPED
lpOverlapped
)
BOOL
WINAPI
KERNEL32_DeviceIoControl
(
HANDLE
handle
,
DWORD
code
,
void
*
in_buff
,
DWORD
in_count
,
void
*
out_buff
,
DWORD
out_count
,
DWORD
*
returned
,
OVERLAPPED
*
overlapped
)
{
NTSTATUS
status
;
TRACE
(
"(%p,%x,%p,%d,%p,%d,%p,%p)
\n
"
,
hDevice
,
dwIoControlCode
,
lpvInBuffer
,
cbInBuffer
,
lpvOutBuffer
,
cbOutBuffer
,
lpcbBytesReturned
,
lpOverlapped
);
TRACE
(
"(%p,%#x,%p,%d,%p,%d,%p,%p)
\n
"
,
handle
,
code
,
in_buff
,
in_count
,
out_buff
,
out_count
,
returned
,
overlapped
);
/* Check if this is a user defined control code for a VxD */
if
(
HIWORD
(
dwIoControlC
ode
)
==
0
&&
(
GetVersion
()
&
0x80000000
))
if
(
HIWORD
(
c
ode
)
==
0
&&
(
GetVersion
()
&
0x80000000
))
{
typedef
BOOL
(
WINAPI
*
DeviceIoProc
)(
DWORD
,
LPVOID
,
DWORD
,
LPVOID
,
DWORD
,
LPDWORD
,
LPOVERLAPPED
);
static
DeviceIoProc
(
*
vxd_get_proc
)(
HANDLE
);
...
...
@@ -411,45 +406,11 @@ BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode,
if
(
!
vxd_get_proc
)
vxd_get_proc
=
(
void
*
)
GetProcAddress
(
GetModuleHandleW
(
L"krnl386.exe16"
),
"__wine_vxd_get_proc"
);
if
(
vxd_get_proc
)
proc
=
vxd_get_proc
(
hDevice
);
if
(
proc
)
return
proc
(
dwIoControlCode
,
lpvInBuffer
,
cbInBuffer
,
lpvOutBuffer
,
cbOutBuffer
,
lpcbBytesReturned
,
lpOverlapped
);
if
(
vxd_get_proc
)
proc
=
vxd_get_proc
(
handle
);
if
(
proc
)
return
proc
(
code
,
in_buff
,
in_count
,
out_buff
,
out_count
,
returned
,
overlapped
);
}
/* Not a VxD, let ntdll handle it */
if
(
lpOverlapped
)
{
LPVOID
cvalue
=
((
ULONG_PTR
)
lpOverlapped
->
hEvent
&
1
)
?
NULL
:
lpOverlapped
;
lpOverlapped
->
Internal
=
STATUS_PENDING
;
lpOverlapped
->
InternalHigh
=
0
;
if
(
HIWORD
(
dwIoControlCode
)
==
FILE_DEVICE_FILE_SYSTEM
)
status
=
NtFsControlFile
(
hDevice
,
lpOverlapped
->
hEvent
,
NULL
,
cvalue
,
(
PIO_STATUS_BLOCK
)
lpOverlapped
,
dwIoControlCode
,
lpvInBuffer
,
cbInBuffer
,
lpvOutBuffer
,
cbOutBuffer
);
else
status
=
NtDeviceIoControlFile
(
hDevice
,
lpOverlapped
->
hEvent
,
NULL
,
cvalue
,
(
PIO_STATUS_BLOCK
)
lpOverlapped
,
dwIoControlCode
,
lpvInBuffer
,
cbInBuffer
,
lpvOutBuffer
,
cbOutBuffer
);
if
(
lpcbBytesReturned
)
*
lpcbBytesReturned
=
lpOverlapped
->
InternalHigh
;
}
else
{
IO_STATUS_BLOCK
iosb
;
if
(
HIWORD
(
dwIoControlCode
)
==
FILE_DEVICE_FILE_SYSTEM
)
status
=
NtFsControlFile
(
hDevice
,
NULL
,
NULL
,
NULL
,
&
iosb
,
dwIoControlCode
,
lpvInBuffer
,
cbInBuffer
,
lpvOutBuffer
,
cbOutBuffer
);
else
status
=
NtDeviceIoControlFile
(
hDevice
,
NULL
,
NULL
,
NULL
,
&
iosb
,
dwIoControlCode
,
lpvInBuffer
,
cbInBuffer
,
lpvOutBuffer
,
cbOutBuffer
);
if
(
lpcbBytesReturned
)
*
lpcbBytesReturned
=
iosb
.
Information
;
}
return
set_ntstatus
(
status
);
return
DeviceIoControl
(
handle
,
code
,
in_buff
,
in_count
,
out_buff
,
out_count
,
returned
,
overlapped
);
}
...
...
dlls/kernel32/kernel32.spec
View file @
c4ff18f7
...
...
@@ -377,7 +377,7 @@
@ stdcall DeleteVolumeMountPointA(str)
@ stdcall -import DeleteVolumeMountPointW(wstr)
@ stdcall -arch=x86_64 DequeueUmsCompletionListItems(ptr long ptr)
@ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr)
@ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr)
KERNEL32_DeviceIoControl
@ stdcall -import DisableThreadLibraryCalls(long)
@ stdcall -import DisconnectNamedPipe(long)
@ stdcall DnsHostnameToComputerNameA (str ptr ptr)
...
...
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