mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 07:55:56 +00:00
sync with trunk r49322
svn path=/branches/cmake-bringup/; revision=49323
This commit is contained in:
commit
ed8cab27c4
13 changed files with 2668 additions and 2683 deletions
|
@ -1,61 +0,0 @@
|
|||
NAME CLASSPNP.SYS
|
||||
|
||||
EXPORTS
|
||||
ClassInitialize@12
|
||||
ClassInitializeEx@12
|
||||
ClassGetDescriptor@12
|
||||
ClassReadDriveCapacity@4
|
||||
ClassReleaseQueue@4
|
||||
ClassAsynchronousCompletion@12
|
||||
ClassSplitRequest@12
|
||||
ClassDeviceControl@8
|
||||
ClassIoComplete@12
|
||||
ClassIoCompleteAssociated@12
|
||||
ClassInterpretSenseInfo@28
|
||||
ClassSendDeviceIoControlSynchronous@28
|
||||
ClassSendIrpSynchronous@8
|
||||
ClassForwardIrpSynchronous@8
|
||||
ClassSendSrbSynchronous@20
|
||||
ClassSendSrbAsynchronous@24
|
||||
ClassBuildRequest@8
|
||||
ClassModeSense@16
|
||||
ClassFindModePage@16
|
||||
ClassClaimDevice@8
|
||||
ClassInternalIoControl@8
|
||||
ClassCreateDeviceObject@20
|
||||
ClassRemoveDevice@8
|
||||
ClassInitializeSrbLookasideList@8
|
||||
ClassDeleteSrbLookasideList@4
|
||||
ClassQueryTimeOutRegistryValue@4
|
||||
ClassInvalidateBusRelations@4
|
||||
ClassMarkChildrenMissing@4
|
||||
ClassMarkChildMissing@8
|
||||
ClassDebugPrint
|
||||
ClassGetDriverExtension@4
|
||||
ClassCompleteRequest@12
|
||||
ClassReleaseRemoveLock@8
|
||||
ClassAcquireRemoveLockEx@16
|
||||
ClassUpdateInformationInRegistry@20
|
||||
ClassWmiCompleteRequest@20
|
||||
ClassWmiFireEvent@20
|
||||
ClassGetVpb@4
|
||||
ClassSetFailurePredictionPoll@12
|
||||
ClassNotifyFailurePredicted@32
|
||||
ClassInitializeTestUnitPolling@8
|
||||
ClassSignalCompletion@12
|
||||
ClassSendStartUnit@4
|
||||
ClassSetMediaChangeState@12
|
||||
ClassResetMediaChangeTimer@4
|
||||
ClassCheckMediaState@4
|
||||
ClassInitializeMediaChangeDetection@8
|
||||
ClassCleanupMediaChangeDetection@4
|
||||
ClassEnableMediaChangeDetection@4
|
||||
ClassDisableMediaChangeDetection@4
|
||||
ClassSpinDownPowerHandler@8
|
||||
ClassStopUnitPowerHandler@8
|
||||
ClassAcquireChildLock@4
|
||||
ClassReleaseChildLock@4
|
||||
ClassScanForSpecial@12
|
||||
ClassSetDeviceParameter@16
|
||||
ClassGetDeviceParameter@16
|
||||
|
59
drivers/storage/classpnp/class.spec
Normal file
59
drivers/storage/classpnp/class.spec
Normal file
|
@ -0,0 +1,59 @@
|
|||
|
||||
@ stdcall ClassInitialize(ptr ptr ptr)
|
||||
@ stdcall ClassInitializeEx(ptr ptr ptr)
|
||||
@ stdcall ClassGetDescriptor(ptr ptr ptr)
|
||||
@ stdcall ClassReadDriveCapacity(ptr)
|
||||
@ stdcall ClassReleaseQueue(ptr)
|
||||
@ stdcall ClassAsynchronousCompletion(ptr ptr ptr)
|
||||
@ stdcall ClassSplitRequest(ptr ptr long)
|
||||
@ stdcall ClassDeviceControl(ptr ptr)
|
||||
@ stdcall ClassIoComplete(ptr ptr ptr)
|
||||
@ stdcall ClassIoCompleteAssociated(ptr ptr ptr)
|
||||
@ stdcall ClassInterpretSenseInfo(ptr ptr long long long ptr ptr)
|
||||
@ stdcall ClassSendDeviceIoControlSynchronous(long ptr ptr long long long ptr)
|
||||
@ stdcall ClassSendIrpSynchronous(ptr ptr)
|
||||
@ stdcall ClassForwardIrpSynchronous(ptr ptr)
|
||||
@ stdcall ClassSendSrbSynchronous(ptr ptr ptr long long)
|
||||
@ stdcall ClassSendSrbAsynchronous(ptr ptr ptr ptr long long)
|
||||
@ stdcall ClassBuildRequest(ptr ptr)
|
||||
@ stdcall ClassModeSense(ptr ptr long long)
|
||||
@ stdcall ClassFindModePage(ptr long long long)
|
||||
@ stdcall ClassClaimDevice(ptr long)
|
||||
@ stdcall ClassInternalIoControl(ptr ptr)
|
||||
@ stdcall ClassCreateDeviceObject(ptr ptr ptr long ptr)
|
||||
@ stdcall ClassRemoveDevice(ptr long)
|
||||
@ stdcall ClassInitializeSrbLookasideList(ptr long)
|
||||
@ stdcall ClassDeleteSrbLookasideList(ptr)
|
||||
@ stdcall ClassQueryTimeOutRegistryValue(ptr)
|
||||
@ stdcall ClassInvalidateBusRelations(ptr)
|
||||
@ stdcall ClassMarkChildrenMissing(ptr)
|
||||
@ stdcall ClassMarkChildMissing(ptr long)
|
||||
@ varargs ClassDebugPrint(long long)
|
||||
@ stdcall ClassGetDriverExtension(ptr)
|
||||
@ stdcall ClassCompleteRequest(ptr ptr long)
|
||||
@ stdcall ClassReleaseRemoveLock(ptr ptr)
|
||||
@ stdcall ClassAcquireRemoveLockEx(ptr ptr ptr long)
|
||||
@ stdcall ClassUpdateInformationInRegistry(ptr ptr long ptr long)
|
||||
@ stdcall ClassWmiCompleteRequest(ptr ptr long long long)
|
||||
@ stdcall ClassWmiFireEvent(ptr ptr long long ptr)
|
||||
@ stdcall ClassGetVpb(ptr)
|
||||
@ stdcall ClassSetFailurePredictionPoll(ptr long long)
|
||||
@ stdcall ClassNotifyFailurePredicted(ptr ptr long long long long long long)
|
||||
@ stdcall ClassInitializeTestUnitPolling(ptr long)
|
||||
@ stdcall ClassSignalCompletion(ptr ptr ptr)
|
||||
@ stdcall ClassSendStartUnit(ptr)
|
||||
@ stdcall ClassSetMediaChangeState(ptr long long)
|
||||
@ stdcall ClassResetMediaChangeTimer(ptr)
|
||||
@ stdcall ClassCheckMediaState(ptr)
|
||||
@ stdcall ClassInitializeMediaChangeDetection(ptr ptr)
|
||||
@ stdcall ClassCleanupMediaChangeDetection(ptr)
|
||||
@ stdcall ClassEnableMediaChangeDetection(ptr)
|
||||
@ stdcall ClassDisableMediaChangeDetection(ptr)
|
||||
@ stdcall ClassSpinDownPowerHandler(ptr ptr)
|
||||
@ stdcall ClassStopUnitPowerHandler(ptr ptr)
|
||||
@ stdcall ClassAcquireChildLock(ptr)
|
||||
@ stdcall ClassReleaseChildLock(ptr)
|
||||
@ stdcall ClassScanForSpecial(ptr ptr ptr)
|
||||
@ stdcall ClassSetDeviceParameter(ptr ptr ptr long)
|
||||
@ stdcall ClassGetDeviceParameter(ptr ptr ptr ptr)
|
||||
|
|
@ -64,6 +64,17 @@
|
|||
typedef unsigned long POINTER_64_INT;
|
||||
#endif
|
||||
|
||||
#if 0 /* Not supported yet */
|
||||
#define POINTER_SIGNED __sptr
|
||||
#define POINTER_UNSIGNED __uptr
|
||||
#else
|
||||
#define POINTER_SIGNED
|
||||
#define POINTER_UNSIGNED
|
||||
#endif
|
||||
|
||||
#define SPOINTER_32 POINTER_SIGNED POINTER_32
|
||||
#define UPOINTER_32 POINTER_UNSIGNED POINTER_32
|
||||
|
||||
#if defined(_WIN64)
|
||||
#define __int3264 __int64
|
||||
#define ADDRESS_TAG_BIT 0x40000000000UI64
|
||||
|
|
|
@ -340,7 +340,6 @@ MMixerSetGetVolumeControlDetails(
|
|||
if (Index >= VolumeData->ValuesCount)
|
||||
{
|
||||
DPRINT1("Index %u out of bounds %u \n", Index, VolumeData->ValuesCount);
|
||||
DbgBreakPoint();
|
||||
return MM_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,23 +14,23 @@ MMixerPrintTopology(
|
|||
{
|
||||
ULONG Index, SubIndex;
|
||||
|
||||
DPRINT1("Num Pins %lu NumNodes %lu\n", Topology->TopologyPinsCount, Topology->TopologyNodesCount);
|
||||
DPRINT("Num Pins %lu NumNodes %lu\n", Topology->TopologyPinsCount, Topology->TopologyNodesCount);
|
||||
|
||||
for(Index = 0; Index < Topology->TopologyPinsCount; Index++)
|
||||
{
|
||||
DPRINT1("PinId %lu NodesConnectedFromCount %lu NodesConnectedToCount %lu Visited %lu\n", Topology->TopologyPins[Index].PinId,
|
||||
DPRINT("PinId %lu NodesConnectedFromCount %lu NodesConnectedToCount %lu Visited %lu\n", Topology->TopologyPins[Index].PinId,
|
||||
Topology->TopologyPins[Index].NodesConnectedFromCount, Topology->TopologyPins[Index].NodesConnectedToCount, Topology->TopologyPins[Index].Visited);
|
||||
|
||||
for(SubIndex = 0; SubIndex < Topology->TopologyPins[Index].NodesConnectedFromCount; SubIndex++)
|
||||
DPRINT1("NodesConnectedFrom Index %lu NodeId %lu\n", SubIndex, Topology->TopologyPins[Index].NodesConnectedFrom[SubIndex]->NodeIndex);
|
||||
DPRINT("NodesConnectedFrom Index %lu NodeId %lu\n", SubIndex, Topology->TopologyPins[Index].NodesConnectedFrom[SubIndex]->NodeIndex);
|
||||
|
||||
for(SubIndex = 0; SubIndex < Topology->TopologyPins[Index].NodesConnectedToCount; SubIndex++)
|
||||
DPRINT1("NodesConnectedTo Index %lu NodeId %lu\n", SubIndex, Topology->TopologyPins[Index].NodesConnectedTo[SubIndex]->NodeIndex);
|
||||
DPRINT("NodesConnectedTo Index %lu NodeId %lu\n", SubIndex, Topology->TopologyPins[Index].NodesConnectedTo[SubIndex]->NodeIndex);
|
||||
}
|
||||
|
||||
for(Index = 0; Index < Topology->TopologyNodesCount; Index++)
|
||||
{
|
||||
DPRINT1("NodeId %lu NodesConnectedFromCount %lu NodesConnectedToCount %lu Visited %lu PinConnectedFromCount %lu PinConnectedToCount %lu\n", Topology->TopologyNodes[Index].NodeIndex,
|
||||
DPRINT("NodeId %lu NodesConnectedFromCount %lu NodesConnectedToCount %lu Visited %lu PinConnectedFromCount %lu PinConnectedToCount %lu\n", Topology->TopologyNodes[Index].NodeIndex,
|
||||
Topology->TopologyNodes[Index].NodeConnectedFromCount, Topology->TopologyNodes[Index].NodeConnectedToCount, Topology->TopologyNodes[Index].Visited,
|
||||
Topology->TopologyNodes[Index].PinConnectedFromCount, Topology->TopologyNodes[Index].PinConnectedToCount);
|
||||
}
|
||||
|
|
|
@ -1731,4 +1731,15 @@ IoStartPacket(IN PDEVICE_OBJECT DeviceObject,
|
|||
KeLowerIrql(OldIrql);
|
||||
}
|
||||
|
||||
#if defined (_WIN64)
|
||||
ULONG
|
||||
NTAPI
|
||||
IoWMIDeviceObjectToProviderId(
|
||||
IN PDEVICE_OBJECT DeviceObject)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -1816,3 +1816,14 @@ IoSetTopLevelIrp(IN PIRP Irp)
|
|||
/* Set the IRP */
|
||||
PsGetCurrentThread()->TopLevelIrp = (ULONG_PTR)Irp;
|
||||
}
|
||||
|
||||
#if defined (_WIN64)
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
IoIs32bitProcess(
|
||||
IN PIRP Irp OPTIONAL)
|
||||
{
|
||||
#pragma message IoIs32bitProcess is hardcoded to FALSE
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -571,7 +571,7 @@ MiInitMachineDependent(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
|
|||
if (KiI386PentiumLockErrataPresent)
|
||||
{
|
||||
/* Mark the 1st IDT page as Write-Through to prevent a lockup
|
||||
on a FOOF instruction.
|
||||
on a F00F instruction.
|
||||
See http://www.rcollins.org/Errata/Dec97/F00FBug.html */
|
||||
PointerPte = MiAddressToPte(KeGetPcr()->IDT);
|
||||
PointerPte->u.Hard.WriteThrough = 1;
|
||||
|
|
|
@ -77,6 +77,43 @@ MmProtectToPteMask[32] =
|
|||
PTE_EXECUTE_WRITECOPY | PTE_WRITECOMBINED_CACHE,
|
||||
};
|
||||
|
||||
const
|
||||
ULONG MmProtectToValue[32] =
|
||||
{
|
||||
PAGE_NOACCESS,
|
||||
PAGE_READONLY,
|
||||
PAGE_EXECUTE,
|
||||
PAGE_EXECUTE_READ,
|
||||
PAGE_READWRITE,
|
||||
PAGE_WRITECOPY,
|
||||
PAGE_EXECUTE_READWRITE,
|
||||
PAGE_EXECUTE_WRITECOPY,
|
||||
PAGE_NOACCESS,
|
||||
PAGE_NOCACHE | PAGE_READONLY,
|
||||
PAGE_NOCACHE | PAGE_EXECUTE,
|
||||
PAGE_NOCACHE | PAGE_EXECUTE_READ,
|
||||
PAGE_NOCACHE | PAGE_READWRITE,
|
||||
PAGE_NOCACHE | PAGE_WRITECOPY,
|
||||
PAGE_NOCACHE | PAGE_EXECUTE_READWRITE,
|
||||
PAGE_NOCACHE | PAGE_EXECUTE_WRITECOPY,
|
||||
PAGE_NOACCESS,
|
||||
PAGE_GUARD | PAGE_READONLY,
|
||||
PAGE_GUARD | PAGE_EXECUTE,
|
||||
PAGE_GUARD | PAGE_EXECUTE_READ,
|
||||
PAGE_GUARD | PAGE_READWRITE,
|
||||
PAGE_GUARD | PAGE_WRITECOPY,
|
||||
PAGE_GUARD | PAGE_EXECUTE_READWRITE,
|
||||
PAGE_GUARD | PAGE_EXECUTE_WRITECOPY,
|
||||
PAGE_NOACCESS,
|
||||
PAGE_WRITECOMBINE | PAGE_READONLY,
|
||||
PAGE_WRITECOMBINE | PAGE_EXECUTE,
|
||||
PAGE_WRITECOMBINE | PAGE_EXECUTE_READ,
|
||||
PAGE_WRITECOMBINE | PAGE_READWRITE,
|
||||
PAGE_WRITECOMBINE | PAGE_WRITECOPY,
|
||||
PAGE_WRITECOMBINE | PAGE_EXECUTE_READWRITE,
|
||||
PAGE_WRITECOMBINE | PAGE_EXECUTE_WRITECOPY
|
||||
};
|
||||
|
||||
/* PRIVATE FUNCTIONS *******************************************************/
|
||||
|
||||
BOOLEAN
|
||||
|
@ -418,8 +455,8 @@ MmDeleteVirtualMapping(
|
|||
{
|
||||
Pfn = OldPte.u.Hard.PageFrameNumber;
|
||||
|
||||
if (FreePage)
|
||||
MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
|
||||
//if (FreePage)
|
||||
//MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn);
|
||||
}
|
||||
else
|
||||
Pfn = 0;
|
||||
|
|
|
@ -454,6 +454,7 @@
|
|||
@ stdcall IoInitializeTimer(ptr ptr ptr)
|
||||
@ stdcall IoInvalidateDeviceRelations(ptr long)
|
||||
@ stdcall IoInvalidateDeviceState(ptr)
|
||||
@ stdcall -arch=x86_64 IoIs32bitProcess(ptr)
|
||||
@ stdcall IoIsFileOriginRemote(ptr)
|
||||
@ stdcall IoIsOperationSynchronous(ptr)
|
||||
@ stdcall IoIsSystemThread(ptr)
|
||||
|
@ -533,6 +534,7 @@
|
|||
@ stdcall IoVolumeDeviceToDosName(ptr ptr)
|
||||
@ stdcall IoWMIAllocateInstanceIds(ptr long ptr)
|
||||
@ stdcall IoWMIDeviceObjectToInstanceName(ptr ptr ptr)
|
||||
@ stdcall -arch=x86_64 IoWMIDeviceObjectToProviderId(ptr)
|
||||
@ stdcall IoWMIExecuteMethod(ptr ptr long long ptr ptr)
|
||||
@ stdcall IoWMIHandleToInstanceName(ptr ptr ptr)
|
||||
@ stdcall IoWMIOpenBlock(ptr long ptr)
|
||||
|
|
|
@ -941,6 +941,12 @@ W32kKeyProcessMessage(LPMSG Msg,
|
|||
VscVkTable = KeyboardLayout->pVSCtoVK_E1;
|
||||
}
|
||||
|
||||
if (!VscVkTable)
|
||||
{
|
||||
DPRINT1("somethings wrong, Prefix=0x%x", Prefix);
|
||||
return;
|
||||
}
|
||||
|
||||
RawVk = 0xff;
|
||||
while (VscVkTable->Vsc)
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* PURPOSE: Messages
|
||||
* FILE: subsys/win32k/ntuser/message.c
|
||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||
* REVISION HISTORY:
|
||||
* 06-06-2001 CSH Created
|
||||
*/
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* PURPOSE: Messages
|
||||
* FILE: subsys/win32k/ntuser/message.c
|
||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||
* REVISION HISTORY:
|
||||
* 06-06-2001 CSH Created
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
|
@ -55,7 +55,7 @@ typedef struct tagMSGMEMORY
|
|||
MSGMEMORY, *PMSGMEMORY;
|
||||
|
||||
static MSGMEMORY MsgMemory[] =
|
||||
{
|
||||
{
|
||||
{ WM_CREATE, MMS_SIZE_SPECIAL, MMS_FLAG_READWRITE },
|
||||
{ WM_DDE_ACK, sizeof(KMDDELPARAM), MMS_FLAG_READ },
|
||||
{ WM_DDE_EXECUTE, MMS_SIZE_WPARAM, MMS_FLAG_READ },
|
||||
|
@ -69,7 +69,7 @@ static MSGMEMORY MsgMemory[] =
|
|||
{ WM_COPYDATA, MMS_SIZE_SPECIAL, MMS_FLAG_READ },
|
||||
{ WM_WINDOWPOSCHANGED, sizeof(WINDOWPOS), MMS_FLAG_READ },
|
||||
{ WM_WINDOWPOSCHANGING, sizeof(WINDOWPOS), MMS_FLAG_READWRITE },
|
||||
};
|
||||
};
|
||||
|
||||
static PMSGMEMORY FASTCALL
|
||||
FindMsgMemory(UINT Msg)
|
||||
|
@ -323,11 +323,8 @@ UnpackParam(LPARAM lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL No
|
|||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
static
|
||||
VOID
|
||||
FASTCALL
|
||||
IntCallWndProc
|
||||
( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
static VOID FASTCALL
|
||||
IntCallWndProc( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
BOOL SameThread = FALSE;
|
||||
CWPSTRUCT CWP;
|
||||
|
@ -342,11 +339,8 @@ IntCallWndProc
|
|||
co_HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, SameThread, (LPARAM)&CWP );
|
||||
}
|
||||
|
||||
static
|
||||
VOID
|
||||
FASTCALL
|
||||
IntCallWndProcRet
|
||||
( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *uResult)
|
||||
static VOID FASTCALL
|
||||
IntCallWndProcRet ( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *uResult)
|
||||
{
|
||||
BOOL SameThread = FALSE;
|
||||
CWPRETSTRUCT CWPR;
|
||||
|
@ -362,8 +356,7 @@ IntCallWndProcRet
|
|||
co_HOOK_CallHooks( WH_CALLWNDPROCRET, HC_ACTION, SameThread, (LPARAM)&CWPR );
|
||||
}
|
||||
|
||||
LRESULT
|
||||
FASTCALL
|
||||
LRESULT FASTCALL
|
||||
IntDispatchMessage(PMSG pMsg)
|
||||
{
|
||||
LARGE_INTEGER TickCount;
|
||||
|
@ -517,8 +510,7 @@ co_IntSendHitTestMessages(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg)
|
|||
}
|
||||
|
||||
BOOL FASTCALL
|
||||
co_IntActivateWindowMouse(
|
||||
PUSER_MESSAGE_QUEUE ThreadQueue,
|
||||
co_IntActivateWindowMouse( PUSER_MESSAGE_QUEUE ThreadQueue,
|
||||
LPMSG Msg,
|
||||
PWND MsgWindow,
|
||||
USHORT *HitTest)
|
||||
|
@ -562,8 +554,7 @@ co_IntActivateWindowMouse(
|
|||
}
|
||||
|
||||
BOOL FASTCALL
|
||||
co_IntTranslateMouseMessage(
|
||||
PUSER_MESSAGE_QUEUE ThreadQueue,
|
||||
co_IntTranslateMouseMessage( PUSER_MESSAGE_QUEUE ThreadQueue,
|
||||
LPMSG Msg,
|
||||
USHORT *HitTest,
|
||||
BOOL Remove)
|
||||
|
@ -632,7 +623,7 @@ co_IntTranslateMouseMessage(
|
|||
}
|
||||
|
||||
if ( gspv.bMouseClickLock &&
|
||||
( (Msg->message == WM_LBUTTONUP) ||
|
||||
((Msg->message == WM_LBUTTONUP) ||
|
||||
(Msg->message == WM_LBUTTONDOWN) ) )
|
||||
{
|
||||
if (MsqIsClkLck(Msg, Remove))
|
||||
|
@ -845,8 +836,8 @@ BOOL ProcessHardwareMessage(MSG* Msg, BOOLEAN RemoveMessages)
|
|||
return TRUE;
|
||||
}
|
||||
/*
|
||||
* Internal version of PeekMessage() doing all the work
|
||||
*/
|
||||
* Internal version of PeekMessage() doing all the work
|
||||
*/
|
||||
BOOL FASTCALL
|
||||
co_IntPeekMessage( PUSER_MESSAGE Msg,
|
||||
PWND Window,
|
||||
|
@ -871,8 +862,7 @@ co_IntPeekMessage( PUSER_MESSAGE Msg,
|
|||
ThreadQueue->LastMsgRead = LargeTickCount.u.LowPart;
|
||||
|
||||
/* Dispatch sent messages here. */
|
||||
while (co_MsqDispatchOneSentMessage(ThreadQueue))
|
||||
;
|
||||
while (co_MsqDispatchOneSentMessage(ThreadQueue)) ;
|
||||
|
||||
/* Now look for a quit message. */
|
||||
|
||||
|
@ -1108,8 +1098,7 @@ co_IntGetPeekMessage( PMSG pMsg,
|
|||
PWND Window;
|
||||
USER_MESSAGE Msg;
|
||||
|
||||
if ( hWnd == HWND_TOPMOST ||
|
||||
hWnd == HWND_BROADCAST )
|
||||
if ( hWnd == HWND_TOPMOST || hWnd == HWND_BROADCAST )
|
||||
hWnd = HWND_BOTTOM;
|
||||
|
||||
/* Validate input */
|
||||
|
@ -1241,11 +1230,12 @@ UserPostMessage( HWND Wnd,
|
|||
}
|
||||
|
||||
if (!Wnd)
|
||||
{
|
||||
return UserPostThreadMessage( PtrToInt(PsGetCurrentThreadId()),
|
||||
Msg,
|
||||
wParam,
|
||||
lParam);
|
||||
|
||||
}
|
||||
if (Wnd == HWND_BROADCAST)
|
||||
{
|
||||
HWND *List;
|
||||
|
@ -1259,7 +1249,9 @@ UserPostMessage( HWND Wnd,
|
|||
{
|
||||
UserPostMessage(DesktopWindow->head.h, Msg, wParam, lParam);
|
||||
for (i = 0; List[i]; i++)
|
||||
{
|
||||
UserPostMessage(List[i], Msg, wParam, lParam);
|
||||
}
|
||||
ExFreePool(List);
|
||||
}
|
||||
}
|
||||
|
@ -1321,8 +1313,7 @@ co_IntSendMessage( HWND hWnd,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
LRESULT FASTCALL
|
||||
static LRESULT FASTCALL
|
||||
co_IntSendMessageTimeoutSingle( HWND hWnd,
|
||||
UINT Msg,
|
||||
WPARAM wParam,
|
||||
|
@ -1437,14 +1428,14 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
|
|||
|
||||
if (STATUS_TIMEOUT == Status)
|
||||
{
|
||||
/*
|
||||
MSDN says:
|
||||
/*
|
||||
MSDN says:
|
||||
Microsoft Windows 2000: If GetLastError returns zero, then the function
|
||||
timed out.
|
||||
XP+ : If the function fails or times out, the return value is zero.
|
||||
To get extended error information, call GetLastError. If GetLastError
|
||||
returns ERROR_TIMEOUT, then the function timed out.
|
||||
*/
|
||||
*/
|
||||
SetLastWin32Error(ERROR_TIMEOUT);
|
||||
RETURN( FALSE);
|
||||
}
|
||||
|
@ -1505,7 +1496,8 @@ co_IntSendMessageTimeout( HWND hWnd,
|
|||
return (LRESULT) TRUE;
|
||||
}
|
||||
|
||||
LRESULT FASTCALL co_IntSendMessageNoWait(HWND hWnd,
|
||||
LRESULT FASTCALL
|
||||
co_IntSendMessageNoWait(HWND hWnd,
|
||||
UINT Msg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
|
@ -1647,8 +1639,8 @@ CLEANUP:
|
|||
}
|
||||
|
||||
/* This function posts a message if the destination's message queue belongs to
|
||||
another thread, otherwise it sends the message. It does not support broadcast
|
||||
messages! */
|
||||
another thread, otherwise it sends the message. It does not support broadcast
|
||||
messages! */
|
||||
LRESULT FASTCALL
|
||||
co_IntPostOrSendMessage( HWND hWnd,
|
||||
UINT Msg,
|
||||
|
@ -1739,8 +1731,7 @@ co_IntDoSendMessage( HWND hWnd,
|
|||
/* Gather the information usermode needs to call the window proc directly */
|
||||
Info.HandledByKernel = FALSE;
|
||||
|
||||
Status = MmCopyFromCaller(&(Info.Ansi), &(UnsafeInfo->Ansi),
|
||||
sizeof(BOOL));
|
||||
Status = MmCopyFromCaller(&(Info.Ansi), &(UnsafeInfo->Ansi), sizeof(BOOL));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
Info.Ansi = ! Window->Unicode;
|
||||
|
@ -1752,10 +1743,10 @@ co_IntDoSendMessage( HWND hWnd,
|
|||
else
|
||||
{
|
||||
/* Must be handled by other thread */
|
||||
// if (HWND_BROADCAST != hWnd)
|
||||
// {
|
||||
// UserDereferenceObject(Window);
|
||||
// }
|
||||
// if (HWND_BROADCAST != hWnd)
|
||||
// {
|
||||
// UserDereferenceObject(Window);
|
||||
// }
|
||||
Info.HandledByKernel = TRUE;
|
||||
UserModeMsg.hwnd = hWnd;
|
||||
UserModeMsg.message = Msg;
|
||||
|
@ -2059,15 +2050,15 @@ NtUserGetMessage( PNTUSERGETMESSAGEINFO UnsafeInfo,
|
|||
UINT MsgFilterMin,
|
||||
UINT MsgFilterMax )
|
||||
/*
|
||||
* FUNCTION: Get a message from the calling thread's message queue.
|
||||
* ARGUMENTS:
|
||||
* UnsafeMsg - Pointer to the structure which receives the returned message.
|
||||
* Wnd - Window whose messages are to be retrieved.
|
||||
* MsgFilterMin - Integer value of the lowest message value to be
|
||||
* retrieved.
|
||||
* MsgFilterMax - Integer value of the highest message value to be
|
||||
* retrieved.
|
||||
*/
|
||||
* FUNCTION: Get a message from the calling thread's message queue.
|
||||
* ARGUMENTS:
|
||||
* UnsafeMsg - Pointer to the structure which receives the returned message.
|
||||
* Wnd - Window whose messages are to be retrieved.
|
||||
* MsgFilterMin - Integer value of the lowest message value to be
|
||||
* retrieved.
|
||||
* MsgFilterMax - Integer value of the highest message value to be
|
||||
* retrieved.
|
||||
*/
|
||||
{
|
||||
BOOL GotMessage;
|
||||
NTUSERGETMESSAGEINFO Info;
|
||||
|
@ -2079,7 +2070,7 @@ NtUserGetMessage( PNTUSERGETMESSAGEINFO UnsafeInfo,
|
|||
UINT Size;
|
||||
USER_MESSAGE Msg;
|
||||
DECLARE_RETURN(BOOL);
|
||||
// USER_REFERENCE_ENTRY Ref;
|
||||
// USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserGetMessage\n");
|
||||
UserEnterExclusive();
|
||||
|
@ -2090,7 +2081,7 @@ NtUserGetMessage( PNTUSERGETMESSAGEINFO UnsafeInfo,
|
|||
RETURN(-1);
|
||||
}
|
||||
|
||||
// if (Window) UserRefObjectCo(Window, &Ref);
|
||||
// if (Window) UserRefObjectCo(Window, &Ref);
|
||||
|
||||
if (MsgFilterMax < MsgFilterMin)
|
||||
{
|
||||
|
@ -2155,7 +2146,7 @@ NtUserGetMessage( PNTUSERGETMESSAGEINFO UnsafeInfo,
|
|||
RETURN( WM_QUIT != Info.Msg.message);
|
||||
|
||||
CLEANUP:
|
||||
// if (Window) UserDerefObjectCo(Window);
|
||||
// if (Window) UserDerefObjectCo(Window);
|
||||
|
||||
DPRINT("Leave NtUserGetMessage\n");
|
||||
UserLeave();
|
||||
|
@ -2163,10 +2154,8 @@ CLEANUP:
|
|||
}
|
||||
|
||||
|
||||
BOOL
|
||||
APIENTRY
|
||||
NtUserGetMessageX(
|
||||
PMSG pMsg,
|
||||
BOOL APIENTRY
|
||||
NtUserGetMessageX(PMSG pMsg,
|
||||
HWND hWnd,
|
||||
UINT MsgFilterMin,
|
||||
UINT MsgFilterMax)
|
||||
|
@ -2306,10 +2295,8 @@ CLEANUP:
|
|||
END_CLEANUP;
|
||||
}
|
||||
|
||||
BOOL
|
||||
APIENTRY
|
||||
NtUserPeekMessageX(
|
||||
PMSG pMsg,
|
||||
BOOL APIENTRY
|
||||
NtUserPeekMessageX( PMSG pMsg,
|
||||
HWND hWnd,
|
||||
UINT MsgFilterMin,
|
||||
UINT MsgFilterMax,
|
||||
|
@ -2354,11 +2341,8 @@ CLEANUP:
|
|||
END_CLEANUP;
|
||||
}
|
||||
|
||||
BOOL
|
||||
APIENTRY
|
||||
NtUserCallMsgFilter(
|
||||
LPMSG lpmsg,
|
||||
INT code)
|
||||
BOOL APIENTRY
|
||||
NtUserCallMsgFilter( LPMSG lpmsg, INT code)
|
||||
{
|
||||
BOOL BadChk = FALSE, Ret = FALSE;
|
||||
MSG Msg;
|
||||
|
@ -2370,12 +2354,8 @@ NtUserCallMsgFilter(
|
|||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForRead((PVOID)lpmsg,
|
||||
sizeof(MSG),
|
||||
1);
|
||||
RtlCopyMemory( &Msg,
|
||||
(PVOID)lpmsg,
|
||||
sizeof(MSG));
|
||||
ProbeForRead(lpmsg, sizeof(MSG), 1);
|
||||
RtlCopyMemory( &Msg, lpmsg, sizeof(MSG));
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
@ -2399,12 +2379,8 @@ NtUserCallMsgFilter(
|
|||
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite((PVOID)lpmsg,
|
||||
sizeof(MSG),
|
||||
1);
|
||||
RtlCopyMemory((PVOID)lpmsg,
|
||||
&Msg,
|
||||
sizeof(MSG));
|
||||
ProbeForWrite(lpmsg, sizeof(MSG), 1);
|
||||
RtlCopyMemory(lpmsg, &Msg, sizeof(MSG));
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
@ -2448,8 +2424,7 @@ NtUserDispatchMessage(PMSG UnsafeMsgInfo)
|
|||
|
||||
|
||||
BOOL APIENTRY
|
||||
NtUserTranslateMessage(LPMSG lpMsg,
|
||||
UINT flags)
|
||||
NtUserTranslateMessage(LPMSG lpMsg, UINT flags)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
MSG SafeMsg;
|
||||
|
@ -2474,8 +2449,7 @@ CLEANUP:
|
|||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
NtUserMessageCall(
|
||||
HWND hWnd,
|
||||
NtUserMessageCall( HWND hWnd,
|
||||
UINT Msg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam,
|
||||
|
@ -2492,18 +2466,23 @@ NtUserMessageCall(
|
|||
UserEnterExclusive();
|
||||
|
||||
/* Validate input */
|
||||
if (hWnd && (hWnd != INVALID_HANDLE_VALUE) && !(Window = UserGetWindowObject(hWnd)))
|
||||
if (hWnd && (hWnd != INVALID_HANDLE_VALUE))
|
||||
{
|
||||
Window = UserGetWindowObject(hWnd);
|
||||
if (!Window)
|
||||
{
|
||||
UserLeave();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
switch(dwType)
|
||||
{
|
||||
case FNID_DEFWINDOWPROC:
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
if (Window) UserRefObjectCo(Window, &Ref);
|
||||
lResult = IntDefWindowProc(Window, Msg, wParam, lParam, Ansi);
|
||||
Ret = TRUE;
|
||||
UserDerefObjectCo(Window);
|
||||
if (Window) UserDerefObjectCo(Window);
|
||||
break;
|
||||
case FNID_SENDNOTIFYMESSAGE:
|
||||
Ret = UserSendNotifyMessage(hWnd, Msg, wParam, lParam);
|
||||
|
@ -2517,9 +2496,7 @@ NtUserMessageCall(
|
|||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite((PVOID)ResultInfo,
|
||||
sizeof(BROADCASTPARM),
|
||||
1);
|
||||
ProbeForWrite((PVOID)ResultInfo, sizeof(BROADCASTPARM), 1);
|
||||
RtlCopyMemory(&parm, (PVOID)ResultInfo, sizeof(BROADCASTPARM));
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
|
@ -2699,8 +2676,7 @@ NtUserMessageCall(
|
|||
|
||||
DWORD
|
||||
APIENTRY
|
||||
NtUserWaitForInputIdle(
|
||||
IN HANDLE hProcess,
|
||||
NtUserWaitForInputIdle( IN HANDLE hProcess,
|
||||
IN DWORD dwMilliseconds,
|
||||
IN BOOL Unknown2)
|
||||
{
|
||||
|
|
|
@ -1,21 +1,4 @@
|
|||
/*
|
||||
* ReactOS W32 Subsystem
|
||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 ReactOS Team
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* PURPOSE: Monitor support
|
||||
|
@ -64,16 +47,6 @@ CleanupMonitorImpl()
|
|||
|
||||
/* PRIVATE FUNCTIONS **********************************************************/
|
||||
|
||||
#ifndef MIN
|
||||
# define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MAX
|
||||
# define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef ABS
|
||||
# define ABS(a) ((a) < (0) ? (-(a)) : (a))
|
||||
#endif
|
||||
|
||||
/* IntCreateMonitorObject
|
||||
*
|
||||
* Creates a MONITOR
|
||||
|
@ -130,7 +103,6 @@ UserGetMonitorObject(IN HMONITOR hMonitor)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Monitor = (PMONITOR)UserGetObject(gHandleTable, hMonitor, otMonitor);
|
||||
if (!Monitor)
|
||||
{
|
||||
|
@ -336,9 +308,9 @@ IntGetMonitorsFromRect(OPTIONAL IN LPCRECTL pRect,
|
|||
{
|
||||
PMONITOR Monitor, NearestMonitor = NULL, PrimaryMonitor = NULL;
|
||||
UINT iCount = 0;
|
||||
LONG iNearestDistanceX = 0x7fffffff, iNearestDistanceY = 0x7fffffff;
|
||||
ULONG iNearestDistance = 0xffffffff;
|
||||
|
||||
/* find monitors which intersect the rectangle */
|
||||
/* Find monitors which intersect the rectangle */
|
||||
for (Monitor = gMonitorList; Monitor != NULL; Monitor = Monitor->Next)
|
||||
{
|
||||
RECTL MonitorRect, IntersectionRect;
|
||||
|
@ -355,49 +327,42 @@ IntGetMonitorsFromRect(OPTIONAL IN LPCRECTL pRect,
|
|||
PrimaryMonitor = Monitor;
|
||||
}
|
||||
|
||||
if (pRect != NULL)
|
||||
/* Check if a rect is given */
|
||||
if (pRect == NULL)
|
||||
{
|
||||
BOOL intersects = TRUE;
|
||||
|
||||
/* check if the rect intersects the monitor */
|
||||
if ((pRect->right < MonitorRect.left) || (pRect->left > MonitorRect.right) ||
|
||||
(pRect->bottom < MonitorRect.top) || (pRect->top > MonitorRect.bottom))
|
||||
{
|
||||
intersects = FALSE;
|
||||
/* No rect given, so use the full monitor rect */
|
||||
IntersectionRect = MonitorRect;
|
||||
}
|
||||
|
||||
if (flags == MONITOR_DEFAULTTONEAREST && !intersects)
|
||||
/* We have a rect, calculate intersection */
|
||||
else if (!RECTL_bIntersectRect(&IntersectionRect, &MonitorRect, pRect))
|
||||
{
|
||||
INT distanceX, distanceY;
|
||||
|
||||
distanceX = MIN(ABS(MonitorRect.left - pRect->right),
|
||||
ABS(pRect->left - MonitorRect.right));
|
||||
distanceY = MIN(ABS(MonitorRect.top - pRect->bottom),
|
||||
ABS(pRect->top - MonitorRect.bottom));
|
||||
|
||||
if (((distanceX < iNearestDistanceX) && (distanceY <= iNearestDistanceY)) ||
|
||||
((distanceX <= iNearestDistanceX) && (distanceY < iNearestDistanceY)))
|
||||
/* Rects did not intersect */
|
||||
if (flags == MONITOR_DEFAULTTONEAREST)
|
||||
{
|
||||
iNearestDistanceX = distanceX;
|
||||
iNearestDistanceY = distanceY;
|
||||
ULONG cx, cy, iDistance;
|
||||
|
||||
/* Get x and y distance */
|
||||
cx = min(abs(MonitorRect.left - pRect->right),
|
||||
abs(pRect->left - MonitorRect.right));
|
||||
cy = min(abs(MonitorRect.top - pRect->bottom),
|
||||
abs(pRect->top - MonitorRect.bottom));
|
||||
|
||||
/* Calculate distance square */
|
||||
iDistance = cx * cx + cy * cy;
|
||||
|
||||
/* Check if this is the new nearest monitor */
|
||||
if (iDistance < iNearestDistance)
|
||||
{
|
||||
iNearestDistance = iDistance;
|
||||
NearestMonitor = Monitor;
|
||||
}
|
||||
}
|
||||
|
||||
if (!intersects)
|
||||
continue;
|
||||
|
||||
/* calculate intersection */
|
||||
IntersectionRect.left = MAX(MonitorRect.left, pRect->left);
|
||||
IntersectionRect.top = MAX(MonitorRect.top, pRect->top);
|
||||
IntersectionRect.right = MIN(MonitorRect.right, pRect->right);
|
||||
IntersectionRect.bottom = MIN(MonitorRect.bottom, pRect->bottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
IntersectionRect = MonitorRect;
|
||||
}
|
||||
|
||||
/* Check if there's space in the buffer */
|
||||
if (iCount < listSize)
|
||||
{
|
||||
if (hMonitorList != NULL)
|
||||
|
@ -405,27 +370,30 @@ IntGetMonitorsFromRect(OPTIONAL IN LPCRECTL pRect,
|
|||
if (monitorRectList != NULL)
|
||||
monitorRectList[iCount] = IntersectionRect;
|
||||
}
|
||||
|
||||
/* Increase count of found monitors */
|
||||
iCount++;
|
||||
}
|
||||
|
||||
if (iCount == 0 && flags == MONITOR_DEFAULTTONEAREST)
|
||||
/* Found nothing intersecting? */
|
||||
if (iCount == 0)
|
||||
{
|
||||
if (iCount < listSize)
|
||||
/* Check if we shall default to the nearest monitor */
|
||||
if (flags == MONITOR_DEFAULTTONEAREST && NearestMonitor)
|
||||
{
|
||||
if (hMonitorList != NULL)
|
||||
if (hMonitorList && listSize > 0)
|
||||
hMonitorList[iCount] = UserHMGetHandle(NearestMonitor);
|
||||
}
|
||||
iCount++;
|
||||
}
|
||||
else if (iCount == 0 && flags == MONITOR_DEFAULTTOPRIMARY)
|
||||
/* Check if we shall default to the primary monitor */
|
||||
else if (flags == MONITOR_DEFAULTTOPRIMARY && PrimaryMonitor)
|
||||
{
|
||||
if (iCount < listSize)
|
||||
{
|
||||
if (hMonitorList != NULL)
|
||||
if (hMonitorList != NULL && listSize > 0)
|
||||
hMonitorList[iCount] = UserHMGetHandle(PrimaryMonitor);
|
||||
}
|
||||
iCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return iCount;
|
||||
}
|
||||
|
||||
|
@ -513,7 +481,8 @@ NtUserEnumDisplayMonitors(
|
|||
if (regionType == NULLREGION)
|
||||
return 0;
|
||||
if (regionType == COMPLEXREGION)
|
||||
{ /* TODO: warning */
|
||||
{
|
||||
/* TODO: warning */
|
||||
}
|
||||
|
||||
/* if hDC and pRect are given the area of interest is pRect with
|
||||
|
@ -736,34 +705,19 @@ NtUserMonitorFromPoint(
|
|||
RECTL InRect;
|
||||
HMONITOR hMonitor = NULL;
|
||||
|
||||
/* fill inRect */
|
||||
InRect.left = InRect.right = point.x;
|
||||
InRect.top = InRect.bottom = point.y;
|
||||
/* fill inRect (bottom-right exclusive) */
|
||||
InRect.left = point.x;
|
||||
InRect.right = point.x + 1;
|
||||
InRect.top = point.y;
|
||||
InRect.bottom = point.y + 1;
|
||||
|
||||
/* find intersecting monitor */
|
||||
NumMonitors = IntGetMonitorsFromRect(&InRect, &hMonitor, NULL, 1, 0);
|
||||
NumMonitors = IntGetMonitorsFromRect(&InRect, &hMonitor, NULL, 1, dwFlags);
|
||||
if (NumMonitors < 0)
|
||||
{
|
||||
return (HMONITOR)NULL;
|
||||
}
|
||||
|
||||
if (hMonitor == NULL)
|
||||
{
|
||||
if (dwFlags == MONITOR_DEFAULTTOPRIMARY)
|
||||
{
|
||||
PMONITOR MonitorObj = IntGetPrimaryMonitor();
|
||||
if (MonitorObj)
|
||||
hMonitor = UserHMGetHandle(MonitorObj);
|
||||
}
|
||||
else if (dwFlags == MONITOR_DEFAULTTONEAREST)
|
||||
{
|
||||
NumMonitors = IntGetMonitorsFromRect(&InRect, &hMonitor, NULL,
|
||||
1, MONITOR_DEFAULTTONEAREST);
|
||||
/*ASSERT( (numMonitors > 0) && (hMonitor != NULL) );*/
|
||||
}
|
||||
/* else flag is DEFAULTTONULL */
|
||||
}
|
||||
|
||||
return hMonitor;
|
||||
}
|
||||
|
||||
|
@ -790,7 +744,7 @@ NtUserMonitorFromRect(
|
|||
IN LPCRECTL pRect,
|
||||
IN DWORD dwFlags)
|
||||
{
|
||||
INT numMonitors, iLargestArea = -1, i;
|
||||
ULONG numMonitors, iLargestArea = 0, i;
|
||||
PRECTL rectList;
|
||||
HMONITOR *hMonitorList;
|
||||
HMONITOR hMonitor = NULL;
|
||||
|
@ -806,44 +760,24 @@ NtUserMonitorFromRect(
|
|||
}
|
||||
|
||||
/* find intersecting monitors */
|
||||
numMonitors = IntGetMonitorsFromRect(&rect, NULL, NULL, 0, 0);
|
||||
if (numMonitors < 0)
|
||||
numMonitors = IntGetMonitorsFromRect(&rect, &hMonitor, NULL, 1, dwFlags);
|
||||
if (numMonitors <= 1)
|
||||
{
|
||||
return (HMONITOR)NULL;
|
||||
}
|
||||
|
||||
if (numMonitors == 0)
|
||||
{
|
||||
if (dwFlags == MONITOR_DEFAULTTOPRIMARY)
|
||||
{
|
||||
PMONITOR monitorObj = IntGetPrimaryMonitor();
|
||||
if (monitorObj)
|
||||
return UserHMGetHandle(monitorObj);
|
||||
}
|
||||
else if (dwFlags == MONITOR_DEFAULTTONEAREST)
|
||||
{
|
||||
numMonitors = IntGetMonitorsFromRect(&rect, &hMonitor, NULL,
|
||||
1, MONITOR_DEFAULTTONEAREST);
|
||||
if (numMonitors <= 0)
|
||||
{
|
||||
/* error? */
|
||||
return (HMONITOR)NULL;
|
||||
}
|
||||
|
||||
if (numMonitors > 0)
|
||||
return hMonitor;
|
||||
}
|
||||
/* else flag is DEFAULTTONULL */
|
||||
return (HMONITOR)NULL;
|
||||
}
|
||||
|
||||
hMonitorList = ExAllocatePoolWithTag(PagedPool, sizeof (HMONITOR) * numMonitors, USERTAG_MONITORRECTS);
|
||||
hMonitorList = ExAllocatePoolWithTag(PagedPool,
|
||||
sizeof(HMONITOR) * numMonitors,
|
||||
USERTAG_MONITORRECTS);
|
||||
if (hMonitorList == NULL)
|
||||
{
|
||||
/* FIXME: SetLastWin32Error? */
|
||||
return (HMONITOR)NULL;
|
||||
}
|
||||
rectList = ExAllocatePoolWithTag(PagedPool, sizeof (RECT) * numMonitors, USERTAG_MONITORRECTS);
|
||||
|
||||
rectList = ExAllocatePoolWithTag(PagedPool,
|
||||
sizeof(RECT) * numMonitors,
|
||||
USERTAG_MONITORRECTS);
|
||||
if (rectList == NULL)
|
||||
{
|
||||
ExFreePoolWithTag(hMonitorList, USERTAG_MONITORRECTS);
|
||||
|
@ -854,7 +788,7 @@ NtUserMonitorFromRect(
|
|||
/* get intersecting monitors */
|
||||
numMonitors = IntGetMonitorsFromRect(&rect, hMonitorList, rectList,
|
||||
numMonitors, 0);
|
||||
if (numMonitors <= 0)
|
||||
if (numMonitors == 0)
|
||||
{
|
||||
ExFreePoolWithTag(hMonitorList, USERTAG_MONITORRECTS);
|
||||
ExFreePoolWithTag(rectList, USERTAG_MONITORRECTS);
|
||||
|
@ -864,9 +798,9 @@ NtUserMonitorFromRect(
|
|||
/* find largest intersection */
|
||||
for (i = 0; i < numMonitors; i++)
|
||||
{
|
||||
INT area = (rectList[i].right - rectList[i].left) *
|
||||
ULONG area = (rectList[i].right - rectList[i].left) *
|
||||
(rectList[i].bottom - rectList[i].top);
|
||||
if (area > iLargestArea)
|
||||
if (area >= iLargestArea)
|
||||
{
|
||||
hMonitor = hMonitorList[i];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue