ntdll: Return STATUS_INFO_LENGTH_MISMATCH when len is too small in NtQueryObject(ObjectBasicInformation).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50791
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 749f8c25e2
)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
parent
a0711d16fa
commit
74d7bd0fdf
|
@ -1333,6 +1333,7 @@ static void test_query_object(void)
|
|||
char buffer[1024];
|
||||
NTSTATUS status;
|
||||
ULONG len, expected_len;
|
||||
OBJECT_BASIC_INFORMATION info;
|
||||
OBJECT_ATTRIBUTES attr;
|
||||
UNICODE_STRING path, *str;
|
||||
char dir[MAX_PATH], tmp_path[MAX_PATH], file1[MAX_PATH + 16];
|
||||
|
@ -1344,6 +1345,20 @@ static void test_query_object(void)
|
|||
|
||||
handle = CreateEventA( NULL, FALSE, FALSE, "test_event" );
|
||||
|
||||
status = pNtQueryObject( handle, ObjectBasicInformation, NULL, 0, NULL );
|
||||
ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed %x\n", status );
|
||||
|
||||
status = pNtQueryObject( handle, ObjectBasicInformation, &info, 0, NULL );
|
||||
ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed %x\n", status );
|
||||
|
||||
status = pNtQueryObject( handle, ObjectBasicInformation, NULL, 0, &len );
|
||||
ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed %x\n", status );
|
||||
|
||||
len = 0;
|
||||
status = pNtQueryObject( handle, ObjectBasicInformation, &info, sizeof(OBJECT_BASIC_INFORMATION), &len );
|
||||
ok( status == STATUS_SUCCESS, "NtQueryObject failed %x\n", status );
|
||||
ok( len >= sizeof(OBJECT_BASIC_INFORMATION), "unexpected len %u\n", len );
|
||||
|
||||
len = 0;
|
||||
status = pNtQueryObject( handle, ObjectNameInformation, buffer, 0, &len );
|
||||
ok( status == STATUS_INFO_LENGTH_MISMATCH, "NtQueryObject failed %x\n", status );
|
||||
|
|
|
@ -6509,7 +6509,7 @@ NTSTATUS WINAPI NtQueryObject( HANDLE handle, OBJECT_INFORMATION_CLASS info_clas
|
|||
{
|
||||
OBJECT_BASIC_INFORMATION *p = ptr;
|
||||
|
||||
if (len < sizeof(*p)) return STATUS_INVALID_BUFFER_SIZE;
|
||||
if (len < sizeof(*p)) return STATUS_INFO_LENGTH_MISMATCH;
|
||||
|
||||
SERVER_START_REQ( get_object_info )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue