Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Documentation environment variables

Oct
356
2
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
 
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.
 
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.


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?
 

Similar threads

Back
Top