mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
make GetRootPath bit faster if it does not get a drive name with :
svn path=/trunk/; revision=16637
This commit is contained in:
parent
07a3a7ec8e
commit
758d835b13
1 changed files with 20 additions and 14 deletions
|
@ -148,10 +148,10 @@ VOID FreeLastPath (VOID)
|
||||||
free (lpLastPath);
|
free (lpLastPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* help functions for getting current path from driver
|
/* help functions for getting current path from drive
|
||||||
without changing driver. Return code 0 = ok, 1 = fail.
|
without changing drive. Return code 0 = ok, 1 = fail.
|
||||||
INT GetRootPath("C:",outbuffer,chater size of outbuffer);
|
INT GetRootPath("C:",outbuffer,chater size of outbuffer);
|
||||||
the frist param can have any size, if the the two frist
|
the first param can have any size, if the the two frist
|
||||||
letter are not a drive with : it will get Currentpath on
|
letter are not a drive with : it will get Currentpath on
|
||||||
current drive exacly as GetCurrentDirectory does.
|
current drive exacly as GetCurrentDirectory does.
|
||||||
*/
|
*/
|
||||||
|
@ -161,17 +161,23 @@ INT GetRootPath(TCHAR *InPath,TCHAR *OutPath,INT size)
|
||||||
INT retcode = 1;
|
INT retcode = 1;
|
||||||
INT t;
|
INT t;
|
||||||
|
|
||||||
for (t=0;t<32;t++)
|
if (_tcslen(InPath)>1)
|
||||||
{
|
{
|
||||||
if (_tgetdcwd(t,OutPath,size) != NULL)
|
if (InPath[1]==_T(':'))
|
||||||
{
|
{
|
||||||
if (_tcsncicmp(InPath,OutPath,2))
|
for (t=0;t<32;t++)
|
||||||
{
|
{
|
||||||
retcode = 0;
|
if (_tgetdcwd(t,OutPath,size) != NULL)
|
||||||
return retcode;
|
{
|
||||||
}
|
if (_tcsncicmp(InPath,OutPath,2))
|
||||||
}
|
{
|
||||||
}
|
retcode = 0;
|
||||||
|
return retcode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* fail to getting path devic did not exists */
|
/* fail to getting path devic did not exists */
|
||||||
if (_tcslen(InPath)>1)
|
if (_tcslen(InPath)>1)
|
||||||
|
|
Loading…
Reference in a new issue