1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Documentation environment variables

Discussion in 'Support' started by fpefpe, Oct 8, 2012.

  1. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    238
    Likes Received:
    1
    Hello – I am not sure if this “how it works”

    I been using tcc plugings for a since Version 10 – An I think this is the first time this happened. In the simplest form, it seemed that fetching environment variables seem not to have the most recent value.

    Here is the case. I have a plugin that runs a scripting language ... When processing one of the scripts ( NOTE: that the plugin is running in the same process as TCC) the script loads a dll.
    Code in that dll then tries to read a environment variable (say the name is FOO) that was set in the script. I checked the scripting language code and it calls the windows API to set the
    variable.

    Now in the loaded DLL, it tried to read the just set variable and its value is empty. I could not figure this out at all. I then tried the variable PATH. By the time this script runs, PATH has been modified by TCSTART.

    Now I was tracking the loaded dll when it now acceded PATH and the value reported was not the value of path when the script started but I think the value when TCSTART started at start up – Did I miss something on how environment variables are save and processed? Thanks
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,806
    Likes Received:
    82
    The simple answer is that there's no way for that to happen -- TCC and plugins share the same environment.

    If it *is* happening, then either the environment has been modified by the plugin or some other source (and the variable removed), or the plugin is deliberately choosing to use a different environment.

    I need more information (and preferably a complete description of a reproducible failcase) to debug it any further.
     
  3. fpefpe

    Joined:
    Oct 18, 2008
    Messages:
    238
    Likes Received:
    1

    I worked around the issue for now -- I will see what I can come up with .... so the api var calls in the plugin sdk for the most part "front-end" the win32 API calls?
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,806
    Likes Received:
    82
    Depends on the APIs in question. For the environment handling, yes.
     

Share This Page