/* session_handle from previous call to TMExtendedStartSession */ ... if (TMEndSession(session_handle) == 0) { /* the session_handle was not valid to end */ ... } else { /* session successfully ended */ ... }