Advertisement
Guest User

Untitled

a guest
Sep 28th, 2018
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void USBAPI(DestroyPort) (UsbPort * port)
  2. {
  3.     if(port->device)
  4.         USBAPI(DestroyDevice)(port->device);
  5.     if(port->hub != NULL)
  6.     {
  7.         UsbPort ** it = &port->hub->ports;
  8.         while((*it) != NULL)
  9.         {
  10.             if((*it) == port)
  11.                 *it = (*it)->next;
  12.             else
  13.                 it = &(*it)->next;
  14.         }
  15.     }
  16.     free(port);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement