From 1c863eef7a06018411f313ef893b82202c80db0e Mon Sep 17 00:00:00 2001 From: Gunnar Dalsnes Date: Sun, 30 Nov 2003 20:48:07 +0000 Subject: [PATCH] -temporary and ugly fix/work-around for a bug that made CreateFileW crash when calling it directly (meaning not indirectly thru CreateFileA) svn path=/trunk/; revision=6836 --- reactos/lib/ntdll/rtl/path.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/reactos/lib/ntdll/rtl/path.c b/reactos/lib/ntdll/rtl/path.c index 3fd39222445..1f865cc93f6 100644 --- a/reactos/lib/ntdll/rtl/path.c +++ b/reactos/lib/ntdll/rtl/path.c @@ -1,4 +1,4 @@ -/* $Id: path.c,v 1.25 2003/11/17 20:35:46 sedwards Exp $ +/* $Id: path.c,v 1.26 2003/11/30 20:48:07 gdalsnes Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -555,6 +555,9 @@ RtlGetFullPathName_U(PWSTR DosName, DPRINT("RtlGetFullPathName_U %S %ld %p %p\n", DosName, size, buf, FilePart); + /* FIXME: this code is a mess! We should use Wine's implementation + of this function, since it's cleaner and IMO better. -Gunnar */ + if (!DosName || !*DosName) return 0; @@ -601,9 +604,15 @@ DPRINT("type %ld\n", type); case 6: /* \\.\xxx */ break; - case 2: /* x:\xxx */ - *DosName = RtlUpcaseUnicodeChar (*DosName); - break; + case 2: + break; +#if 0 + /* this makes a direct CreateFileW call crash! */ + + case 2: /* x:\xxx */ + *DosName = RtlUpcaseUnicodeChar (*DosName); + break; +#endif case 3: /* x:xxx */ drive = RtlUpcaseUnicodeChar (*DosName); @@ -674,11 +683,17 @@ CHECKPOINT; return 0; } + RtlReleasePebLock(); DPRINT("TempFullPathName \'%S\' DosName \'%S\' len %ld\n", TempFullPathName, DosName, len); /* add dosname to prefix */ memcpy (TempFullPathName + templen, DosName, len * sizeof(WCHAR)); + + /* dirty/temporary fix for the CreateFileW problem */ + if (type == 2){ + TempFullPathName[0] = RtlUpcaseUnicodeChar(TempFullPathName[0]); + } len += templen; TempFullPathName[len] = 0; @@ -754,6 +769,7 @@ RtlDosPathNameToNtPathName_U(PWSTR dosname, WCHAR fullname[MAX_PATH + 1]; PWSTR Buffer = NULL; + RtlAcquirePebLock (); RtlInitUnicodeString (&us, dosname); @@ -848,7 +864,6 @@ RtlDosPathNameToNtPathName_U(PWSTR dosname, } RtlReleasePebLock(); - return TRUE; }