mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 13:13:00 +00:00
Reverted broken code
svn path=/trunk/; revision=1677
This commit is contained in:
parent
6e89a9d21c
commit
6e9d388644
1 changed files with 11 additions and 37 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: path.c,v 1.7 2001/03/07 22:29:09 cnettel Exp $
|
/* $Id: path.c,v 1.8 2001/03/08 22:48:42 dwelch Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
|
||||||
static ULONG RtlpGetDotSequence (PWSTR p)
|
static ULONG RtlpGetDotSequence (PWSTR p)
|
||||||
{
|
{
|
||||||
ULONG Count = 0;
|
ULONG Count = 0;
|
||||||
|
@ -119,7 +118,7 @@ RtlDetermineDosPathNameType_U (
|
||||||
PWSTR Path
|
PWSTR Path
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// DPRINT ("RtlDetermineDosPathNameType_U %S\n", Path);
|
DPRINT ("RtlDetermineDosPathNameType_U %S\n", Path);
|
||||||
|
|
||||||
if (Path == NULL)
|
if (Path == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -240,7 +239,7 @@ RtlGetCurrentDirectory_U (
|
||||||
ULONG Length;
|
ULONG Length;
|
||||||
PCURDIR cd;
|
PCURDIR cd;
|
||||||
|
|
||||||
// DPRINT ("RtlGetCurrentDirectory %lu %p\n", MaximumLength, Buffer);
|
DPRINT ("RtlGetCurrentDirectory %lu %p\n", MaximumLength, Buffer);
|
||||||
|
|
||||||
cd = &(NtCurrentPeb ()->ProcessParameters->CurrentDirectory);
|
cd = &(NtCurrentPeb ()->ProcessParameters->CurrentDirectory);
|
||||||
|
|
||||||
|
@ -250,8 +249,8 @@ RtlGetCurrentDirectory_U (
|
||||||
cd->DosPath.Buffer[Length - 2] != L':')
|
cd->DosPath.Buffer[Length - 2] != L':')
|
||||||
Length--;
|
Length--;
|
||||||
|
|
||||||
// DPRINT ("cd->DosPath.Buffer %S Length %d\n",
|
DPRINT ("cd->DosPath.Buffer %S Length %d\n",
|
||||||
// cd->DosPath.Buffer, Length);
|
cd->DosPath.Buffer, Length);
|
||||||
|
|
||||||
if (MaximumLength / sizeof(WCHAR) > Length)
|
if (MaximumLength / sizeof(WCHAR) > Length)
|
||||||
{
|
{
|
||||||
|
@ -283,10 +282,7 @@ NTSTATUS STDCALL RtlSetCurrentDirectory_U (PUNICODE_STRING name)
|
||||||
ULONG size;
|
ULONG size;
|
||||||
HANDLE handle = NULL;
|
HANDLE handle = NULL;
|
||||||
PWSTR wcs;
|
PWSTR wcs;
|
||||||
PWSTR devpathstart, loopvar;
|
|
||||||
PWSTR buf = 0;
|
PWSTR buf = 0;
|
||||||
PFILE_NAME_INFORMATION objnameinfo;
|
|
||||||
ULONG reslength;
|
|
||||||
|
|
||||||
DPRINT ("RtlSetCurrentDirectory %wZ\n", name);
|
DPRINT ("RtlSetCurrentDirectory %wZ\n", name);
|
||||||
|
|
||||||
|
@ -337,28 +333,6 @@ NTSTATUS STDCALL RtlSetCurrentDirectory_U (PUNICODE_STRING name)
|
||||||
&iosb,
|
&iosb,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT);
|
FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT);
|
||||||
|
|
||||||
objnameinfo = RtlAllocateHeap (RtlGetProcessHeap(),
|
|
||||||
0,
|
|
||||||
cd->DosPath.MaximumLength*sizeof(WCHAR)+4); // A little margin, for Length pre-fix
|
|
||||||
|
|
||||||
NtQueryInformationFile(handle,NULL,objnameinfo,sizeof(OBJECT_NAME_INFORMATION),FileNameInformation);
|
|
||||||
|
|
||||||
devpathstart=buf+wcslen(buf);
|
|
||||||
|
|
||||||
for (loopvar=objnameinfo->FileName;(*loopvar);loopvar++)
|
|
||||||
if ((*loopvar)=='\\')
|
|
||||||
{
|
|
||||||
devpathstart--;
|
|
||||||
for (;devpathstart>buf && (*devpathstart)!='\\';devpathstart--) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
wcscpy(devpathstart, objnameinfo->FileName);
|
|
||||||
|
|
||||||
|
|
||||||
RtlFreeHeap (RtlGetProcessHeap (),
|
|
||||||
0,
|
|
||||||
objnameinfo);
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
RtlFreeHeap (RtlGetProcessHeap (),
|
RtlFreeHeap (RtlGetProcessHeap (),
|
||||||
|
@ -419,8 +393,8 @@ RtlGetFullPathName_U (
|
||||||
PCURDIR cd;
|
PCURDIR cd;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
// DPRINT("RtlGetFullPathName_U %S %ld %p %p\n",
|
DPRINT("RtlGetFullPathName_U %S %ld %p %p\n",
|
||||||
// DosName, size, buf, FilePart);
|
DosName, size, buf, FilePart);
|
||||||
|
|
||||||
if (!DosName || !*DosName)
|
if (!DosName || !*DosName)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -461,7 +435,7 @@ CHECKPOINT;
|
||||||
RtlAcquirePebLock();
|
RtlAcquirePebLock();
|
||||||
|
|
||||||
cd = &(NtCurrentPeb ()->ProcessParameters->CurrentDirectory);
|
cd = &(NtCurrentPeb ()->ProcessParameters->CurrentDirectory);
|
||||||
//DPRINT("type %ld\n", type);
|
DPRINT("type %ld\n", type);
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case 1: /* \\xxx or \\.xxx */
|
case 1: /* \\xxx or \\.xxx */
|
||||||
|
@ -532,7 +506,7 @@ CHECKPOINT;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// DPRINT("buf \'%S\' DosName \'%S\' len %ld\n", buf, DosName, len);
|
DPRINT("buf \'%S\' DosName \'%S\' len %ld\n", buf, DosName, len);
|
||||||
/* add dosname to prefix */
|
/* add dosname to prefix */
|
||||||
wcsncat (buf, DosName, len);
|
wcsncat (buf, DosName, len);
|
||||||
|
|
||||||
|
@ -546,9 +520,9 @@ CHECKPOINT;
|
||||||
if (len < 3 && buf[len-1] == L':')
|
if (len < 3 && buf[len-1] == L':')
|
||||||
wcscat (buf, L"\\");
|
wcscat (buf, L"\\");
|
||||||
|
|
||||||
// DPRINT("buf \'%S\'\n", buf);
|
DPRINT("buf \'%S\'\n", buf);
|
||||||
RtlpEatPath (buf);
|
RtlpEatPath (buf);
|
||||||
// DPRINT("buf \'%S\'\n", buf);
|
DPRINT("buf \'%S\'\n", buf);
|
||||||
|
|
||||||
len = wcslen (buf);
|
len = wcslen (buf);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue