[REACTOS] Fix SIZE_T related warnings

This commit is contained in:
Timo Kreuzer 2019-05-26 15:00:21 +02:00
parent 826704ba6b
commit 7611cc2b12
21 changed files with 103 additions and 46 deletions

View file

@ -351,7 +351,7 @@ HRESULT inline SHSetStrRet(LPSTRRET pStrRet, LPCSTR pstrValue)
HRESULT inline SHSetStrRet(LPSTRRET pStrRet, LPCWSTR pwstrValue)
{
ULONG cchr = wcslen(pwstrValue);
SIZE_T cchr = wcslen(pwstrValue);
LPWSTR buffer = static_cast<LPWSTR>(CoTaskMemAlloc((cchr + 1) * sizeof(WCHAR)));
if (buffer == NULL)
return E_OUTOFMEMORY;

View file

@ -515,7 +515,7 @@ RtlIpv6AddressToStringA(
ASSERT(Result >= Buffer);
ASSERT(Result < Buffer + RTL_NUMBER_OF(Buffer));
Status = RtlUnicodeToMultiByteN(S, RTLIPV6A2S_MAX_LEN, NULL, Buffer, (wcslen(Buffer) + 1) * sizeof(WCHAR));
Status = RtlUnicodeToMultiByteN(S, RTLIPV6A2S_MAX_LEN, NULL, Buffer, (ULONG)(wcslen(Buffer) + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
return (PSTR)~0;
@ -544,7 +544,7 @@ RtlIpv6AddressToStringExA(
if (!NT_SUCCESS(Status))
return Status;
Status = RtlUnicodeToMultiByteN(AddressString, RTLIPV6A2SEX_MAX_LEN, NULL, Buffer, (wcslen(Buffer) + 1) * sizeof(WCHAR));
Status = RtlUnicodeToMultiByteN(AddressString, RTLIPV6A2SEX_MAX_LEN, NULL, Buffer, (*AddressStringLength + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
return STATUS_INVALID_PARAMETER;

View file

@ -309,7 +309,7 @@ RtlpCollapsePath(PWSTR Path, /* ULONG PathBufferSize, ULONG PathLength, */ ULONG
// FIXME: Do not suppose NULL-terminated strings!!
ULONG PathLength = wcslen(Path);
SIZE_T PathLength = wcslen(Path);
PWSTR EndBuffer = Path + PathLength; // Path + PathBufferSize / sizeof(WCHAR);
PWSTR EndPath;