[APPHELP] SdbGUIDToString(): use sizeof(WCHAR) instead of '2' (#7137)

This commit is contained in:
Hermès Bélusca-Maïto 2024-07-11 17:58:00 +02:00
parent b3094aa001
commit 4028de8c55
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -414,7 +414,7 @@ BOOL WINAPI SdbGUIDToString(CONST GUID *Guid, PWSTR GuidString, SIZE_T Length)
UNICODE_STRING GuidString_u; UNICODE_STRING GuidString_u;
if (NT_SUCCESS(RtlStringFromGUID(Guid, &GuidString_u))) if (NT_SUCCESS(RtlStringFromGUID(Guid, &GuidString_u)))
{ {
HRESULT hr = StringCchCopyNW(GuidString, Length, GuidString_u.Buffer, GuidString_u.Length / 2); HRESULT hr = StringCchCopyNW(GuidString, Length, GuidString_u.Buffer, GuidString_u.Length / sizeof(WCHAR));
RtlFreeUnicodeString(&GuidString_u); RtlFreeUnicodeString(&GuidString_u);
return SUCCEEDED(hr); return SUCCEEDED(hr);
} }