Skip to content

Commit

Permalink
Refs #1839. Reset bulkUsbDev after close.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@1083 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
  • Loading branch information
feaser committed Sep 17, 2023
1 parent fda0af2 commit 74c8b78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Host/Source/LibOpenBLT/port/windows/usbbulk.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ static uint8_t UblOpen(LPCGUID guid)
/* Init device members. */
bulkUsbDev.hDev = NULL;
bulkUsbDev.hWinUSBDev = NULL;
bulkUsbDev.evReader = NULL;
bulkUsbDev.pipeBulkIn = INVALID_PIPE_ID;
bulkUsbDev.pipeBulkOut = INVALID_PIPE_ID;
/* Open the usb device. */
Expand Down Expand Up @@ -306,11 +307,13 @@ static void UblClose(void)
if (bulkUsbDev.evReader != NULL)
{
(void)CloseHandle(bulkUsbDev.evReader);
bulkUsbDev.evReader = NULL;
}
/* close the winusb device */
if (bulkUsbDev.hWinUSBDev != NULL)
{
(void)WinUsb_Free(bulkUsbDev.hWinUSBDev);
bulkUsbDev.hWinUSBDev = NULL;
}
/* reset bulk OUT and IN pipes */
bulkUsbDev.pipeBulkOut = INVALID_PIPE_ID;
Expand All @@ -319,6 +322,7 @@ static void UblClose(void)
if (bulkUsbDev.hDev != NULL)
{
(void)CloseHandle(bulkUsbDev.hDev);
bulkUsbDev.hDev = NULL;
}
} /*** end of UblClose ***/

Expand Down
Binary file modified Host/libopenblt.dll
Binary file not shown.

0 comments on commit 74c8b78

Please sign in to comment.