diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index c3b6bf0b4fc..8cabf953b46 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -686,7 +686,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 @@ -696,7 +696,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 8eb3e9f017d..74ad35a57cf 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -45,6 +45,7 @@ #include "wine/unicode.h" #include "ntdll_misc.h" #include "inaddr.h" +#include "ddk/ntddk.h" WINE_DEFAULT_DEBUG_CHANNEL(ntdll); @@ -1595,3 +1596,20 @@ void WINAPI RtlGetCurrentProcessorNumberEx(PROCESSOR_NUMBER *processor) processor->Number = NtGetCurrentProcessorNumber(); processor->Reserved = 0; } + +/*********************************************************************** + * RtlInitializeGenericTableAvl (NTDLL.@) + */ +void WINAPI RtlInitializeGenericTableAvl(PRTL_AVL_TABLE table, PRTL_AVL_COMPARE_ROUTINE compare, + PRTL_AVL_ALLOCATE_ROUTINE allocate, PRTL_AVL_FREE_ROUTINE free, void *context) +{ + FIXME("%p %p %p %p %p: stub\n", table, compare, allocate, free, context); +} + +/*********************************************************************** + * RtlInsertElementGenericTableAvl (NTDLL.@) + */ +void WINAPI RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE table, void *buffer, ULONG size, BOOL *element) +{ + FIXME("%p %p %u %p: stub\n", table, buffer, size, element); +} diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index db152652d8c..1319adaf417 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 bccfd39347e..6aae257770d 100644 --- a/include/ddk/ntddk.h +++ b/include/ddk/ntddk.h @@ -149,6 +149,43 @@ 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 *LeftChild; + struct _RTL_BALANCED_LINKS *RightChild; + 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 { + GenericLessThan, + GenericGreaterThan, + GenericEqual +} RTL_GENERIC_COMPARE_RESULTS; + +typedef RTL_GENERIC_COMPARE_RESULTS (WINAPI *PRTL_AVL_COMPARE_ROUTINE)(struct _RTL_AVL_TABLE *, void *, void *); + +typedef void (WINAPI *PRTL_AVL_ALLOCATE_ROUTINE)(struct _RTL_AVL_TABLE *, LONG); + +typedef void (WINAPI *PRTL_AVL_FREE_ROUTINE )(struct _RTL_AVL_TABLE *, void *buffer); + +typedef struct _RTL_AVL_TABLE { + RTL_BALANCED_LINKS BalancedRoot; + void *OrderedPointer; + ULONG WhichOrderedElement; + ULONG NumberGenericTableElements; + ULONG DepthOfTree; + PRTL_BALANCED_LINKS RestartKey; + ULONG DeleteCount; + PRTL_AVL_COMPARE_ROUTINE CompareRoutine; + PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine; + PRTL_AVL_FREE_ROUTINE FreeRoutine; + void *TableContext; +} 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 +197,7 @@ 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 *); +void WINAPI RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE,void *,ULONG,BOOL*); #endif