VOID
INIT_FUNCTION
+STDCALL
ExpInitializeEventImplementation(VOID)
{
OBJECT_TYPE_INITIALIZER ObjectTypeInitializer;
ObjectTypeInitializer.GenericMapping = ExpEventMapping;
ObjectTypeInitializer.PoolType = NonPagedPool;
ObjectTypeInitializer.ValidAccessMask = EVENT_ALL_ACCESS;
- ObjectTypeInitializer.UseDefaultObject = TRUE;
ObpCreateTypeObject(&ObjectTypeInitializer, &Name, &ExEventObjectType);
}
NTSTATUS Status = STATUS_SUCCESS;
PAGED_CODE();
- DPRINT("NtCreateEvent(0x%x, 0x%x, 0x%x)\n", EventHandle, DesiredAccess, ObjectAttributes);
+ DPRINT("NtCreateEvent(0x%p, 0x%x, 0x%p)\n", EventHandle, DesiredAccess, ObjectAttributes);
/* Check Output Safety */
if(PreviousMode != KernelMode) {
_SEH_TRY {
- ProbeForWrite(EventHandle,
- sizeof(HANDLE),
- sizeof(ULONG));
+ ProbeForWriteHandle(EventHandle);
} _SEH_EXCEPT(_SEH_ExSystemExceptionFilter) {
Status = _SEH_GetExceptionCode();
NTSTATUS Status = STATUS_SUCCESS;
PAGED_CODE();
- DPRINT("NtOpenEvent(0x%x, 0x%x, 0x%x)\n", EventHandle, DesiredAccess, ObjectAttributes);
+ DPRINT("NtOpenEvent(0x%p, 0x%x, 0x%p)\n", EventHandle, DesiredAccess, ObjectAttributes);
/* Check Output Safety */
if(PreviousMode != KernelMode) {
_SEH_TRY {
- ProbeForWrite(EventHandle,
- sizeof(HANDLE),
- sizeof(ULONG));
+ ProbeForWriteHandle(EventHandle);
} _SEH_EXCEPT(_SEH_ExSystemExceptionFilter) {
Status = _SEH_GetExceptionCode();
EventHandle, PreviousState);
/* Check buffer validity */
- if(PreviousState && PreviousMode == UserMode) {
+ if(PreviousState && PreviousMode != KernelMode) {
_SEH_TRY {
- ProbeForWrite(PreviousState,
- sizeof(LONG),
- sizeof(ULONG));
+ ProbeForWriteLong(PreviousState);
} _SEH_EXCEPT(_SEH_ExSystemExceptionFilter) {
Status = _SEH_GetExceptionCode();
PEVENT_BASIC_INFORMATION BasicInfo = (PEVENT_BASIC_INFORMATION)EventInformation;
PAGED_CODE();
- DPRINT("NtQueryEvent(0x%x, 0x%x, 0x%x)\n", EventHandle, EventInformationClass);
+ DPRINT("NtQueryEvent(0x%p, 0x%x)\n", EventHandle, EventInformationClass);
/* Check buffers and class validity */
- DefaultQueryInfoBufferCheck(EventInformationClass,
- ExEventInfoClass,
- EventInformation,
- EventInformationLength,
- ReturnLength,
- PreviousMode,
- &Status);
+ Status = DefaultQueryInfoBufferCheck(EventInformationClass,
+ ExEventInfoClass,
+ sizeof(ExEventInfoClass) / sizeof(ExEventInfoClass[0]),
+ EventInformation,
+ EventInformationLength,
+ ReturnLength,
+ PreviousMode);
if(!NT_SUCCESS(Status)) {
/* Invalid buffers */
EventHandle, PreviousState);
/* Check buffer validity */
- if(PreviousState && PreviousMode == UserMode) {
+ if(PreviousState && PreviousMode != KernelMode) {
_SEH_TRY {
- ProbeForWrite(PreviousState,
- sizeof(LONG),
- sizeof(ULONG));
+ ProbeForWriteLong(PreviousState);
} _SEH_EXCEPT(_SEH_ExSystemExceptionFilter) {
Status = _SEH_GetExceptionCode();
EventHandle, PreviousState);
/* Check buffer validity */
- if(PreviousState != NULL && PreviousMode == UserMode) {
+ if(PreviousState != NULL && PreviousMode != KernelMode) {
_SEH_TRY {
- ProbeForWrite(PreviousState,
- sizeof(LONG),
- sizeof(ULONG));
+ ProbeForWriteLong(PreviousState);
} _SEH_EXCEPT(_SEH_ExSystemExceptionFilter) {
Status = _SEH_GetExceptionCode();