Let DeviceIoControl call the appropriate native interface.
This commit is contained in:
parent
0789483dfc
commit
e5131213f6
|
@ -38,6 +38,7 @@
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "winerror.h"
|
#include "winerror.h"
|
||||||
#include "winternl.h"
|
#include "winternl.h"
|
||||||
|
#include "winioctl.h"
|
||||||
#include "kernel_private.h"
|
#include "kernel_private.h"
|
||||||
#include "wine/library.h"
|
#include "wine/library.h"
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
|
@ -359,19 +360,30 @@ BOOL WINAPI DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode,
|
||||||
|
|
||||||
if (lpOverlapped)
|
if (lpOverlapped)
|
||||||
{
|
{
|
||||||
status = NtDeviceIoControlFile(hDevice, lpOverlapped->hEvent,
|
if (HIWORD(dwIoControlCode) == FILE_DEVICE_FILE_SYSTEM)
|
||||||
NULL, NULL, (PIO_STATUS_BLOCK)lpOverlapped,
|
status = NtFsControlFile(hDevice, lpOverlapped->hEvent,
|
||||||
dwIoControlCode, lpvInBuffer, cbInBuffer,
|
NULL, NULL, (PIO_STATUS_BLOCK)lpOverlapped,
|
||||||
lpvOutBuffer, cbOutBuffer);
|
dwIoControlCode, lpvInBuffer, cbInBuffer,
|
||||||
|
lpvOutBuffer, cbOutBuffer);
|
||||||
|
else
|
||||||
|
status = NtDeviceIoControlFile(hDevice, lpOverlapped->hEvent,
|
||||||
|
NULL, NULL, (PIO_STATUS_BLOCK)lpOverlapped,
|
||||||
|
dwIoControlCode, lpvInBuffer, cbInBuffer,
|
||||||
|
lpvOutBuffer, cbOutBuffer);
|
||||||
if (lpcbBytesReturned) *lpcbBytesReturned = lpOverlapped->InternalHigh;
|
if (lpcbBytesReturned) *lpcbBytesReturned = lpOverlapped->InternalHigh;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
IO_STATUS_BLOCK iosb;
|
IO_STATUS_BLOCK iosb;
|
||||||
|
|
||||||
status = NtDeviceIoControlFile(hDevice, NULL, NULL, NULL, &iosb,
|
if (HIWORD(dwIoControlCode) == FILE_DEVICE_FILE_SYSTEM)
|
||||||
dwIoControlCode, lpvInBuffer, cbInBuffer,
|
status = NtFsControlFile(hDevice, NULL, NULL, NULL, &iosb,
|
||||||
lpvOutBuffer, cbOutBuffer);
|
dwIoControlCode, lpvInBuffer, cbInBuffer,
|
||||||
|
lpvOutBuffer, cbOutBuffer);
|
||||||
|
else
|
||||||
|
status = NtDeviceIoControlFile(hDevice, NULL, NULL, NULL, &iosb,
|
||||||
|
dwIoControlCode, lpvInBuffer, cbInBuffer,
|
||||||
|
lpvOutBuffer, cbOutBuffer);
|
||||||
if (lpcbBytesReturned) *lpcbBytesReturned = iosb.Information;
|
if (lpcbBytesReturned) *lpcbBytesReturned = iosb.Information;
|
||||||
}
|
}
|
||||||
if (status) SetLastError( RtlNtStatusToDosError(status) );
|
if (status) SetLastError( RtlNtStatusToDosError(status) );
|
||||||
|
|
Loading…
Reference in New Issue