PWND DesktopObject = 0;
HDC DesktopHDC = 0;
+ UserEnterExclusive();
+
if (DcType == DC_TYPE_DIRECT)
{
DesktopObject = UserGetDesktopWindow();
DesktopHDC = IntGdiCreateDisplayDC(pMonitor->hDev, DcType, EmptyDC);
}
+ UserLeave();
+
return DesktopHDC;
}
{
ERR("Failed to open desktop\n");
SetLastNtError(Status);
- return 0;
+ return NULL;
}
TRACE("Opened desktop %S with handle 0x%p\n", ObjectAttributes->ObjectName->Buffer, Desktop);
IN BOOL FreeOnFailure)
{
PDESKTOP pdesk = NULL, pdeskOld;
- HDESK hdeskOld;
PTHREADINFO pti;
NTSTATUS Status;
PCLIENTTHREADINFO pctiOld, pctiNew = NULL;
}
pdeskOld = pti->rpdesk;
- hdeskOld = pti->hdesk;
if (pti->pcti != &pti->cti)
pctiOld = pti->pcti;
else
if (pctiOld) DesktopHeapFree(pdeskOld, pctiOld);
IntUnmapDesktopView(pdeskOld);
ObDereferenceObject(pdeskOld);
- ZwClose(hdeskOld);
}
if (pdesk)