void DisposeWindowFromThreadID(uint32_t tid) { for (int i = 0; i < captures.size(); i++) { if (captures[i]->ThreadID == tid) { captures.removeAt(i); i--; } } for (int i = 0; i < windows.size(); i++) { guiserver_window* w = windows[i]; if (w->ThreadID == tid) { if (prevWindow == w) prevWindow = NULL; if (activeWindow == w) { activeWindow = NULL; // ActivateWindow(NULL); } if (w->FormBufferHandle != 0) { w->Visible = false; DrawWindow(w); } windows.removeAt(i); MemoryMap::unmap(w->Handle); i--; } } if (activeWindow == NULL) ActivateWindow(GetFrontWindow()); }
bool DisposeWindow(uint32_t handle) { if (prevWindow != NULL && prevWindow->Handle == handle) prevWindow = NULL; if (activeWindow != NULL && activeWindow->Handle == handle) ActivateWindow(NULL); int size_c = captures.size(); for (int i = 0; i < size_c; i++) { if (captures[i]->Handle == handle) { captures.removeAt(i); break; } } int size_w = windows.size(); for (int i = 0; i < size_w; i++) { guiserver_window* w = windows[i]; if (w->Handle == handle) { if (w->__internal2) DestructionEffect(w); windows.removeAt(i); MemoryMap::unmap(handle); if (activeWindow == NULL) ActivateWindow(GetFrontWindow()); return true; } } return false; }
static void unregisterReceiver(uint32_t tid) { int size = receivers.size(); for (int i = 0; i < size; i++) { if (receivers[i] != tid) continue; receivers.removeAt(i); return; } }
int __mlibc_filelist_remove_by_index(void *p, int n) { HList<FILE*>* list; if( p == NULL ) p = __mlibc_filelist_initializer(p); list = (HList<FILE*>*)p; if( list->size() <= n ) return 0; list->removeAt(n); return 1; }
void sendToClients(MessageInfo* msg) { for (int i = clients_.size() - 1; i >= 0; i--) { if (Message::send(clients_[i], msg) != M_OK) { monapi_warn("send error to pid = %x", clients_[i]); uint32_t temp; clients_.removeAt(i, &temp); } } }
bool DisposeBitmap(uint32_t handle) { int size = bitmaps.size(); for (int i = 0; i < size; i++) { if (bitmaps[i]->Handle == handle) { bitmaps.removeAt(i); MemoryMap::unmap(handle); return true; } } return false; }
void notifyProcessTerminated(uint32_t tid, int status) { int i = 0; while (i < receivers.size()) { if (Message::send(receivers[i], MSG_PROCESS_TERMINATED, tid, status) == M_OK) { i++; } else { _printf("%s: can not connect to %d\n", SVR, receivers[i]); removeProcessInfo(receivers[i]); receivers.removeAt(i); } } }
void notifyProcessCreated(uint32_t tid, uint32_t parent, const CString& path) { int i = 0; while (i < receivers.size()) { if (Message::send(receivers[i], MSG_PROCESS_CREATED, tid, parent, 0, path) == M_OK) { i++; } else { _printf("%s: can not connect to %d\n", SVR, receivers[i]); removeProcessInfo(receivers[i]); receivers.removeAt(i); } } }