<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">I agree - that would match what Windows
      currently does.<br>
      <br>
      But at the moment wine creates two reg entries:<br>
      <tt>[Software\\Microsoft\\Cryptography] 1539591005<br>
        "MachineGuid"="136a597b-d2a8-4b79-8d9c-d8d99a496a0e"<br>
        <br>
        [Software\\<b>Wow6432Node</b>\\Microsoft\\Cryptography]
        1539591011<br>
        "MachineGuid"="ace73aff-5746-4a53-8358-795778289ed0"<br>
      </tt><br>
      And when running 'wine' (as opposed to 'wine64') wine
      automatically uses KEY_WOW64_32KEY when accessing registry keys;
      thus:<br>
      <tt>$ wine reg query 'HKLM\Software\Microsoft\Cryptography' /v
        MachineGuid </tt><tt><br>
      </tt><tt>HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography</tt><tt><br>
      </tt><tt>    MachineGuid    REG_SZ   
        ace73aff-5746-4a53-8358-795778289ed0</tt><tt><br>
      </tt><br>
      returns the value from the 32bit branch (i.e. under
      'Wow6432Node').<br>
      <br>
      and when running:<br>
      <tt>$ wine64 reg query 'HKLM\Software\Microsoft\Cryptography' /v
        MachineGuid </tt><tt><br>
      </tt><tt>HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography</tt><tt><br>
      </tt><tt>    MachineGuid    REG_SZ   
        136a597b-d2a8-4b79-8d9c-d8d99a496a0e</tt><tt><br>
      </tt><br>
      we get the correct value from the 64bit branch.<br>
      <br>
      But this is two different values based on whether you use 'wine'
      or 'wine64' - which is definitely not right (and results in
      <a class="moz-txt-link-freetext" href="https://bugs.winehq.org/show_bug.cgi?id=43464">https://bugs.winehq.org/show_bug.cgi?id=43464</a>).<br>
      <br>
      This patch doesn't remove the 'MachineGuid' value from the 32bit
      branch - but it does at least fix the aforementioned bug.<br>
      <br>
      Finding a solution to remove the 'MachineGuid' value from the
      32bit branch was something I considered - but I couldn't find a
      precedent.<br>
      <br>
      Please let me know if there is a precedent - but if not I think
      our only option would be to intercept a get/set value request to
      "Software\\Wow6432Node\\Microsoft\\Cryptography\\MachineGuid" and
      remove the "Wow6432Node" part.<br>
      <br>
      Other alternatives that would still result in a 32bit branch value
      (but keep it in sync with the 64bit branch value) would be:<br>
      a) some kind of symlink equivalent for individual values; or<br>
      b) registry reflection<br>
      <br>
      <br>
      On 16/10/18 19:54, Nikolay Sivov wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:2e7beddc-95cc-6fb6-81e1-41d52a11d372@codeweavers.com">
      <br>
      <br>
      On 10/16/2018 11:06 AM, Brendan McGrath wrote:
      <br>
      <blockquote type="cite">Currently, when running the following two
        commands in a new prefix:
        <br>
        wine reg query 'HKLM\Software\Microsoft\Cryptography' /v
        MachineGuid
        <br>
        wine64 reg query 'HKLM\Software\Microsoft\Cryptography' /v
        MachineGuid
        <br>
        <br>
        Two different values are returned. This can cause an issue when,
        for
        <br>
        example, a 32-bit Launcher and 64-bit application expect the
        same value.
        <br>
        <br>
        This patch ensures that when the 64-bit GUID is created, the
        32-bit
        <br>
        GUID is created as well (with the same value).
        <br>
        <br>
        Signed-off-by: Brendan McGrath <a class="moz-txt-link-rfc2396E" href="mailto:brendan@redmandi.com"><brendan@redmandi.com></a>
        <br>
        ---
        <br>
        <br>
        I considered a few options on how to achieve this; but ended up
        with
        <br>
        this option as it seemed the simplest. However, it does leave
        the
        <br>
        possiblity for an application or user to change one and leave
        the other.
        <br>
        <br>
        I did note that Windows doesn't appear to have a MachineGuid
        entry for
        <br>
        WoW, so it looks like Windows just uses the one entry. But I
        wasn't
        <br>
        sure of the best way to achieve that in Wine (and couldn't find
        a
        <br>
        precedent).
        <br>
      </blockquote>
      <br>
      Hi, Brendan.
      <br>
      <br>
      Thanks for the patch. Since this value should only be present in
      64bit branch, key should be opened with KEY_WOW64_64KEY when
      setting it. You can't access it on Windows either, with /reg:32
      mode, which is default for 32-bit reg.exe.
      <br>
      <br>
      <blockquote type="cite">
        <br>
          dlls/advapi32/crypt.c | 8 ++++++++
        <br>
          1 file changed, 8 insertions(+)
        <br>
        <br>
        diff --git a/dlls/advapi32/crypt.c b/dlls/advapi32/crypt.c
        <br>
        index 01d58804235..0ea64b52226 100644
        <br>
        --- a/dlls/advapi32/crypt.c
        <br>
        +++ b/dlls/advapi32/crypt.c
        <br>
        @@ -313,6 +313,14 @@ static void CRYPT_CreateMachineGuid(void)
        <br>
                                  RegSetValueExW(key, machineGuidW, 0,
        REG_SZ,
        <br>
                                                 (const BYTE *)buf,
        <br>
                                                
        (lstrlenW(buf)+1)*sizeof(WCHAR));
        <br>
        +                        r = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
        cryptographyW, 0,
        <br>
        +                                           KEY_ALL_ACCESS |
        KEY_WOW64_32KEY, &key);
        <br>
        +                        if (!r)
        <br>
        +                        {
        <br>
        +                            RegSetValueExW(key, machineGuidW,
        0, REG_SZ,
        <br>
        +                                           (const BYTE *)buf,
        <br>
        +                                          
        (lstrlenW(buf)+1)*sizeof(WCHAR));
        <br>
        +                        }
        <br>
                              }
        <br>
                  }
        <br>
                  RegCloseKey(key);
        <br>
      </blockquote>
      <br>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>