ntoskrnl.exe: Implement ExInitializeResourceLite().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45819
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-04-08 22:30:10 -05:00 committed by Alexandre Julliard
parent 93ed3356d8
commit 1304b4c71b
3 changed files with 63 additions and 12 deletions

View File

@ -2370,17 +2370,6 @@ void WINAPI ExFreePoolWithTag( void *ptr, ULONG tag )
HeapFree( GetProcessHeap(), 0, ptr );
}
/***********************************************************************
* ExInitializeResourceLite (NTOSKRNL.EXE.@)
*/
NTSTATUS WINAPI ExInitializeResourceLite(PERESOURCE Resource)
{
FIXME( "stub: %p\n", Resource );
return STATUS_NOT_IMPLEMENTED;
}
/***********************************************************************
* ExInitializeNPagedLookasideList (NTOSKRNL.EXE.@)
*/

View File

@ -717,3 +717,13 @@ void WINAPI ExReleaseFastMutexUnsafe( FAST_MUTEX *mutex )
if (count < 1)
KeSetEvent( &mutex->Event, IO_NO_INCREMENT, FALSE );
}
/***********************************************************************
* ExInitializeResourceLite (NTOSKRNL.EXE.@)
*/
NTSTATUS WINAPI ExInitializeResourceLite( ERESOURCE *resource )
{
TRACE("resource %p.\n", resource);
memset(resource, 0, sizeof(*resource));
return STATUS_SUCCESS;
}

View File

@ -153,12 +153,63 @@ typedef struct _KWAIT_BLOCK {
USHORT WaitType;
} KWAIT_BLOCK, *PKWAIT_BLOCK, *RESTRICTED_POINTER PRKWAIT_BLOCK;
typedef struct _OWNER_ENTRY
{
ERESOURCE_THREAD OwnerThread;
union
{
struct
{
ULONG IoPriorityBoosted : 1;
ULONG OwnerReferenced : 1;
ULONG IoQoSPriorityBoosted : 1;
ULONG OwnerCount : 29;
};
ULONG TableSize;
};
} OWNER_ENTRY, *POWNER_ENTRY;
#define ResourceNeverExclusive 0x0010
#define ResourceReleaseByOtherThread 0x0020
#define ResourceOwnedExclusive 0x0080
typedef struct _ERESOURCE
{
LIST_ENTRY SystemResourcesList;
OWNER_ENTRY *OwnerTable;
SHORT ActiveCount;
union
{
USHORT Flag;
struct
{
UCHAR ReservedLowFlags;
UCHAR WaiterPriority;
};
};
KSEMAPHORE *SharedWaiters;
KEVENT *ExclusiveWaiters;
OWNER_ENTRY OwnerEntry;
ULONG ActiveEntries;
ULONG ContentionCount;
ULONG NumberOfSharedWaiters;
ULONG NumberOfExclusiveWaiters;
#ifdef _WIN64
void *Reserved2;
#endif
union
{
void *Address;
ULONG_PTR CreatorBackTraceIndex;
};
KSPIN_LOCK SpinLock;
} ERESOURCE, *PERESOURCE;
typedef struct _IO_TIMER *PIO_TIMER;
typedef struct _IO_TIMER_ROUTINE *PIO_TIMER_ROUTINE;
typedef struct _ETHREAD *PETHREAD;
typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD;
typedef struct _EPROCESS *PEPROCESS;
typedef struct _ERESOURCE *PERESOURCE;
typedef struct _IO_WORKITEM *PIO_WORKITEM;
typedef struct _PAGED_LOOKASIDE_LIST *PPAGED_LOOKASIDE_LIST;
typedef struct _OBJECT_TYPE *POBJECT_TYPE;
@ -1469,6 +1520,7 @@ void WINAPI ExDeleteNPagedLookasideList(PNPAGED_LOOKASIDE_LIST);
void WINAPI ExFreePool(PVOID);
void WINAPI ExFreePoolWithTag(PVOID,ULONG);
void WINAPI ExInitializeNPagedLookasideList(PNPAGED_LOOKASIDE_LIST,PALLOCATE_FUNCTION,PFREE_FUNCTION,ULONG,SIZE_T,ULONG,USHORT);
NTSTATUS WINAPI ExInitializeResourceLite(ERESOURCE*);
PSLIST_ENTRY WINAPI ExInterlockedPopEntrySList(PSLIST_HEADER,PKSPIN_LOCK);
PSLIST_ENTRY WINAPI ExInterlockedPushEntrySList(PSLIST_HEADER,PSLIST_ENTRY,PKSPIN_LOCK);
LIST_ENTRY * WINAPI ExInterlockedRemoveHeadList(LIST_ENTRY*,KSPIN_LOCK*);