From ae78c3c62fa687db268532b4a9aedc192e3be75d Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Thu, 2 Oct 2003 04:44:32 +0000
Subject: [PATCH] Hack to update ntdll current directory value in DRIVE_Chdir.

---
 files/drive.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/files/drive.c b/files/drive.c
index 6fb0e5c96e0..b34b15b772d 100644
--- a/files/drive.c
+++ b/files/drive.c
@@ -1265,6 +1265,14 @@ int DRIVE_Chdir( int drive, LPCWSTR path )
     strcpyW(DOSDrives[drive].dos_cwd, full_name.short_name + 3);
     DOSDrives[drive].unix_cwd = heap_strdup( unix_cwd );
 
+    if (drive == DRIVE_CurDrive)
+    {
+        UNICODE_STRING dirW;
+
+        RtlInitUnicodeString( &dirW, full_name.short_name );
+        RtlSetCurrentDirectory_U( &dirW );
+    }
+
     if (pTask && (pTask->curdrive & 0x80) &&
         ((pTask->curdrive & ~0x80) == drive))
     {
-- 
GitLab