96 return CallbackBlock->Function;
104 return CallbackBlock->Context;
139 DPRINT1(
"Unhandled callback race condition\n");
165 return CallbackBlock;
186 ASSERTMSG(
"Callback block is already undergoing rundown\n",
FALSE);
201 if (CallbackBlock == OldBlock)
271 RtlZeroMemory(&ObjectTypeInitializer,
sizeof(ObjectTypeInitializer));
273 ObjectTypeInitializer.
Length =
sizeof(ObjectTypeInitializer);
280 &ObjectTypeInitializer,
476 if (!(CallbackObject) ||
477 (
IsListEmpty(&CallbackObject->RegisteredCallbacks)))
487 for (RegisteredCallbacks = CallbackObject->RegisteredCallbacks.
Flink;
488 RegisteredCallbacks != &CallbackObject->RegisteredCallbacks;
489 RegisteredCallbacks = RegisteredCallbacks->
Flink)
500 CallbackRegistration->
Busy += 1;
515 CallbackRegistration->
Busy -= 1;
519 !(CallbackRegistration->
Busy))
574 if (!CallbackRegistration)
585 CallbackRegistration->
Busy = 0;
592 if ((CallbackObject->AllowMultipleCallbacks) ||
593 (
IsListEmpty(&CallbackObject->RegisteredCallbacks)))
597 &CallbackRegistration->
Link);
609 CallbackRegistration =
NULL;
616 return (
PVOID)CallbackRegistration;
653 while (CallbackRegistration->
Busy)
static HANDLE DirectoryHandle
_In_ PFCB _In_ PCD_NAME DirName
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeReleaseSpinLock(sl, irql)
#define KeSetEvent(pEvt, foo, foo2)
#define KeAcquireSpinLock(sl, irql)
#define InitializeListHead(ListHead)
#define KeInitializeSpinLock(sl)
VOID NTAPI KeClearEvent(IN PKEVENT Event)
FORCEINLINE BOOLEAN ExReleaseFastReference(IN PEX_FAST_REF FastRef, IN PVOID Object)
FORCEINLINE ULONG ExGetCountFastReference(IN EX_FAST_REF FastRef)
#define ExWaitForRundownProtectionRelease
#define ExReleaseRundownProtection
#define ExInitializeRundownProtection
FORCEINLINE EX_FAST_REF ExCompareSwapFastReference(IN PEX_FAST_REF FastRef, IN PVOID Object, IN PVOID OldObject)
FORCEINLINE BOOLEAN ExInsertFastReference(IN OUT PEX_FAST_REF FastRef, IN PVOID Object)
FORCEINLINE VOID ExInitializeFastReference(OUT PEX_FAST_REF FastRef, IN OPTIONAL PVOID Object)
FORCEINLINE PVOID ExGetObjectFastReference(IN EX_FAST_REF FastRef)
FORCEINLINE EX_FAST_REF ExAcquireFastReference(IN OUT PEX_FAST_REF FastRef)
FORCEINLINE VOID ExWaitOnPushLock(PEX_PUSH_LOCK PushLock)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define OBJ_CASE_INSENSITIVE
#define KeLeaveCriticalRegion()
#define KeEnterCriticalRegion()
#define ExFreePoolWithTag(_P, _T)
#define InitializeObjectAttributes(p, n, a, r, s)
#define CALLBACK_ALL_ACCESS
struct _CALLBACK_REGISTRATION * PCALLBACK_REGISTRATION
#define CALLBACK_MODIFY_STATE
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define ASSERTMSG(msg, exp)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define STANDARD_RIGHTS_READ
#define STANDARD_RIGHTS_WRITE
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
#define DIRECTORY_ALL_ACCESS
#define STANDARD_RIGHTS_EXECUTE
VOID NTAPI ExpDeleteCallback(IN PVOID Object)
PCALLBACK_OBJECT SetSystemStateCallback
PCALLBACK_OBJECT PowerStateCallback
PEX_CALLBACK_FUNCTION NTAPI ExGetCallBackBlockRoutine(IN PEX_CALLBACK_ROUTINE_BLOCK CallbackBlock)
PCALLBACK_OBJECT SetSystemTimeCallback
EX_PUSH_LOCK ExpCallBackFlush
BOOLEAN NTAPI ExCompareExchangeCallBack(IN OUT PEX_CALLBACK CallBack, IN PEX_CALLBACK_ROUTINE_BLOCK NewBlock, IN PEX_CALLBACK_ROUTINE_BLOCK OldBlock)
VOID NTAPI ExUnregisterCallback(IN PVOID CallbackRegistrationHandle)
VOID NTAPI ExInitializeCallBack(IN OUT PEX_CALLBACK Callback)
PEX_CALLBACK_ROUTINE_BLOCK NTAPI ExReferenceCallBackBlock(IN OUT PEX_CALLBACK CallBack)
VOID NTAPI ExWaitForCallBacks(IN PEX_CALLBACK_ROUTINE_BLOCK CallbackBlock)
BOOLEAN NTAPI ExpInitializeCallbacks(VOID)
VOID NTAPI ExNotifyCallback(IN PCALLBACK_OBJECT CallbackObject, IN PVOID Argument1, IN PVOID Argument2)
GENERIC_MAPPING ExpCallbackMapping
PVOID NTAPI ExRegisterCallback(IN PCALLBACK_OBJECT CallbackObject, IN PCALLBACK_FUNCTION CallbackFunction, IN PVOID CallbackContext)
NTSTATUS NTAPI ExCreateCallback(OUT PCALLBACK_OBJECT *CallbackObject, IN POBJECT_ATTRIBUTES ObjectAttributes, IN BOOLEAN Create, IN BOOLEAN AllowMultipleCallbacks)
POBJECT_TYPE ExCallbackObjectType
PVOID NTAPI ExGetCallBackBlockContext(IN PEX_CALLBACK_ROUTINE_BLOCK CallbackBlock)
VOID NTAPI ExFreeCallBack(IN PEX_CALLBACK_ROUTINE_BLOCK CallbackBlock)
PEX_CALLBACK_ROUTINE_BLOCK NTAPI ExAllocateCallBack(IN PEX_CALLBACK_FUNCTION Function, IN PVOID Context)
VOID NTAPI ExDereferenceCallBackBlock(IN OUT PEX_CALLBACK CallBack, IN PEX_CALLBACK_ROUTINE_BLOCK CallbackBlock)
SYSTEM_CALLBACKS ExpInitializeCallback[]
PSECURITY_DESCRIPTOR SePublicDefaultSd
NTSTATUS NTAPI NtCreateDirectoryObject(OUT PHANDLE DirectoryHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
NTSTATUS NTAPI ObInsertObject(IN PVOID Object, IN PACCESS_STATE AccessState OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG ObjectPointerBias, OUT PVOID *NewObject OPTIONAL, OUT PHANDLE Handle)
NTSTATUS NTAPI ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, IN PACCESS_STATE PassedAccessState, IN ACCESS_MASK DesiredAccess, IN OUT PVOID ParseContext, OUT PHANDLE Handle)
NTSTATUS NTAPI ObCreateObject(IN KPROCESSOR_MODE ProbeMode OPTIONAL, IN POBJECT_TYPE Type, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN OUT PVOID ParseContext OPTIONAL, IN ULONG ObjectSize, IN ULONG PagedPoolCharge OPTIONAL, IN ULONG NonPagedPoolCharge OPTIONAL, OUT PVOID *Object)
NTSTATUS NTAPI ObCreateObjectType(IN PUNICODE_STRING TypeName, IN POBJECT_TYPE_INITIALIZER ObjectTypeInitializer, IN PVOID Reserved, OUT POBJECT_TYPE *ObjectType)
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
BOOLEAN FASTCALL ExfAcquireRundownProtectionEx(IN PEX_RUNDOWN_REF RunRef, IN ULONG Count)
VOID FASTCALL ExfReleaseRundownProtectionEx(IN PEX_RUNDOWN_REF RunRef, IN ULONG Count)
#define ASSERT_IRQL_LESS_OR_EQUAL(x)
PCALLBACK_OBJECT * CallbackObject
PCALLBACK_FUNCTION CallbackFunction
PCALLBACK_OBJECT CallbackObject
BOOLEAN UnregisterWaiting
PEX_CALLBACK_FUNCTION Function
EX_RUNDOWN_REF RundownProtect
struct _LIST_ENTRY * Flink
GENERIC_MAPPING GenericMapping
OB_DELETE_METHOD DeleteProcedure
#define TAG_CALLBACK_ROUTINE_BLOCK
#define TAG_CALLBACK_REGISTRATION
#define RTL_CONSTANT_STRING(s)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_UNSUCCESSFUL
static int Link(const char **args)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR _In_ ULONGLONG _In_ ULONGLONG _In_opt_ PEVENT_FILTER_DESCRIPTOR _Inout_opt_ PVOID CallbackContext
_IRQL_requires_same_ _In_opt_ PVOID Argument1
EX_CALLBACK_FUNCTION * PEX_CALLBACK_FUNCTION
_In_ POBJECT_ATTRIBUTES _In_ BOOLEAN _In_ BOOLEAN AllowMultipleCallbacks
_In_ PCALLBACK_FUNCTION CallbackFunction
CALLBACK_FUNCTION * PCALLBACK_FUNCTION
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
#define ObDereferenceObject
#define ObReferenceObject