3ds Max C++ API Reference
SecurityException Class Reference

Exception thrown when attempting to execute MAXScript commands that are disallowed by ISceneScriptSecurityManager. More...

#include <exceptions.h>

+ Inheritance diagram for SecurityException:

Public Member Functions

 SecurityException (const MCHAR *msg, const MCHAR *command=nullptr)
 
 ~SecurityException ()
 
void sprin1 (CharStream *s) const override
 
- Public Member Functions inherited from MAXScriptRuntimeErrorException
 MAXScriptRuntimeErrorException ()
 
 MAXScriptRuntimeErrorException (bool doStackCapture)
 
- Public Member Functions inherited from MAXScriptException
 MAXScriptException ()
 
virtual ~MAXScriptException ()
 
void CaptureMXSCallstack (bool forceCapture=false, bool captureLocals=true)
 
void CaptureCplusplusCallstack (int skipFirstNStackLevels=4, bool forceCapture=false)
 
const MSTRMXSCallstack () const
 
const MSTRCplusplusCallstack () const
 

Friends

ScripterExport void ProcessMAXScriptException (MAXScriptException &e, const MCHAR *caption, bool displayErrorMessageBox, bool showSourcePosition, bool isTerminalHandling, bool quietErrors)
 This method centralizes the handling of maxscript exceptions in c++ code. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MAXScriptException
static void MXSCallstackCaptureEnabled (bool enabled)
 
static bool isMXSCallstackCaptureEnabled ()
 
static void CplusplusCallstackCaptureEnabled (bool enabled)
 
static bool isCplusplusCallstackCaptureEnabled ()
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 
- Protected Attributes inherited from MAXScriptException
MSTR mCapturedMXSCallstack
 
MSTR mCapturedCplusplusCallstack
 
- Static Protected Attributes inherited from MAXScriptException
static bool sMXSCallstackCaptureEnabled
 
static bool sCplusplusCallstackCaptureEnabled
 
static bool sInMXSCallstackCapture
 
static bool sInCplusplusCallstackCapture
 

Detailed Description

Exception thrown when attempting to execute MAXScript commands that are disallowed by ISceneScriptSecurityManager.

Constructor & Destructor Documentation

◆ SecurityException()

SecurityException ( const MCHAR msg,
const MCHAR command = nullptr 
)

◆ ~SecurityException()

Member Function Documentation

◆ sprin1()

void sprin1 ( CharStream s) const
overridevirtual

Reimplemented from MAXScriptException.

Friends And Related Function Documentation

◆ ProcessMAXScriptException

ScripterExport void ProcessMAXScriptException ( MAXScriptException e,
const MCHAR caption,
bool  displayErrorMessageBox,
bool  showSourcePosition,
bool  isTerminalHandling,
bool  quietErrors 
)
friend

This method centralizes the handling of maxscript exceptions in c++ code.

It's typical usage looks like:

ScopedMaxScriptEvaluationContext scopedMaxScriptEvaluationContext; MAXScript_TLS* _tls = scopedMaxScriptEvaluationContext.Get_TLS(); two_value_locals_tls( thingValue, propNameValue ); try { ScopedSaveCurrentFrames scopedSaveCurrentFrames(_tls); vl.thingValue = InterfaceFunction::FPValue_to_val( thing ); vl.propNameValue = Name::intern( propName ); vl.thingValue = vl.thingValue->get_property( &vl.propNameValue, 1 ); vl.thingValue->to_fpvalue( retVal ); } catch (MAXScriptException& e) { ProcessMAXScriptException(e, _T("GetScriptedProperty"), false, false, true); } catch (...) { ProcessMAXScriptException(UnknownSystemException(), _T("GetScriptedProperty"), false, false, true); }

Parameters
eThe maxscript exception to process
captionThe string to be used in the title bar of the error message box, and is used as part of the verbose description of the exception. Can be null.
displayErrorMessageBoxIf true, an error message box is displayed (unless max is in quiet mode).
showSourcePositionIf true, source position of error is shown in maxscript editor.
isTerminalHandlingIf true, terminal handling of the exception is occurring. If false, the catch will be rethrowing the exception.
quietErrorsIf true, error information is not written to Listener, a brief description of the exception and its source location is written to the log file.