Pluged in CallMsgFilter, I tested this and no crashes on real hardware.

svn path=/trunk/; revision=15935
This commit is contained in:
James Tabor 2005-06-16 20:46:39 +00:00
parent 8f5dd38cdd
commit 2054ea72e9
3 changed files with 181 additions and 181 deletions

View file

@ -1,171 +1,171 @@
/* /*
* ReactOS W32 Subsystem * ReactOS W32 Subsystem
* Copyright (C) 2005 ReactOS Team * Copyright (C) 2005 ReactOS Team
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* /*
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* PURPOSE: GDI DRIVEROBJ Functions * PURPOSE: GDI DRIVEROBJ Functions
* FILE: subsys/win32k/eng/driverobj.c * FILE: subsys/win32k/eng/driverobj.c
* PROGRAMER: Gregor Anich * PROGRAMER: Gregor Anich
* REVISION HISTORY: * REVISION HISTORY:
* 04/01/2005: Created * 04/01/2005: Created
*/ */
#include <w32k.h> #include <w32k.h>
/*!\brief Called when the process is terminated. /*!\brief Called when the process is terminated.
* *
* Calls the free-proc for each existing DRIVEROBJ. * Calls the free-proc for each existing DRIVEROBJ.
* *
* \param Process Pointer to the EPROCESS struct for the process beeing terminated. * \param Process Pointer to the EPROCESS struct for the process beeing terminated.
* \param Win32Process Pointer to the W32PROCESS * \param Win32Process Pointer to the W32PROCESS
*/ */
VOID FASTCALL VOID FASTCALL
IntEngCleanupDriverObjs(struct _EPROCESS *Process, IntEngCleanupDriverObjs(struct _EPROCESS *Process,
PW32PROCESS Win32Process) PW32PROCESS Win32Process)
{ {
PDRIVERGDI DrvObjInt; PDRIVERGDI DrvObjInt;
IntEngLockProcessDriverObjs(PsGetWin32Process()); IntEngLockProcessDriverObjs(PsGetWin32Process());
while (!IsListEmpty(&Win32Process->DriverObjListHead)) while (!IsListEmpty(&Win32Process->DriverObjListHead))
{ {
DrvObjInt = CONTAINING_RECORD(Win32Process->DriverObjListHead.Flink, DrvObjInt = CONTAINING_RECORD(Win32Process->DriverObjListHead.Flink,
DRIVERGDI, ListEntry); DRIVERGDI, ListEntry);
IntEngUnLockProcessDriverObjs(PsGetWin32Process()); IntEngUnLockProcessDriverObjs(PsGetWin32Process());
EngDeleteDriverObj((HDRVOBJ)(&DrvObjInt->DriverObj), TRUE, FALSE); EngDeleteDriverObj((HDRVOBJ)(&DrvObjInt->DriverObj), TRUE, FALSE);
IntEngLockProcessDriverObjs(PsGetWin32Process()); IntEngLockProcessDriverObjs(PsGetWin32Process());
} }
IntEngUnLockProcessDriverObjs(PsGetWin32Process()); IntEngUnLockProcessDriverObjs(PsGetWin32Process());
} }
/* /*
* @implemented * @implemented
*/ */
HDRVOBJ HDRVOBJ
STDCALL STDCALL
EngCreateDriverObj( EngCreateDriverObj(
IN PVOID pvObj, IN PVOID pvObj,
IN FREEOBJPROC pFreeObjProc, IN FREEOBJPROC pFreeObjProc,
IN HDEV hdev IN HDEV hdev
) )
{ {
PDRIVERGDI DrvObjInt; PDRIVERGDI DrvObjInt;
PDRIVEROBJ DrvObjUser; PDRIVEROBJ DrvObjUser;
/* Create DRIVEROBJ */ /* Create DRIVEROBJ */
DrvObjInt = EngAllocMem(0, sizeof (DRIVERGDI), TAG_DRIVEROBJ); DrvObjInt = EngAllocMem(0, sizeof (DRIVERGDI), TAG_DRIVEROBJ);
if (DrvObjInt == NULL) if (DrvObjInt == NULL)
{ {
DPRINT1("Failed to allocate memory for a DRIVERGDI structure!\n"); DPRINT1("Failed to allocate memory for a DRIVERGDI structure!\n");
return NULL; return NULL;
} }
/* fill user object */ /* fill user object */
DrvObjUser = GDIToObj(DrvObjInt, DRIVER); DrvObjUser = GDIToObj(DrvObjInt, DRIVER);
DrvObjUser->pvObj = pvObj; DrvObjUser->pvObj = pvObj;
DrvObjUser->pFreeProc = pFreeObjProc; DrvObjUser->pFreeProc = pFreeObjProc;
DrvObjUser->hdev = hdev; DrvObjUser->hdev = hdev;
DrvObjUser->dhpdev = ((GDIDEVICE*)hdev)->PDev; DrvObjUser->dhpdev = ((GDIDEVICE*)hdev)->PDev;
/* fill internal object */ /* fill internal object */
ExInitializeFastMutex(&DrvObjInt->Lock); ExInitializeFastMutex(&DrvObjInt->Lock);
IntEngLockProcessDriverObjs(PsGetWin32Process()); IntEngLockProcessDriverObjs(PsGetWin32Process());
InsertTailList(&PsGetWin32Process()->DriverObjListHead, &DrvObjInt->ListEntry); InsertTailList(&PsGetWin32Process()->DriverObjListHead, &DrvObjInt->ListEntry);
IntEngUnLockProcessDriverObjs(PsGetWin32Process()); IntEngUnLockProcessDriverObjs(PsGetWin32Process());
return (HDRVOBJ)DrvObjUser; return (HDRVOBJ)DrvObjUser;
} }
/* /*
* @implemented * @implemented
*/ */
BOOL BOOL
STDCALL STDCALL
EngDeleteDriverObj( EngDeleteDriverObj(
IN HDRVOBJ hdo, IN HDRVOBJ hdo,
IN BOOL bCallBack, IN BOOL bCallBack,
IN BOOL bLocked IN BOOL bLocked
) )
{ {
PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo; PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo;
PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER); PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER);
/* Make sure the obj is locked */ /* Make sure the obj is locked */
if (!bLocked) if (!bLocked)
{ {
if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock)) if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock))
{ {
return FALSE; return FALSE;
} }
} }
/* Call the free-proc */ /* Call the free-proc */
if (bCallBack) if (bCallBack)
{ {
if (!DrvObjUser->pFreeProc(DrvObjUser)) if (!DrvObjUser->pFreeProc(DrvObjUser))
{ {
return FALSE; return FALSE;
} }
} }
/* Free the DRIVEROBJ */ /* Free the DRIVEROBJ */
IntEngLockProcessDriverObjs(PsGetWin32Process()); IntEngLockProcessDriverObjs(PsGetWin32Process());
RemoveEntryList(&DrvObjInt->ListEntry); RemoveEntryList(&DrvObjInt->ListEntry);
IntEngUnLockProcessDriverObjs(PsGetWin32Process()); IntEngUnLockProcessDriverObjs(PsGetWin32Process());
EngFreeMem(DrvObjInt); EngFreeMem(DrvObjInt);
return TRUE; return TRUE;
} }
/* /*
* @implemented * @implemented
*/ */
PDRIVEROBJ PDRIVEROBJ
STDCALL STDCALL
EngLockDriverObj( IN HDRVOBJ hdo ) EngLockDriverObj( IN HDRVOBJ hdo )
{ {
PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo; PDRIVEROBJ DrvObjUser = (PDRIVEROBJ)hdo;
PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER); PDRIVERGDI DrvObjInt = ObjToGDI(DrvObjUser, DRIVER);
if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock)) if (!ExTryToAcquireFastMutex(&DrvObjInt->Lock))
{ {
return NULL; return NULL;
} }
return DrvObjUser; return DrvObjUser;
} }
/* /*
* @implemented * @implemented
*/ */
BOOL BOOL
STDCALL STDCALL
EngUnlockDriverObj ( IN HDRVOBJ hdo ) EngUnlockDriverObj ( IN HDRVOBJ hdo )
{ {
PDRIVERGDI DrvObjInt = ObjToGDI((PDRIVEROBJ)hdo, DRIVER); PDRIVERGDI DrvObjInt = ObjToGDI((PDRIVEROBJ)hdo, DRIVER);
ExReleaseFastMutex(&DrvObjInt->Lock); ExReleaseFastMutex(&DrvObjInt->Lock);
return TRUE; return TRUE;
} }
/* EOF */ /* EOF */

View file

@ -291,6 +291,16 @@ UnpackParam(LPARAM lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam)
return STATUS_INVALID_PARAMETER; return STATUS_INVALID_PARAMETER;
} }
BOOL
STDCALL
NtUserCallMsgFilter(
LPMSG msg,
INT code)
{
if (HOOK_CallHooks( WH_SYSMSGFILTER, code, 0, (LPARAM)msg)) return TRUE;
return HOOK_CallHooks( WH_MSGFILTER, code, 0, (LPARAM)msg);
}
LRESULT STDCALL LRESULT STDCALL
NtUserDispatchMessage(PNTUSERDISPATCHMESSAGEINFO UnsafeMsgInfo) NtUserDispatchMessage(PNTUSERDISPATCHMESSAGEINFO UnsafeMsgInfo)

View file

@ -99,16 +99,6 @@ NtUserCallHwndParamLock(
return 0; return 0;
} }
DWORD
STDCALL
NtUserCallMsgFilter(
DWORD Unknown0,
DWORD Unknown1)
{
UNIMPLEMENTED
return 0;
}
DWORD DWORD
STDCALL STDCALL