/** * Function description * * @return 0 on success, otherwise a Win32 error code */ UINT tsmf_ifman_shutdown_presentation(TSMF_IFMAN* ifman) { TSMF_PRESENTATION* presentation; DEBUG_TSMF(""); if (Stream_GetRemainingLength(ifman->input) < GUID_SIZE) return ERROR_INVALID_DATA; presentation = tsmf_presentation_find_by_id(Stream_Pointer(ifman->input)); if (presentation) tsmf_presentation_free(presentation); else { WLog_ERR(TAG, "unknown presentation id"); return ERROR_NOT_FOUND; } if (!Stream_EnsureRemainingCapacity(ifman->output, 4)) return ERROR_OUTOFMEMORY; Stream_Write_UINT32(ifman->output, 0); /* Result */ ifman->output_interface_id = TSMF_INTERFACE_DEFAULT | STREAM_ID_STUB; return CHANNEL_RC_OK; }
int tsmf_ifman_shutdown_presentation(TSMF_IFMAN * ifman) { TSMF_PRESENTATION * presentation; LLOGLN(0, ("tsmf_ifman_shutdown_presentation:")); presentation = tsmf_presentation_find_by_id(ifman->input_buffer); if (presentation) tsmf_presentation_free(presentation); ifman->output_buffer_size = 4; ifman->output_buffer = malloc(4); SET_UINT32(ifman->output_buffer, 0, 0); /* Result */ ifman->output_interface_id = TSMF_INTERFACE_DEFAULT | STREAM_ID_STUB; return 0; }
int tsmf_ifman_shutdown_presentation(TSMF_IFMAN* ifman) { TSMF_PRESENTATION* presentation; DEBUG_DVC(""); presentation = tsmf_presentation_find_by_id(Stream_Pointer(ifman->input)); if (presentation) tsmf_presentation_free(presentation); else DEBUG_WARN("unknown presentation id"); Stream_EnsureRemainingCapacity(ifman->output, 4); Stream_Write_UINT32(ifman->output, 0); /* Result */ ifman->output_interface_id = TSMF_INTERFACE_DEFAULT | STREAM_ID_STUB; return 0; }
static void tsmf_signal_handler(int s) { LIST_ITEM* p_item; TSMF_PRESENTATION* presentation; LIST_ITEM* s_item; TSMF_STREAM* _stream; WaitForSingleObject(tsmf_mutex, INFINITE); TERMINATING = 1; ReleaseMutex(tsmf_mutex); if (presentation_list) { for (p_item = presentation_list->head; p_item; p_item = p_item->next) { presentation = (TSMF_PRESENTATION*) p_item->data; for (s_item = presentation->stream_list->head; s_item; s_item = s_item->next) { _stream = (TSMF_STREAM*) s_item->data; tsmf_stream_free(_stream); } tsmf_presentation_free(presentation); } } unlink("/tmp/tsmf.tid"); if (s == SIGINT) { signal(s, SIG_DFL); kill(getpid(), s); } else if (s == SIGUSR1) { signal(s, SIG_DFL); } }