This partially reverts commit d4920360bffddaa5923a8da0b15f3ad9a2a97e78.
Windows does support environment blocks of unlimited sizes, which makes the reverted commit a workaround for (at least) one defective application. And it's a very invasive workaround: there are multiple applications that run on Wine, but expect the user to supply environment variables from the Unix side (e.g. DXVK). The change breaks these configurations on users who may not even use the defective application(s).
So, instead of breaking configurations, just warn the user that there may be issues due to the large environment block.
From: Martino Fontana tinozzo123@gmail.com
This partially reverts commit d4920360bffddaa5923a8da0b15f3ad9a2a97e78.
Windows does support environment blocks of unlimited sizes, which makes the reverted commit a workaround for (at least) one defective application. And it's a very invasive workaround: there are multiple applications that run on Wine, but expect the user to supply environment variables from the Unix side (e.g. DXVK). The change breaks these configurations on users who may not even use the defective application(s).
So, instead of breaking configurations, just warn the user that there may be issues due to the large environment block. --- dlls/ntdll/unix/env.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c index 44dce0fd39f..fd93d6b99d4 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -917,12 +917,8 @@ static WCHAR *get_initial_environment( SIZE_T *pos, SIZE_T *size ) *size = 1; for (e = environ; *e; e++) *size += strlen(*e) + 6;
- if (*size > 30000) /* Windows is limited to 32767, and we need some space for the Wine variables */ - { - ERR( "Unix environment too large, not importing it.\n"); - *size = *pos = 0; - return NULL; - } + if (*size > 30000) + WARN("Environment variable block has size %d. A few applications are known to misbehave when it's larger than 32767.\n", size);
env = malloc( *size * sizeof(WCHAR) ); ptr = env;