Esme Povirk : localspl: Choose print environment based on architecture.

Alexandre Julliard julliard at winehq.org
Tue Oct 19 16:07:46 CDT 2021


Module: wine
Branch: master
Commit: 6e14766ad517cd8387c649d9958f376fbcdc808c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6e14766ad517cd8387c649d9958f376fbcdc808c

Author: Esme Povirk <esme at codeweavers.com>
Date:   Mon Oct 18 11:31:13 2021 -0500

localspl: Choose print environment based on architecture.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51815
Signed-off-by: Esme Povirk <esme at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/localspl/provider.c | 14 +++++++++++++-
 dlls/winspool.drv/info.c | 14 +++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c
index d7c1464ef2c..aded4ed44c4 100644
--- a/dlls/localspl/provider.c
+++ b/dlls/localspl/provider.c
@@ -256,6 +256,18 @@ static const printenv_t env_win40 = {L"Windows 4.0", L"win40", 0,
 
 static const printenv_t * const all_printenv[] = {&env_x86, &env_x64, &env_ia64, &env_arm, &env_arm64, &env_win40};
 
+#ifdef __i386__
+#define env_arch env_x86
+#elif defined __x86_64__
+#define env_arch env_x64
+#elif defined __arm__
+#define env_arch env_arm
+#elif defined __aarch64__
+#define env_arch env_arm64
+#else
+#error not defined for this cpu
+#endif
+
 
 static const DWORD di_sizeof[] = {0, sizeof(DRIVER_INFO_1W), sizeof(DRIVER_INFO_2W),
                                      sizeof(DRIVER_INFO_3W), sizeof(DRIVER_INFO_4W),
@@ -922,7 +934,7 @@ static const  printenv_t * validate_envW(LPCWSTR env)
     }
     else
     {
-        result = (GetVersion() & 0x80000000) ? &env_win40 : &env_x86;
+        result = (GetVersion() & 0x80000000) ? &env_win40 : &env_arch;
     }
 
     TRACE("=> using %p: %s\n", result, debugstr_w(result ? result->envname : NULL));
diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index 74617537a6b..660a5afe74d 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -320,6 +320,18 @@ static const printenv_t env_win40 = {envname_win40W, subdir_win40W, 0, Version0_
 
 static const printenv_t * const all_printenv[] = {&env_x86, &env_x64, &env_arm, &env_arm64, &env_win40};
 
+#ifdef __i386__
+#define env_arch env_x86
+#elif defined __x86_64__
+#define env_arch env_x64
+#elif defined __arm__
+#define env_arch env_arm
+#elif defined __aarch64__
+#define env_arch env_arm64
+#else
+#error not defined for this cpu
+#endif
+
 /******************************************************************
  *  validate the user-supplied printing-environment [internal]
  *
@@ -361,7 +373,7 @@ static const  printenv_t * validate_envW(LPCWSTR env)
     }
     else
     {
-        result = (GetVersion() & 0x80000000) ? &env_win40 : &env_x86;
+        result = (GetVersion() & 0x80000000) ? &env_win40 : &env_arch;
     }
     TRACE("using %p: %s\n", result, debugstr_w(result ? result->envname : NULL));
 




More information about the wine-cvs mailing list