3ds Max C++ API Reference
Loading...
Searching...
No Matches
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 ()
 
virtual void sprin1 (CharStream *s) const
 
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)
 These methods centralize the handling of maxscript exceptions in c++ code.
 

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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 
- 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

These methods centralize the handling of maxscript exceptions in c++ code.

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 (...) { ProcessUnknownMAXScriptException(_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 Scripting 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.