[pywin32-bugs] [ pywin32-Bugs-1380832 ] win32file.DeviceIoControl can't do OVERLAPPED with output
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
Old Bugs - new issues at https://github.com/mhammond/pywin32/issues
Old Patches - new patches via https://github.com/mhammond/pywin32/pulls
Old Feature Requests - new issues at https://github.com/mhammond/pywin32/issues
From: SourceForge.net <no...@so...> - 2005-12-14 22:12:18
Bugs item #1380832, was opened at 2005-12-15 08:13
Message generated for change (Comment added) made by mhammond
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1380832&group_id=78018
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: win32
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Siggi (sigurasg)
Assigned to: Nobody/Anonymous (nobody)
Summary: win32file.DeviceIoControl can't do OVERLAPPED with output
Initial Comment:
In the case where win32file.DeviceIoControl is called
on an async IOCTL with output, and an OVERLAPPED
structure is called,
it'll do the wrong thing.
In this case win32 function will return FALSE, and
::GetLastError will return ERROR_IO_PENDING.
In this case it's the caller's responsibility to keep
the output buffer (readData) around until the IO
completes or is cancelled, but the code below
deallocates it.
ok = DeviceIoControl(hDevice,
dwIoControlCode,
writeData,
writeSize,
readData,
readSize,
&numRead,
pOverlapped);
Py_END_ALLOW_THREADS
if (!ok) {
free(readData);
return PyWin_SetAPIError("DeviceIoControl");
Also, given the current interface, there's no way to
retrieve the output of an overlapped IOCTL. This'd
require much the same output convention as
win32file.ReadFile.
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2005-12-15 09:12
Message:
Logged In: YES
user_id=14198
That sounds correct. Patches gratefully accepted (or even
just something I could add to the test suite!)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1380832&group_id=78018
Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
More information about our ad policies
Please provide the ad click URL, if possible: