/*
- * Copyright 2015 Mark Jansen
+ * Copyright 2015-2017 Mark Jansen (mark.jansen@reactos.org)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
FindClose(FindHandle);
SdbpResizeTempStr(LongPath, (LongPath->Str.Length >> 1) + 20);
StringCbPrintfW(LongPath->Str.Buffer, LongPath->Str.MaximumLength, SIGN_MEDIA_FMT, SignMedia, Scratch.Str.Buffer + 3);
- LongPath->Str.Length = (USHORT)wcslen(LongPath->Str.Buffer) * sizeof(WCHAR);
+ LongPath->Str.Length = (USHORT)SdbpStrlen(LongPath->Str.Buffer) * sizeof(WCHAR);
SdbpFreeTempStr(&Scratch);
return TRUE;
}
return Status;
}
}
- FullPath->MaximumLength = (USHORT)(BasePath.Length + (wcslen(LayersKey) + 1) * sizeof(WCHAR));
+ FullPath->MaximumLength = (USHORT)(BasePath.Length + SdbpStrsize(LayersKey));
FullPath->Buffer = SdbAlloc(FullPath->MaximumLength);
FullPath->Length = 0;
RtlAppendUnicodeStringToString(FullPath, &BasePath);
Status = SdbpOpenKey(&FullKey, bMachine, KEY_SET_VALUE, &KeyHandle);
if (NT_SUCCESS(Status))
{
- Status = NtSetValueKey(KeyHandle, &LongPath.Str, 0, REG_SZ, (PVOID)wszLayers, (wcslen(wszLayers)+1) * sizeof(WCHAR));
+ Status = NtSetValueKey(KeyHandle, &LongPath.Str, 0, REG_SZ, (PVOID)wszLayers, SdbpStrsize(wszLayers));
if (!NT_SUCCESS(Status))
{
SHIM_INFO("Failed to write a value to Key \"%wZ\" Status 0x%lx\n", &FullKey, Status);