Signed-off-by: Torge Matthies tmatthies@codeweavers.com --- dlls/ntdll/reg.c | 6 +++--- dlls/ntdll/unix/system.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c index 106ee620cda8..949777740b79 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -93,7 +93,7 @@ NTSTATUS WINAPI RtlpNtEnumerateSubKey( HANDLE handle, UNICODE_STRING *out, ULONG
if (out->MaximumLength) { - dwLen = out->MaximumLength + sizeof(KEY_BASIC_INFORMATION); + dwLen = out->MaximumLength + offsetof(KEY_BASIC_INFORMATION, Name); info = RtlAllocateHeap( GetProcessHeap(), 0, dwLen ); if (!info) return STATUS_NO_MEMORY; @@ -105,7 +105,7 @@ NTSTATUS WINAPI RtlpNtEnumerateSubKey( HANDLE handle, UNICODE_STRING *out, ULONG }
ret = NtEnumerateKey( handle, index, KeyBasicInformation, info, dwLen, &dwResultLen ); - dwResultLen -= sizeof(KEY_BASIC_INFORMATION); + dwResultLen -= offsetof(KEY_BASIC_INFORMATION, Name);
if (ret == STATUS_BUFFER_OVERFLOW) out->Length = dwResultLen; @@ -138,7 +138,7 @@ NTSTATUS WINAPI RtlpNtQueryValueKey( HANDLE handle, ULONG *result_type, PBYTE de UNICODE_STRING name; NTSTATUS ret; DWORD dwResultLen; - DWORD dwLen = sizeof (KEY_VALUE_PARTIAL_INFORMATION) + (result_len ? *result_len : 0); + DWORD dwLen = offsetof(KEY_VALUE_PARTIAL_INFORMATION, Data[0]) + (result_len ? *result_len : 0);
info = RtlAllocateHeap( GetProcessHeap(), 0, dwLen ); if (!info) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 65c49b6ccd1d..77d42fd93685 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2134,7 +2134,7 @@ static BOOL reg_query_value( HKEY key, LPCWSTR name, DWORD type, void *data, DWO UNICODE_STRING nameW; KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)buf;
- if (count > sizeof(buf) - sizeof(KEY_VALUE_PARTIAL_INFORMATION)) return FALSE; + if (count > sizeof(buf) - offsetof(KEY_VALUE_PARTIAL_INFORMATION, Data)) return FALSE;
nameW.Buffer = (WCHAR *)name; nameW.Length = wcslen( name ) * sizeof(WCHAR);