mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 11:11:44 +00:00
[REACTOS] Fix a number of MSVC warnings
This commit is contained in:
parent
b1c6c91d1f
commit
5d8e834897
43 changed files with 175 additions and 86 deletions
|
@ -476,9 +476,16 @@ ScmSetServicePassword(
|
|||
UNICODE_STRING Password;
|
||||
NTSTATUS Status;
|
||||
DWORD dwError = ERROR_SUCCESS;
|
||||
SIZE_T ServiceNameLength;
|
||||
|
||||
RtlZeroMemory(&ObjectAttributes, sizeof(OBJECT_ATTRIBUTES));
|
||||
|
||||
ServiceNameLength = wcslen(pszServiceName);
|
||||
if (ServiceNameLength > (UNICODE_STRING_MAX_CHARS - 4))
|
||||
{
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
Status = LsaOpenPolicy(NULL,
|
||||
&ObjectAttributes,
|
||||
POLICY_CREATE_SECRET,
|
||||
|
@ -486,7 +493,7 @@ ScmSetServicePassword(
|
|||
if (!NT_SUCCESS(Status))
|
||||
return RtlNtStatusToDosError(Status);
|
||||
|
||||
ServiceName.Length = (wcslen(pszServiceName) + 4) * sizeof(WCHAR);
|
||||
ServiceName.Length = ((USHORT)ServiceNameLength + 4) * sizeof(WCHAR);
|
||||
ServiceName.MaximumLength = ServiceName.Length + sizeof(WCHAR);
|
||||
ServiceName.Buffer = HeapAlloc(GetProcessHeap(),
|
||||
HEAP_ZERO_MEMORY,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue