| 160 | } |
| 161 | |
| 162 | MCAPI_ATTR McResult MCAPI_CALL mcDebugMessageControl(McContext pContext, McDebugSource source, McDebugType type, McDebugSeverity severity, bool enabled) |
| 163 | { |
| 164 | McResult return_value = McResult::MC_NO_ERROR; |
| 165 | per_thread_api_log_str.clear(); |
| 166 | |
| 167 | if (pContext == nullptr) { |
| 168 | per_thread_api_log_str = "context ptr (param0) undef (NULL)"; |
| 169 | } else if ( |
| 170 | false == (source == McDebugSource::MC_DEBUG_SOURCE_ALL || // |
| 171 | source == McDebugSource::MC_DEBUG_SOURCE_KERNEL || // |
| 172 | source == McDebugSource::MC_DEBUG_SOURCE_ALL)) { |
| 173 | per_thread_api_log_str = "debug source val (param1) invalid"; |
| 174 | } else if ( |
| 175 | false == (type == McDebugType::MC_DEBUG_TYPE_ALL || // |
| 176 | type == McDebugType::MC_DEBUG_TYPE_DEPRECATED_BEHAVIOR || // |
| 177 | type == McDebugType::MC_DEBUG_TYPE_ERROR || // |
| 178 | type == McDebugType::MC_DEBUG_TYPE_OTHER)) { |
| 179 | per_thread_api_log_str = "debug type val (param2) invalid"; |
| 180 | } else if ( |
| 181 | false == (severity == McDebugSeverity::MC_DEBUG_SEVERITY_HIGH || // |
| 182 | severity == McDebugSeverity::MC_DEBUG_SEVERITY_MEDIUM || // |
| 183 | severity == McDebugSeverity::MC_DEBUG_SEVERITY_LOW || // |
| 184 | severity == McDebugSeverity::MC_DEBUG_SEVERITY_NOTIFICATION || // |
| 185 | severity == McDebugSeverity::MC_DEBUG_SEVERITY_ALL)) { |
| 186 | per_thread_api_log_str = "debug severity val (param3) invalid"; |
| 187 | } else { |
| 188 | try { |
| 189 | debug_message_control_impl(pContext, source, type, severity, enabled); |
| 190 | } |
| 191 | CATCH_POSSIBLE_EXCEPTIONS(per_thread_api_log_str); |
| 192 | } |
| 193 | |
| 194 | if (!per_thread_api_log_str.empty()) { |
| 195 | std::fprintf(stderr, "%s(...) -> %s\n", __FUNCTION__, per_thread_api_log_str.c_str()); |
| 196 | if (return_value == McResult::MC_NO_ERROR) // i.e. problem with basic local parameter checks |
| 197 | { |
| 198 | return_value = McResult::MC_INVALID_VALUE; |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | return return_value; |
| 203 | } |
| 204 | |
| 205 | MCAPI_ATTR McResult MCAPI_CALL mcGetInfo(const McContext context, McFlags info, McSize bytes, McVoid* pMem, McSize* pNumBytes) |
| 206 | { |