diff --git a/sdk/lib/rtl/registry.c b/sdk/lib/rtl/registry.c index 02361efc48..ed17819885 100644 --- a/sdk/lib/rtl/registry.c +++ b/sdk/lib/rtl/registry.c @@ -96,17 +96,24 @@ RtlpQueryRegistryDirect(IN ULONG ValueType, } else { - /* Check if there's space for the length and type, plus data */ - if (*Length < (2 * sizeof(ULONG) + ValueLength)) + if(ValueType != REG_BINARY) { - /* Nope, fail */ - return STATUS_BUFFER_TOO_SMALL; + /* Check if there's space for the length and type, plus data */ + if (*Length < (2 * sizeof(ULONG) + ValueLength)) + { + /* Nope, fail */ + return STATUS_BUFFER_TOO_SMALL; + } + /* Return the data */ + *Length++ = ValueLength; + *Length++ = ValueType; + RtlCopyMemory(Length, ValueData, ValueLength); } - - /* Return the data */ - *Length++ = ValueLength; - *Length++ = ValueType; + else + { + /* Return the REG_BINARY data */ RtlCopyMemory(Length, ValueData, ValueLength); + } } }