if (!hMonitor)
{
- SetLastWin32Error(ERROR_INVALID_MONITOR_HANDLE);
+ EngSetLastError(ERROR_INVALID_MONITOR_HANDLE);
return NULL;
}
Monitor = (PMONITOR)UserGetObject(gHandleTable, hMonitor, otMonitor);
if (!Monitor)
{
- SetLastWin32Error(ERROR_INVALID_MONITOR_HANDLE);
+ EngSetLastError(ERROR_INVALID_MONITOR_HANDLE);
return NULL;
}
return STATUS_SUCCESS;
}
+/* IntResetMonitorSize
+ *
+ * Reset size of the monitor using atached device
+ *
+ * Arguments
+ *
+ * PMONITOR
+ * pGdiDevice Pointer to the PDEVOBJ, which size has changed
+ *
+ * Return value
+ * Returns a NTSTATUS
+ */
+NTSTATUS
+IntResetMonitorSize(IN PDEVOBJ *pGdiDevice)
+{
+ PMONITOR Monitor;
+
+ for (Monitor = gMonitorList; Monitor != NULL; Monitor = Monitor->Next)
+ {
+ if (Monitor->GdiDevice == pGdiDevice)
+ break;
+ }
+
+ if (Monitor == NULL)
+ {
+ /* no monitor for given device found */
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ Monitor->rcMonitor.left = 0;
+ Monitor->rcMonitor.top = 0;
+ Monitor->rcMonitor.right = Monitor->rcMonitor.left + Monitor->GdiDevice->gdiinfo.ulHorzRes;
+ Monitor->rcMonitor.bottom = Monitor->rcMonitor.top + Monitor->GdiDevice->gdiinfo.ulVertRes;
+ Monitor->rcWork = Monitor->rcMonitor;
+
+ if (Monitor->hrgnMonitor)
+ {
+ GDIOBJ_SetOwnership(Monitor->hrgnMonitor, PsGetCurrentProcess());
+ REGION_FreeRgnByHandle(Monitor->hrgnMonitor);
+ }
+
+ Monitor->hrgnMonitor = IntSysCreateRectRgnIndirect( &Monitor->rcMonitor );
+
+ IntGdiSetRegionOwner(Monitor->hrgnMonitor, GDI_OBJ_HMGR_PUBLIC);
+
+ return STATUS_SUCCESS;
+}
+
/* IntGetPrimaryMonitor
*
* Returns a PMONITOR for the primary monitor
safeHMonitorList = ExAllocatePoolWithTag(PagedPool, sizeof (HMONITOR) * listSize, USERTAG_MONITORRECTS);
if (safeHMonitorList == NULL)
{
- /* FIXME: SetLastWin32Error? */
+ /* FIXME: EngSetLastError? */
return -1;
}
}
if (safeRectList == NULL)
{
ExFreePoolWithTag(safeHMonitorList, USERTAG_MONITORRECTS);
- /* FIXME: SetLastWin32Error? */
+ /* FIXME: EngSetLastError? */
return -1;
}
}
USERTAG_MONITORRECTS);
if (hMonitorList == NULL)
{
- /* FIXME: SetLastWin32Error? */
+ /* FIXME: EngSetLastError? */
return (HMONITOR)NULL;
}
if (rectList == NULL)
{
ExFreePoolWithTag(hMonitorList, USERTAG_MONITORRECTS);
- /* FIXME: SetLastWin32Error? */
+ /* FIXME: EngSetLastError? */
return (HMONITOR)NULL;
}