DWORD WINAPI CircularIO(LPVOID lpParameter) { int c = 0; LPSOCKET_INFORMATION tmp = (LPSOCKET_INFORMATION)malloc(sizeof(SOCKET_INFORMATION)); DWORD ret; WSAEVENT e[1]; e[0] = CircularEvent; while (TRUE) { ret = WSAWaitForMultipleEvents(1, e, FALSE, 100, FALSE); if (ret == WSA_WAIT_TIMEOUT) { CBFree(&CircularBuff); free(tmp); fclose(fp); return FALSE; } if (ret != WAIT_IO_COMPLETION) { while (CircularBuff.Count != 0) { CBPop(&CircularBuff, tmp); SendMessage(hProgress, PBM_DELTAPOS, 10, 0); /* Increment progress bar */ /* Write the packet content to a output file */ fprintf(fp, tmp->Buffer); ResetEvent(CircularEvent); } } } free(tmp); return TRUE; }
void CBFreeScript(CBScript * self){ CBFreeProcessScript(self); CBFree(); }
void CBFreeString(CBString * self){ CBFreeProcessString(self); CBFree(); }
void CBFreeNetworkParameters(CBNetworkParameters * self){ CBFreeProcessNetworkParameters(self); CBFree(); }