ReactOS 0.4.16-dev-1946-g52006dd
monitor.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _MONITOR
 

Typedefs

typedef struct _MONITOR MONITOR
 
typedef struct _MONITORPMONITOR
 

Functions

NTSTATUS NTAPI UserAttachMonitor (IN HDEV hDev)
 
NTSTATUS NTAPI UserDetachMonitor (HDEV hDev)
 
NTSTATUS NTAPI UserUpdateMonitorSize (IN HDEV hDev)
 
PMONITOR NTAPI UserGetMonitorObject (IN HMONITOR)
 
PMONITOR NTAPI UserGetPrimaryMonitor (VOID)
 
PMONITOR NTAPI UserMonitorFromRect (PRECTL, DWORD)
 
PMONITOR FASTCALL UserMonitorFromPoint (POINT, DWORD)
 

Typedef Documentation

◆ MONITOR

◆ PMONITOR

Function Documentation

◆ UserAttachMonitor()

NTSTATUS NTAPI UserAttachMonitor ( IN HDEV  hDev)

Definition at line 129 of file monitor.c.

130{
131 PMONITOR pMonitor;
132
133 TRACE("Attaching monitor...\n");
134
135 /* Create new monitor object */
136 pMonitor = IntCreateMonitorObject();
137 if (pMonitor == NULL)
138 {
139 TRACE("Couldnt create monitor object\n");
141 }
142
143 pMonitor->hDev = hDev;
144 pMonitor->cWndStack = 0;
145
146 if (gMonitorList == NULL)
147 {
148 TRACE("Primary monitor is beeing attached\n");
149 pMonitor->IsPrimary = TRUE;
150 gMonitorList = pMonitor;
151 }
152 else
153 {
154 PMONITOR pmonLast = gMonitorList;
155 TRACE("Additional monitor is beeing attached\n");
156 while (pmonLast->pMonitorNext != NULL)
157 pmonLast = pmonLast->pMonitorNext;
158
159 pmonLast->pMonitorNext = pMonitor;
160 }
161
163
164 return STATUS_SUCCESS;
165}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE(s)
Definition: solgame.cpp:4
SHORT cWndStack
Definition: monitor.h:22
HDEV hDev
Definition: monitor.h:23
DWORD IsPrimary
Definition: monitor.h:15
struct _MONITOR * pMonitorNext
Definition: monitor.h:7
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
static PMONITOR gMonitorList
Definition: monitor.c:19
static PMONITOR IntCreateMonitorObject(VOID)
Definition: monitor.c:33
NTSTATUS NTAPI UserUpdateMonitorSize(IN HDEV hDev)
Definition: monitor.c:225

Referenced by co_IntInitializeDesktopGraphics().

◆ UserDetachMonitor()

NTSTATUS NTAPI UserDetachMonitor ( HDEV  hDev)

◆ UserGetMonitorObject()

PMONITOR NTAPI UserGetMonitorObject ( IN  HMONITOR)

Definition at line 74 of file monitor.c.

75{
76 PMONITOR pMonitor;
77
78 if (!hMonitor)
79 {
81 return NULL;
82 }
83
84 pMonitor = (PMONITOR)UserGetObject(gHandleTable, hMonitor, TYPE_MONITOR);
85 if (!pMonitor)
86 {
88 return NULL;
89 }
90
91 return pMonitor;
92}
@ TYPE_MONITOR
Definition: ntuser.h:52
struct _MONITOR * PMONITOR
PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
Definition: object.c:495
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22
#define ERROR_INVALID_MONITOR_HANDLE
Definition: winerror.h:1287

Referenced by InitThreadCallback(), IntFixWindowCoordinates(), NtUserGetMonitorInfo(), UserMonitorFromPoint(), and UserMonitorFromRect().

◆ UserGetPrimaryMonitor()

PMONITOR NTAPI UserGetPrimaryMonitor ( VOID  )

Definition at line 102 of file monitor.c.

103{
104 PMONITOR pMonitor;
105
106 /* Find primary monitor */
107 for (pMonitor = gMonitorList; pMonitor != NULL; pMonitor = pMonitor->pMonitorNext)
108 {
109 if (pMonitor->IsPrimary)
110 break;
111 }
112
113 return pMonitor;
114}

Referenced by co_UserExcludeUpdateRgn(), co_WinPosGetMinMaxInfo(), IntFixWindowCoordinates(), IntIsWindowFullscreen(), SpiGetSet(), and UserGetDesktopDC().

◆ UserMonitorFromPoint()

PMONITOR FASTCALL UserMonitorFromPoint ( POINT  ,
DWORD   
)

◆ UserMonitorFromRect()

PMONITOR NTAPI UserMonitorFromRect ( PRECTL  pRect,
DWORD  dwFlags 
)

Definition at line 469 of file monitor.c.

472{
473 HMONITOR hMonitor;
474
475 /* Check if flags are valid */
476 if (dwFlags != MONITOR_DEFAULTTONULL &&
477 dwFlags != MONITOR_DEFAULTTOPRIMARY &&
478 dwFlags != MONITOR_DEFAULTTONEAREST)
479 {
481 return NULL;
482 }
483
484 hMonitor = IntGetMonitorFromRect(pRect, dwFlags);
485 return UserGetMonitorObject(hMonitor);
486}
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
PMONITOR NTAPI UserGetMonitorObject(IN HMONITOR hMonitor)
Definition: monitor.c:74
HMONITOR FASTCALL IntGetMonitorFromRect(_In_ LPCRECTL pRect, _In_ DWORD dwFlags)
Definition: monitor.c:405
#define ERROR_INVALID_FLAGS
Definition: winerror.h:907

Referenced by IntGetWindowPlacement(), make_rect_onscreen(), SpiGetSet(), and WinPosInitInternalPos().

◆ UserUpdateMonitorSize()

NTSTATUS NTAPI UserUpdateMonitorSize ( IN HDEV  hDev)

Definition at line 225 of file monitor.c.

226{
227 PMONITOR pMonitor;
228 SIZEL DeviceSize;
229
230 /* Find monitor attached to given device */
231 for (pMonitor = gMonitorList; pMonitor != NULL; pMonitor = pMonitor->pMonitorNext)
232 {
233 if (pMonitor->hDev == hDev)
234 break;
235 }
236
237 if (pMonitor == NULL)
238 {
239 /* No monitor has been found */
241 }
242
243 /* Get the size of the hdev */
244 PDEVOBJ_sizl((PPDEVOBJ)hDev, &DeviceSize);
245
246 /* Update monitor size */
247 pMonitor->rcMonitor.left = 0;
248 pMonitor->rcMonitor.top = 0;
249 pMonitor->rcMonitor.right = pMonitor->rcMonitor.left + DeviceSize.cx;
250 pMonitor->rcMonitor.bottom = pMonitor->rcMonitor.top + DeviceSize.cy;
251 pMonitor->rcWork = pMonitor->rcMonitor;
252
253 /* Destroy monitor region... */
254 if (pMonitor->hrgnMonitor)
255 {
257 GreDeleteObject(pMonitor->hrgnMonitor);
258 }
259
260 /* ...and create new one */
262 pMonitor->rcMonitor.left,
263 pMonitor->rcMonitor.top,
264 pMonitor->rcMonitor.right,
265 pMonitor->rcMonitor.bottom);
266 if (pMonitor->hrgnMonitor)
268
269 //
270 // Should be Virtual accumulation of all the available monitors.
271 //
272 gpsi->rcScreenReal = pMonitor->rcMonitor;
273
274 return STATUS_SUCCESS;
275}
PSERVERINFO gpsi
Definition: imm.c:18
__kernel_entry W32KAPI HRGN APIENTRY NtGdiCreateRectRgn(_In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
#define GDI_OBJ_HMGR_POWNED
Definition: ntgdihdl.h:117
#define GDI_OBJ_HMGR_PUBLIC
Definition: ntgdihdl.h:116
PSIZEL FASTCALL PDEVOBJ_sizl(PPDEVOBJ ppdev, PSIZEL psizl)
Definition: pdevobj.c:1375
RECT rcWork
Definition: monitor.h:19
RECT rcMonitor
Definition: monitor.h:18
HRGN hrgnMonitor
Definition: monitor.h:20
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
LONG right
Definition: windef.h:102
LONG bottom
Definition: windef.h:103
LONG top
Definition: windef.h:101
LONG left
Definition: windef.h:100
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
BOOL NTAPI GreSetObjectOwner(HGDIOBJ hobj, ULONG ulOwner)
Definition: gdiobj.c:1268
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1165
BOOL FASTCALL IntGdiSetRegionOwner(HRGN hRgn, DWORD OwnerMask)
Definition: region.c:2459

Referenced by co_IntInitializeDesktopGraphics(), UserAttachMonitor(), and UserChangeDisplaySettings().