mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 14:51:00 +00:00
Implement Get/SetMiterLimit, with proper float containment.
svn path=/trunk/; revision=34004
This commit is contained in:
parent
9e2224d220
commit
7f2b7d7436
3 changed files with 76 additions and 7 deletions
|
@ -136,7 +136,13 @@ SetMiterLimit(
|
|||
PFLOAT a2
|
||||
)
|
||||
{
|
||||
return NtGdiSetMiterLimit ( hdc, a1, (PDWORD)a2 );
|
||||
BOOL Ret;
|
||||
gxf_long worker, worker1;
|
||||
|
||||
worker.f = a1;
|
||||
Ret = NtGdiSetMiterLimit ( hdc, worker.l, a2 ? &worker1.l : NULL );
|
||||
if (a2 && Ret) *a2 = worker1.f;
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3442,7 +3442,7 @@ NtGdiGetBoundsRect(
|
|||
OUT LPRECT prc,
|
||||
IN DWORD f)
|
||||
{
|
||||
DPRINT1("stub");
|
||||
DPRINT1("stub\n");
|
||||
return DCB_RESET; /* bounding rectangle always empty */
|
||||
}
|
||||
|
||||
|
@ -3453,7 +3453,7 @@ NtGdiSetBoundsRect(
|
|||
IN LPRECT prc,
|
||||
IN DWORD f)
|
||||
{
|
||||
DPRINT1("stub");
|
||||
DPRINT1("stub\n");
|
||||
return DCB_DISABLE; /* bounding rectangle always empty */
|
||||
}
|
||||
|
||||
|
|
|
@ -195,8 +195,39 @@ NtGdiGetMiterLimit(
|
|||
IN HDC hdc,
|
||||
OUT PDWORD pdwOut)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
DC *pDc;
|
||||
gxf_long worker;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
if(!(pDc = DC_LockDc(hdc))) return FALSE;
|
||||
|
||||
worker.f = pDc->DcLevel.laPath.eMiterLimit;
|
||||
|
||||
if (pdwOut)
|
||||
{
|
||||
_SEH_TRY
|
||||
{
|
||||
ProbeForWrite(pdwOut,
|
||||
sizeof(DWORD),
|
||||
1);
|
||||
*pdwOut = worker.l;
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
Status = _SEH_GetExceptionCode();
|
||||
}
|
||||
_SEH_END;
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
DC_UnlockDc(pDc);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
DC_UnlockDc(pDc);
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
|
||||
INT
|
||||
|
@ -298,8 +329,40 @@ NtGdiSetMiterLimit(
|
|||
IN DWORD dwNew,
|
||||
IN OUT OPTIONAL PDWORD pdwOut)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
DC *pDc;
|
||||
gxf_long worker, worker1;
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
|
||||
if(!(pDc = DC_LockDc(hdc))) return FALSE;
|
||||
|
||||
worker.l = dwNew;
|
||||
worker1.f = pDc->DcLevel.laPath.eMiterLimit;
|
||||
pDc->DcLevel.laPath.eMiterLimit = worker.f;
|
||||
|
||||
if (pdwOut)
|
||||
{
|
||||
_SEH_TRY
|
||||
{
|
||||
ProbeForWrite(pdwOut,
|
||||
sizeof(DWORD),
|
||||
1);
|
||||
*pdwOut = worker1.l;
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
Status = _SEH_GetExceptionCode();
|
||||
}
|
||||
_SEH_END;
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastNtError(Status);
|
||||
DC_UnlockDc(pDc);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
DC_UnlockDc(pDc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL
|
||||
|
|
Loading…
Reference in a new issue