Fix64 bit warnings

svn path=/trunk/; revision=55527
This commit is contained in:
Timo Kreuzer 2012-02-10 17:36:11 +00:00
parent af8d992a9e
commit cb1539b7df
7 changed files with 28 additions and 28 deletions

View file

@ -2533,8 +2533,8 @@ RtlDosSearchPath_Ustr(
IN PUNICODE_STRING CallerBuffer, IN PUNICODE_STRING CallerBuffer,
IN OUT PUNICODE_STRING DynamicString OPTIONAL, IN OUT PUNICODE_STRING DynamicString OPTIONAL,
OUT PUNICODE_STRING* FullNameOut OPTIONAL, OUT PUNICODE_STRING* FullNameOut OPTIONAL,
OUT PULONG FilePartSize OPTIONAL, OUT PSIZE_T FilePartSize OPTIONAL,
OUT PULONG LengthNeeded OPTIONAL OUT PSIZE_T LengthNeeded OPTIONAL
); );
NTSYSAPI NTSYSAPI
@ -2608,7 +2608,7 @@ RtlGetFullPathName_UstrEx(
IN PSIZE_T FilePartSize, IN PSIZE_T FilePartSize,
OUT PBOOLEAN NameInvalid, OUT PBOOLEAN NameInvalid,
OUT RTL_PATH_TYPE* PathType, OUT RTL_PATH_TYPE* PathType,
OUT PULONG LengthNeeded OUT PSIZE_T LengthNeeded
); );
NTSYSAPI NTSYSAPI

View file

@ -349,7 +349,7 @@ RtlAddAtomToAtomTable(IN PRTL_ATOM_TABLE AtomTable,
simply add it to the list */ simply add it to the list */
if (HashLink != NULL) if (HashLink != NULL)
{ {
ULONG AtomNameLen = wcslen(AtomName); ULONG AtomNameLen = (ULONG)wcslen(AtomName);
if (AtomNameLen > RTL_MAXIMUM_ATOM_LENGTH) if (AtomNameLen > RTL_MAXIMUM_ATOM_LENGTH)
{ {

View file

@ -138,7 +138,7 @@ RtlIsDosDeviceName_Ustr(IN PCUNICODE_STRING PathString)
((c == 'l') || (c == 'c') || (c == 'p') || (c == 'a') || (c == 'n'))) ((c == 'l') || (c == 'c') || (c == 'p') || (c == 'a') || (c == 'n')))
{ {
/* Calculate the offset */ /* Calculate the offset */
ReturnOffset = (PCHAR)End - (PCHAR)PathCopy.Buffer; ReturnOffset = (USHORT)((PCHAR)End - (PCHAR)PathCopy.Buffer);
/* Build the final string */ /* Build the final string */
PathCopy.Length = OriginalLength - ReturnOffset - (ColonCount * sizeof(WCHAR)); PathCopy.Length = OriginalLength - ReturnOffset - (ColonCount * sizeof(WCHAR));
@ -179,7 +179,7 @@ RtlIsDosDeviceName_Ustr(IN PCUNICODE_STRING PathString)
while ((Start > PathCopy.Buffer) && (Start[-1] == ' ')) --Start; while ((Start > PathCopy.Buffer) && (Start[-1] == ' ')) --Start;
/* Finally see how many characters are left, and that's our size */ /* Finally see how many characters are left, and that's our size */
PathChars = Start - PathCopy.Buffer; PathChars = (USHORT)(Start - PathCopy.Buffer);
PathCopy.Length = PathChars * sizeof(WCHAR); PathCopy.Length = PathChars * sizeof(WCHAR);
/* Check if this is a COM or LPT port, which has a digit after it */ /* Check if this is a COM or LPT port, which has a digit after it */
@ -641,13 +641,13 @@ RtlpDosPathNameToRelativeNtPathName_Ustr(IN BOOLEAN HaveRelative,
RtlReleasePebLock(); RtlReleasePebLock();
return Status; return Status;
} }
/* File is in current directory */ /* File is in current directory */
if (RtlEqualUnicodeString(&FullPath, &CurrentDirectory->DosPath, TRUE)) if (RtlEqualUnicodeString(&FullPath, &CurrentDirectory->DosPath, TRUE))
{ {
/* Make relative name string */ /* Make relative name string */
RelativeName->RelativeName.Buffer = (PWSTR)((ULONG_PTR)NewBuffer + FullPath.Length - PrefixCut); RelativeName->RelativeName.Buffer = (PWSTR)((ULONG_PTR)NewBuffer + FullPath.Length - PrefixCut);
RelativeName->RelativeName.Length = PathLength - FullPath.Length; RelativeName->RelativeName.Length = (USHORT)(PathLength - FullPath.Length);
/* If relative name starts with \, skip it */ /* If relative name starts with \, skip it */
if (RelativeName->RelativeName.Buffer[0] == L'\\') if (RelativeName->RelativeName.Buffer[0] == L'\\')
{ {
@ -1116,7 +1116,7 @@ RtlSetCurrentDirectory_U(IN PUNICODE_STRING Path)
CurDirHandle = (HANDLE)((ULONG_PTR)CurDirHandle | RTL_CURDIR_IS_REMOVABLE); CurDirHandle = (HANDLE)((ULONG_PTR)CurDirHandle | RTL_CURDIR_IS_REMOVABLE);
} }
FullPath.Length = FullPathLength; FullPath.Length = (USHORT)FullPathLength;
/* If full path isn't \ terminated, do it */ /* If full path isn't \ terminated, do it */
if (FullPath.Buffer[CharLength - 1] != L'\\') if (FullPath.Buffer[CharLength - 1] != L'\\')
@ -1784,7 +1784,7 @@ RtlGetFullPathName_UstrEx(IN PUNICODE_STRING FileName,
IN PSIZE_T FilePartSize, IN PSIZE_T FilePartSize,
OUT PBOOLEAN NameInvalid, OUT PBOOLEAN NameInvalid,
OUT RTL_PATH_TYPE* PathType, OUT RTL_PATH_TYPE* PathType,
OUT PULONG LengthNeeded) OUT PSIZE_T LengthNeeded)
{ {
NTSTATUS Status; NTSTATUS Status;
PWCHAR StaticBuffer; PWCHAR StaticBuffer;
@ -1846,7 +1846,7 @@ RtlGetFullPathName_UstrEx(IN PUNICODE_STRING FileName,
if ((StaticString) && (Length < StaticLength)) if ((StaticString) && (Length < StaticLength))
{ {
/* Set the final length */ /* Set the final length */
StaticString->Length = Length; StaticString->Length = (USHORT)Length;
/* Set the file part size */ /* Set the file part size */
if (FilePartSize) *FilePartSize = ShortName ? (ShortName - StaticString->Buffer) : 0; if (FilePartSize) *FilePartSize = ShortName ? (ShortName - StaticString->Buffer) : 0;
@ -1878,7 +1878,7 @@ RtlGetFullPathName_UstrEx(IN PUNICODE_STRING FileName,
/* Set the settings for the dynamic string the caller sent */ /* Set the settings for the dynamic string the caller sent */
DynamicString->MaximumLength = StaticLength; DynamicString->MaximumLength = StaticLength;
DynamicString->Length = Length; DynamicString->Length = (USHORT)Length;
DynamicString->Buffer = StaticBuffer; DynamicString->Buffer = StaticBuffer;
/* Set the part size */ /* Set the part size */
@ -1914,7 +1914,7 @@ RtlGetFullPathName_UstrEx(IN PUNICODE_STRING FileName,
if ((StaticString) && (Length < StaticLength)) if ((StaticString) && (Length < StaticLength))
{ {
/* Set the final length */ /* Set the final length */
StaticString->Length = Length; StaticString->Length = (USHORT)Length;
/* Set the file part size */ /* Set the file part size */
if (FilePartSize) *FilePartSize = ShortName ? (ShortName - StaticString->Buffer) : 0; if (FilePartSize) *FilePartSize = ShortName ? (ShortName - StaticString->Buffer) : 0;
@ -1946,7 +1946,7 @@ RtlGetFullPathName_UstrEx(IN PUNICODE_STRING FileName,
} }
/* Add space for a NULL terminator, and now check the full path */ /* Add space for a NULL terminator, and now check the full path */
TempDynamicString.MaximumLength = Length + sizeof(UNICODE_NULL); TempDynamicString.MaximumLength = (USHORT)Length + sizeof(UNICODE_NULL);
Length = RtlGetFullPathName_Ustr(FileName, Length = RtlGetFullPathName_Ustr(FileName,
Length, Length,
TempDynamicString.Buffer, TempDynamicString.Buffer,
@ -1979,7 +1979,7 @@ RtlGetFullPathName_UstrEx(IN PUNICODE_STRING FileName,
/* Finalize the string and return it to the user */ /* Finalize the string and return it to the user */
DynamicString->Buffer = TempDynamicString.Buffer; DynamicString->Buffer = TempDynamicString.Buffer;
DynamicString->Length = Length; DynamicString->Length = (USHORT)Length;
DynamicString->MaximumLength = TempDynamicString.MaximumLength; DynamicString->MaximumLength = TempDynamicString.MaximumLength;
if (StringUsed) *StringUsed = DynamicString; if (StringUsed) *StringUsed = DynamicString;
@ -2027,16 +2027,16 @@ RtlDosSearchPath_Ustr(IN ULONG Flags,
IN PUNICODE_STRING CallerBuffer, IN PUNICODE_STRING CallerBuffer,
IN OUT PUNICODE_STRING DynamicString OPTIONAL, IN OUT PUNICODE_STRING DynamicString OPTIONAL,
OUT PUNICODE_STRING* FullNameOut OPTIONAL, OUT PUNICODE_STRING* FullNameOut OPTIONAL,
OUT PULONG FilePartSize OPTIONAL, OUT PSIZE_T FilePartSize OPTIONAL,
OUT PULONG LengthNeeded OPTIONAL) OUT PSIZE_T LengthNeeded OPTIONAL)
{ {
WCHAR StaticCandidateBuffer[MAX_PATH]; WCHAR StaticCandidateBuffer[MAX_PATH];
UNICODE_STRING StaticCandidateString; UNICODE_STRING StaticCandidateString;
NTSTATUS Status; NTSTATUS Status;
RTL_PATH_TYPE PathType; RTL_PATH_TYPE PathType;
PWCHAR p, End, CandidateEnd, SegmentEnd; PWCHAR p, End, CandidateEnd, SegmentEnd;
ULONG SegmentSize, NamePlusExtLength, PathSize, MaxPathSize = 0, WorstCaseLength, ByteCount; SIZE_T SegmentSize, ByteCount, PathSize, MaxPathSize = 0;
USHORT ExtensionLength = 0; USHORT NamePlusExtLength, WorstCaseLength, ExtensionLength = 0;
PUNICODE_STRING FullIsolatedPath; PUNICODE_STRING FullIsolatedPath;
DPRINT("DOS Path Search: %lx %wZ %wZ %wZ %wZ %wZ\n", DPRINT("DOS Path Search: %lx %wZ %wZ %wZ %wZ %wZ\n",
Flags, PathString, FileNameString, ExtensionString, CallerBuffer, DynamicString); Flags, PathString, FileNameString, ExtensionString, CallerBuffer, DynamicString);
@ -2177,7 +2177,7 @@ RtlDosSearchPath_Ustr(IN ULONG Flags,
/* Use the extension, the file name, and the largest path as the size */ /* Use the extension, the file name, and the largest path as the size */
WorstCaseLength = ExtensionLength + WorstCaseLength = ExtensionLength +
FileNameString->Length + FileNameString->Length +
MaxPathSize + (USHORT)MaxPathSize +
sizeof(UNICODE_NULL); sizeof(UNICODE_NULL);
if (WorstCaseLength > UNICODE_STRING_MAX_BYTES) if (WorstCaseLength > UNICODE_STRING_MAX_BYTES)
{ {
@ -2292,7 +2292,7 @@ RtlDosSearchPath_Ustr(IN ULONG Flags,
*CandidateEnd = UNICODE_NULL; *CandidateEnd = UNICODE_NULL;
/* Now set the final length of the string so it becomes valid */ /* Now set the final length of the string so it becomes valid */
StaticCandidateString.Length = (CandidateEnd - StaticCandidateString.Length = (USHORT)(CandidateEnd -
StaticCandidateString.Buffer) * StaticCandidateString.Buffer) *
sizeof(WCHAR); sizeof(WCHAR);

View file

@ -133,7 +133,8 @@ IMAGE_RESOURCE_DIRECTORY *find_entry_by_name( IMAGE_RESOURCE_DIRECTORY *dir,
{ {
const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry; const IMAGE_RESOURCE_DIRECTORY_ENTRY *entry;
const IMAGE_RESOURCE_DIR_STRING_U *str; const IMAGE_RESOURCE_DIR_STRING_U *str;
int min, max, res, pos, namelen; int min, max, res, pos;
size_t namelen;
if (!((ULONG_PTR)name & 0xFFFF0000)) return find_entry_by_id( dir, (ULONG_PTR)name & 0xFFFF, root, want_dir ); if (!((ULONG_PTR)name & 0xFFFF0000)) return find_entry_by_id( dir, (ULONG_PTR)name & 0xFFFF, root, want_dir );
entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1); entry = (const IMAGE_RESOURCE_DIRECTORY_ENTRY *)(dir + 1);

View file

@ -58,13 +58,13 @@ RtlFirstEntrySList(IN const SLIST_HEADER *ListHead)
#endif #endif
} }
WORD WORD
NTAPI NTAPI
RtlQueryDepthSList(IN PSLIST_HEADER ListHead) RtlQueryDepthSList(IN PSLIST_HEADER ListHead)
{ {
#ifdef _WIN64 #ifdef _WIN64
return ListHead->Header8.HeaderType ? return ListHead->Header8.HeaderType ?
ListHead->Header16.Sequence : ListHead->Header8.Sequence; (WORD)ListHead->Header16.Sequence : (WORD)ListHead->Header8.Sequence;
#else #else
return ListHead->Depth; return ListHead->Depth;
#endif #endif

View file

@ -37,7 +37,7 @@
#endif #endif
static const int YearLengths[2] = static const unsigned int YearLengths[2] =
{ {
DAYSPERNORMALYEAR, DAYSPERLEAPYEAR DAYSPERNORMALYEAR, DAYSPERLEAPYEAR
}; };

View file

@ -2525,8 +2525,7 @@ RtlFindCharInUnicodeString(
BOOLEAN Found; BOOLEAN Found;
const BOOLEAN WantToFind = (Flags & RTL_FIND_CHAR_IN_UNICODE_STRING_COMPLEMENT_CHAR_SET) == 0; const BOOLEAN WantToFind = (Flags & RTL_FIND_CHAR_IN_UNICODE_STRING_COMPLEMENT_CHAR_SET) == 0;
const BOOLEAN CaseInSensitive = (Flags & RTL_FIND_CHAR_IN_UNICODE_STRING_CASE_INSENSITIVE) != 0; const BOOLEAN CaseInSensitive = (Flags & RTL_FIND_CHAR_IN_UNICODE_STRING_CASE_INSENSITIVE) != 0;
INT Length; USHORT i, Length;
INT i;
DPRINT("RtlFindCharInUnicodeString(%u, '%wZ', '%wZ', %p)\n", DPRINT("RtlFindCharInUnicodeString(%u, '%wZ', '%wZ', %p)\n",
Flags, SearchString, MatchString, Position); Flags, SearchString, MatchString, Position);