[Wine-patches] [eterhack] kernel32: Replace command.com with cmd.exe (eterbug #7103).

Alexander Morozov amorozov на etersoft.ru
Вт Апр 12 16:57:39 MSD 2011


----------- следующая часть -----------
From 5c8832af6d70ed3add82ace63ee885cf6a8543e6 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Tue, 12 Apr 2011 16:42:16 +0400
Subject: [eterhack] kernel32: Replace command.com with cmd.exe (eterbug
 #7103).

---
 dlls/kernel32/process.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 05f39e5..2657146 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -159,6 +159,9 @@ static inline unsigned int is_path_prefix( const WCHAR *prefix, const WCHAR *fil
 static BOOL get_builtin_path( const WCHAR *libname, const WCHAR *ext, WCHAR *filename,
                               UINT size, struct binary_info *binary_info )
 {
+    static const WCHAR commandW[] = {'c','o','m','m','a','n','d',0};
+    static const WCHAR command_comW[] = {'c','o','m','m','a','n','d','.','c','o','m',0};
+    static const WCHAR cmdW[] = {'c','m','d','.','e','x','e',0};
     WCHAR *file_part;
     UINT len;
     void *redir_disabled = 0;
@@ -198,6 +201,10 @@ static BOOL get_builtin_path( const WCHAR *libname, const WCHAR *ext, WCHAR *fil
         strcpyW( file_part, libname );
         if (is_wow64 && redir_disabled) flags = BINARY_FLAG_64BIT;
     }
+    /* replace command[.com] with cmd.exe (HACK for eterbug #7103) */
+    if (!strcmpiW( file_part, commandW ) || !strcmpiW( file_part, command_comW ))
+        /* cmdW is not longer than commandW and command_comW */
+        strcpyW( file_part, cmdW );
     if (ext && !strchrW( file_part, '.' ))
     {
         if (file_part + strlenW(file_part) + strlenW(ext) + 1 > filename + size)
-- 
1.7.4.4



Подробная информация о списке рассылки Wine-patches