<div dir="ltr">Hello Pierre!<br><div class="gmail_extra"><br><div class="gmail_quote">2016-09-10 14:00 GMT+04:00 Pierre Delaage <span dir="ltr"><<a href="mailto:delaage.pierre@free.fr" target="_blank">delaage.pierre@free.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    Hi Dmitry,<br>
    I reviewed our previous discussion on setting up stunnel by
    envvars...<br>
    <br>
    On WCE, if you really want to have a unic code to manage envvars...<br>
    well ok, you have to write a stub for ExpandEnvironmentStrings,<br>
    that either performs %XX% replacement from predefined values OR
    reads those values from a wce-specific "pseudo-env-txtfile".<br></div></blockquote><div><br></div><div><br></div><div>1. <a href="https://msdn.microsoft.com/en-us/library/ee490554(v=winembedded.60).aspx">https://msdn.microsoft.com/en-us/library/ee490554(v=winembedded.60).aspx</a><br></div><div>registry values under:<br></div><div>[HKEY_LOCAL_MACHINE\init\BootVars]<br></div><div>"name" = "value"</div><div>it's like "global","system","shared".<br></div><div><br></div><div><div>2. <a href="https://msdn.microsoft.com/en-us/library/aa453706.aspx">https://msdn.microsoft.com/en-us/library/aa453706.aspx</a></div></div><div><a href="https://msdn.microsoft.com/en-us/library/aa516912.aspx">https://msdn.microsoft.com/en-us/library/aa516912.aspx</a><br></div><div>it's way to emulate :</div><div>getenv("APPDATA");</div><div>getenv("USERNAME");<br></div><div>....</div><div>something like (pseudocode):</div><div>if( !strcmp(name, "APPDATA") ){</div><div> SHGetSpecialFolderLocation(NULL, CSIDL_APPDATA, ...);</div><div> ...get "value"...</div><div>} else if(!strcmp(name, "USERNAME")){</div><div> GetUserNameEx(NameWindowsCeLocal ...)</div><div> ...get "value"...</div><div>} else ...</div><div><br></div><div>yes, syntax for "variables" must be %XX% - same as on windows.<br></div><div>I think is not necessary to substitute the contents of the config file ("pseudo-env-txtfile") to another config file (stunnel.conf).<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF">
    <br>
    As there is only ONE user in WCE, it is quite straightforward to
    write such stub, that will be universal for any wce terminal:<br>
     the predefined values can be identical for any wce terminal.<br>
    <br></div></blockquote><div><br></div><div>I am not familiar with WCE developlemt tools. I read about it:<br></div><div><a href="http://stackoverflow.com/questions/3463420/how-to-create-applications-for-windows-ce">http://stackoverflow.com/questions/3463420/how-to-create-applications-for-windows-ce</a><br></div><div><a href="https://en.wikipedia.org/wiki/Windows_CE#Development_tools">https://en.wikipedia.org/wiki/Windows_CE#Development_tools</a><br></div><div><a href="https://www.microsoft.com/en-us/download/details.aspx?id=17284">https://www.microsoft.com/en-us/download/details.aspx?id=17284</a><br></div><div><a href="https://msdn.microsoft.com/en-us/library/ms905342.aspx">https://msdn.microsoft.com/en-us/library/ms905342.aspx</a><br></div><div>INSTALL.WCE</div><div>makew32.bat<br></div><div>and completely puzzled by the number of versions, variants & etc.</div><div>also I do not have the experience, tools and devices for building and testing WCE apps.<br></div><div><br></div><div>currently patch done for win32 (using native ExpandEnvironmentStringsA) and *nix (ExpandEnvironmentStringsA stub),</div><div> it's tested and worked.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF">
    NB : I already mentioned that (re)configuring stunnel through envars
    is not safe, at least on Win32 platforms:<br>
    on those systems, env vars are stored in the registry (and
    synchronised with specific system calls): every malicious sw that
    can hack the registry can change env vars, it is of course very easy
    in we use "user" env vars, not system env vars.<br><br></div></blockquote><div><br></div><div>"user" env vars values has no effect on "system" env vars.</div><div>to change "system"/"other user" env vars admin/owner privileges required.</div></div></div></div>