Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-14397

[shell32] Implement RegenerateUserEnvironment

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Fixed
    • Minor
    • 0.4.10
    • Shell
    • None

    Description

      We have to implement shell32!RegenerateUserEnvironment function to improve compatibility.

      Every process has an environment block that contains a set of environment variables and their values. There are two types of environment variables: user environment variables (set for each user) and system environment variables (set for everyone).

      Each environment block contains the environment variables in the following format:

      Var1=Value1\0
      Var2=Value2\0
      Var3=Value3\0
      ...
      VarN=ValueN\0\0

      If the system environment variables were changed, then WM_SETTINGCHANGE message will be notified to each windows. When Explorer receives WM_SETTINGCHANGE, Explorer calls shell32!RegenerateUserEnvironment to reload its environment variables.

      BOOL WINAPI RegenerateUserEnvironment(LPVOID *lpEnvironment, BOOL bUpdateSelf);

      The 1st argument of RegenerateUserEnvironment function is a pointer to a Unicode environment block. If the 2nd argument bUpdateSelf was TRUE, then the environment of the current process will be also reloaded.

      RegenerateUserEnvironment updates the return value of GetEnvironmentStrings function. The return value of GetEnvironmentStrings is an ANSI environment block.

      I created a test program: EnvTest.zip

      Attachments

        Issue Links

          Activity

            People

              hbelusca hbelusca
              katayama_hirofumi_mz Katayama Hirofumi MZ
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: