From: Austin English Subject: ntoskrnl.exe: add RtlInitializeGenericTableAvl/RtlInsertElementGenericTableAvl stubs Message-Id: Date: Tue, 20 Oct 2015 23:11:19 -0500 https://bugs.winehq.org/show_bug.cgi?id=38737 Tested with Kaspersky Anti-Virus from https://bugs.winehq.org/show_bug.cgi?id=39443 (the next bug it hits) -- -Austin From ce1aae2c7585d8167008931ebd81fba36f0b7137 Mon Sep 17 00:00:00 2001 From: Austin English Date: Thu, 15 Oct 2015 05:49:46 -0500 Subject: [PATCH] add RtlInitializeGenericTableAvl/RtlInsertElementGenericTableAvl stubs Signed-off-by: Austin English --- dlls/ntdll/ntdll.spec | 4 +-- dlls/ntdll/rtl.c | 16 +++++++++++ dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 4 +-- include/ddk/ntddk.h | 54 +++++++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 38422ae..769f3f7 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -682,7 +682,7 @@ @ stdcall RtlInitializeCriticalSectionAndSpinCount(ptr long) @ stdcall RtlInitializeCriticalSectionEx(ptr long long) @ stdcall RtlInitializeGenericTable(ptr ptr ptr ptr ptr) -# @ stub RtlInitializeGenericTableAvl +@ stdcall RtlInitializeGenericTableAvl(ptr ptr ptr ptr ptr) @ stdcall RtlInitializeHandleTable(long long ptr) @ stub RtlInitializeRXact # @ stub RtlInitializeRangeList @@ -692,7 +692,7 @@ @ stdcall RtlInitializeSid(ptr ptr long) # @ stub RtlInitializeStackTraceDataBase @ stub RtlInsertElementGenericTable -# @ stub RtlInsertElementGenericTableAvl +@ stdcall RtlInsertElementGenericTableAvl(ptr ptr long ptr) @ cdecl -arch=x86_64 RtlInstallFunctionTableCallback(long long long ptr ptr wstr) @ stdcall RtlInt64ToUnicodeString(int64 long ptr) @ stdcall RtlIntegerToChar(long long long ptr) diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 8eb3e9f..0ca27c2 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -1595,3 +1595,19 @@ void WINAPI RtlGetCurrentProcessorNumberEx(PROCESSOR_NUMBER *processor) processor->Number = NtGetCurrentProcessorNumber(); processor->Reserved = 0; } + +/*********************************************************************** + * RtlInitializeGenericTableAvl (NTOSKRNL.EXE.@) + */ +void WINAPI RtlInitializeGenericTableAvl(void *table, void *compare, void *allocate, void *free, void *context) +{ + FIXME("%p %p %p %p %p: stub\n", table, compare, allocate, free, context); +} + +/*********************************************************************** + * RtlInsertElementGenericTableAvl (NTOSKRNL.EXE.@) + */ +void WINAPI RtlInsertElementGenericTableAvl(void *table, void *buffer, long size, BOOL *element) +{ + FIXME("%p %p %lu %p: stub\n", table, buffer, size, element); +} diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 1957a9a..7690268 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -1055,12 +1055,12 @@ @ stdcall RtlInitUnicodeString(ptr wstr) ntdll.RtlInitUnicodeString @ stdcall RtlInitializeBitMap(ptr long long) ntdll.RtlInitializeBitMap @ stdcall RtlInitializeGenericTable(ptr ptr ptr ptr ptr) ntdll.RtlInitializeGenericTable -@ stub RtlInitializeGenericTableAvl +@ stdcall RtlInitializeGenericTableAvl(ptr ptr ptr ptr ptr) ntdll.RtlInitializeGenericTableAvl @ stub RtlInitializeRangeList @ stdcall RtlInitializeSid(ptr ptr long) ntdll.RtlInitializeSid @ stub RtlInitializeUnicodePrefix @ stub RtlInsertElementGenericTable -@ stub RtlInsertElementGenericTableAvl +@ stdcall RtlInsertElementGenericTableAvl(ptr ptr long ptr) ntdll.RtlInsertElementGenericTableAvl @ stub RtlInsertElementGenericTableFull @ stub RtlInsertElementGenericTableFullAvl @ stub RtlInsertUnicodePrefix diff --git a/include/ddk/ntddk.h b/include/ddk/ntddk.h index bccfd39..0b6ae53 100644 --- a/include/ddk/ntddk.h +++ b/include/ddk/ntddk.h @@ -149,6 +149,59 @@ typedef struct _KWAIT_BLOCK { USHORT WaitType; } KWAIT_BLOCK, *PKWAIT_BLOCK, *RESTRICTED_POINTER PRKWAIT_BLOCK; +typedef struct _RTL_BALANCED_LINKS { + struct _RTL_BALANCED_LINKS *parent; + struct _RTL_BALANCED_LINKS *left_child; + struct _RTL_BALANCED_LINKS *right_child; + CHAR balance; + UCHAR reserved[3]; +} RTL_BALANCED_LINKS; +typedef RTL_BALANCED_LINKS *PRTL_BALANCED_LINKS; + +struct _RTL_AVL_TABLE; + +typedef enum _RTL_GENERIC_COMPARE_RESULTS { + generic_less_than, + generic_greater_than, + generic_qual +} RTL_GENERIC_COMPARE_RESULTS; + +RTL_GENERIC_COMPARE_RESULTS WINAPI RTL_AVL_COMPARE_ROUTINE ( + struct _RTL_AVL_TABLE *table, + void *struct1, + void *struct2 +); + +typedef enum RTL_AVL_COMPARE_ROUTINE *PRTL_AVL_COMPARE_ROUTINE; + +void WINAPI RTL_AVL_ALLOCATE_ROUTINE ( + struct _RTL_AVL_TABLE *table, + LONG size +); + +typedef enum RTL_AVL_ALLOCATE_ROUTINE *PRTL_AVL_ALLOCATE_ROUTINE; + +void WINAPI RTL_AVL_FREE_ROUTINE ( + struct _RTL_AVL_TABLE *table, + void *buffer +); + +typedef enum RTL_AVL_FREE_ROUTINE *PRTL_AVL_FREE_ROUTINE; + +typedef struct _RTL_AVL_TABLE { + RTL_BALANCED_LINKS balanced_root; + void *ordered_pointer; + ULONG which_ordered_element; + ULONG number_generic_table_elements; + ULONG tree_depth; + PRTL_BALANCED_LINKS restart_key; + ULONG delete_count; + PRTL_AVL_COMPARE_ROUTINE compare_routine; + PRTL_AVL_ALLOCATE_ROUTINE allocate_routine; + PRTL_AVL_FREE_ROUTINE free_routine; + void *table_context; +} RTL_AVL_TABLE, *PRTL_AVL_TABLE; + typedef VOID (WINAPI *PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)(PVOID,PVOID); typedef VOID (WINAPI *PDRIVER_REINITIALIZE)(PDRIVER_OBJECT,PVOID,ULONG); typedef VOID (WINAPI *PLOAD_IMAGE_NOTIFY_ROUTINE)(PUNICODE_STRING,HANDLE,PIMAGE_INFO); @@ -160,5 +213,6 @@ NTSTATUS WINAPI IoQueryDeviceDescription(PINTERFACE_TYPE,PULONG,PCONFIGURATION_ void WINAPI IoRegisterDriverReinitialization(PDRIVER_OBJECT,PDRIVER_REINITIALIZE,PVOID); NTSTATUS WINAPI IoRegisterShutdownNotification(PDEVICE_OBJECT); NTSTATUS WINAPI PsSetLoadImageNotifyRoutine(PLOAD_IMAGE_NOTIFY_ROUTINE); +void WINAPI RtlInitializeGenericTableAvl(PRTL_AVL_TABLE, PRTL_AVL_COMPARE_ROUTINE, PRTL_AVL_ALLOCATE_ROUTINE, PRTL_AVL_FREE_ROUTINE, VOID *); #endif -- 2.6.1