title: Is there a standard protocol for modifying DLL call functionality in AutoHotkey_L?
body: <p>I have been looking at the AutoHotkey_L source code (which is C++) with the intention of modifying it to control what DLL calls can be made for security purposes of an application we're developing.  There is a preprocessor directive in the source code that makes eliminating DLL functionality very straightforward, but we still need to make some DLL calls for the purpose of the application, we just want those to be tightly controlled rather than allowing DLL calls to the entire WinAPI.</p>
  
  <p>I'm assuming that preprocessor directive for eliminating DLL call functionality is there because other developers have had similar desires to limit the ability to make DLL calls from AutoHotkey. My question is whether there is a similar method in place for controlling DLL functionality without completely eliminating it. Or is my best bet to dig into the source code methods responsible for making DLL calls and figure out where I can control the parameters coming in to allow only certain calls? I looked on the AutoHotkey forums and didn't find anything helpful.</p>
  
  <p>If it helps, here's a quick snippet how the directive controls DLL calls:</p>
  
  <p>Here's the preprocessor definition from the configuration header file (config.h lines 9-14):  </p>
  
  <pre><code>#ifdef _MSC_VER
      #if defined(WIN32_PLATFORM) || defined(_WIN64)
      #define ENABLE_DLLCALL
      #define ENABLE_REGISTERCALLBACK
      #endif
  #endif
  </code></pre>
  
  <p>And here's an example of an entry point where the ENABLE_DLLCALL directive controls whether the DLL functionality can be accessed at all (script.cpp lines 7910-7916).  For reference, the bif variable here is a BuiltInFunctionType that gets assigned the built in function being called and is then added to a Func object that gets returned:</p>
  
  <pre><code>#ifdef ENABLE_DLLCALL
  else if (!_tcsicmp(func_name, _T("DllCall")))
  {
      bif = BIF_DllCall;
      max_params = 10000; // An arbitrarily high limit that will never realistically be reached.
  }
  #endif
  </code></pre>