13 Mar
2019
13 Mar
'19
2:16 a.m.
On 3/12/19 8:17 PM, Dmitry Timoshkov wrote:
Zebediah Figura <z.figura12(a)gmail.com> wrote:
+static BOOL sync_ioctl(HANDLE file, DWORD code, void *in_buf, DWORD in_len, void *out_buf, DWORD out_len, DWORD *ret_len) +{ + OVERLAPPED ovl = {0}; + BOOL ret; + + ovl.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); + ret = DeviceIoControl(file, code, in_buf, in_len, out_buf, out_len, ret_len, &ovl); + if (!ret && GetLastError() == ERROR_IO_PENDING) + ret = GetOverlappedResult(file, &ovl, ret_len, TRUE); + return ret; +} +
Are you leaking the ovl.hEvent handle?
Yes, I am. Thanks for spotting that.