[KERNEL32]

- Do not use a "magic number" for the return value 0xFFFFFFFF from GetFileAttributes.
- Use a meaningful variable name for retrieving the result of GetFileAttributes.

svn path=/trunk/; revision=71879
This commit is contained in:
Hermès Bélusca-Maïto 2016-07-09 22:23:23 +00:00
parent 121e0791d7
commit 7795699eaa
2 changed files with 8 additions and 8 deletions

View file

@ -435,7 +435,7 @@ OpenFile(LPCSTR lpFileName,
switch (dwAttributes)
{
case 0xFFFFFFFF: /* File does not exist */
case INVALID_FILE_ATTRIBUTES: /* File does not exist */
SetLastError(ERROR_FILE_NOT_FOUND);
lpReOpenBuff->nErrCode = (WORD) ERROR_FILE_NOT_FOUND;
return -1;

View file

@ -2329,7 +2329,7 @@ CreateProcessInternalW(IN HANDLE hUserToken,
PCHAR pcScan;
SIZE_T n;
WCHAR SaveChar;
ULONG Length, CurdirLength, CmdQuoteLength;
ULONG Length, FileAttribs, CmdQuoteLength;
ULONG CmdLineLength, ResultSize;
PWCHAR QuotedCmdLine, AnsiCmdCommand, ExtBuffer, CurrentDirectory;
PWCHAR NullBuffer, ScanString, NameBuffer, SearchPath, DebuggerCmdLine;
@ -2734,9 +2734,9 @@ StartScan:
if ((Length) && (Length < MAX_PATH))
{
/* Get file attributes */
CurdirLength = GetFileAttributesW(NameBuffer);
if ((CurdirLength != 0xFFFFFFFF) &&
(CurdirLength & FILE_ATTRIBUTE_DIRECTORY))
FileAttribs = GetFileAttributesW(NameBuffer);
if ((FileAttribs != INVALID_FILE_ATTRIBUTES) &&
(FileAttribs & FILE_ATTRIBUTE_DIRECTORY))
{
/* This was a directory, fail later on */
Length = 0;
@ -4066,9 +4066,9 @@ StartScan:
}
/* Make sure the directory is actually valid */
CurdirLength = GetFileAttributesW(CurrentDirectory);
if ((CurdirLength == 0xffffffff) ||
!(CurdirLength & FILE_ATTRIBUTE_DIRECTORY))
FileAttribs = GetFileAttributesW(CurrentDirectory);
if ((FileAttribs == INVALID_FILE_ATTRIBUTES) ||
!(FileAttribs & FILE_ATTRIBUTE_DIRECTORY))
{
/* It isn't, so bail out */
DPRINT1("Current directory is invalid\n");