Author: hbelusca Date: Sat Jul 9 22:23:23 2016 New Revision: 71879
URL: http://svn.reactos.org/svn/reactos?rev=71879&view=rev Log: [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.
Modified: trunk/reactos/dll/win32/kernel32/client/file/create.c trunk/reactos/dll/win32/kernel32/client/proc.c
Modified: trunk/reactos/dll/win32/kernel32/client/file/create.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/f... ============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/create.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/create.c [iso-8859-1] Sat Jul 9 22:23:23 2016 @@ -435,7 +435,7 @@
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;
Modified: trunk/reactos/dll/win32/kernel32/client/proc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/p... ============================================================================== --- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Sat Jul 9 22:23:23 2016 @@ -2329,7 +2329,7 @@ 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 @@ 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 @@ }
/* 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");