[GDI32] MirrorRgnByWidth(): Fix 'phrgn' parameter handling

Detected by Cppcheck: uselessAssignmentPtrArg.
Addendum to 794e7aa (r31523) and e647530 (r65893).
This commit is contained in:
Serge Gautherie 2020-06-09 02:52:17 +02:00 committed by Thomas Faber
parent fb023adf5a
commit 5f076e5558
No known key found for this signature in database
GPG key ID: 076E7C3D44720826

View file

@ -85,7 +85,7 @@ FASTCALL
MirrorRgnByWidth( MirrorRgnByWidth(
_In_ HRGN hrgn, _In_ HRGN hrgn,
_In_ INT Width, _In_ INT Width,
_In_ HRGN *phrgn) _Out_opt_ HRGN *phrgn)
{ {
INT cRgnDSize, Ret = 0; INT cRgnDSize, Ret = 0;
PRGNDATA pRgnData; PRGNDATA pRgnData;
@ -118,7 +118,10 @@ MirrorRgnByWidth(
hRgnex = ExtCreateRegion(NULL, cRgnDSize , pRgnData); hRgnex = ExtCreateRegion(NULL, cRgnDSize , pRgnData);
if (hRgnex) if (hRgnex)
{ {
if (phrgn) phrgn = (HRGN *)hRgnex; if (phrgn)
{
*phrgn = hRgnex;
}
else else
{ {
CombineRgn(hrgn, hRgnex, 0, RGN_COPY); CombineRgn(hrgn, hRgnex, 0, RGN_COPY);
@ -138,7 +141,7 @@ WINAPI
MirrorRgnDC( MirrorRgnDC(
_In_ HDC hdc, _In_ HDC hdc,
_In_ HRGN hrgn, _In_ HRGN hrgn,
_In_ HRGN *phrn) _Out_opt_ HRGN *phrn)
{ {
if (!GdiValidateHandle((HGDIOBJ) hdc) || if (!GdiValidateHandle((HGDIOBJ) hdc) ||
(GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC)) (GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC))