Skip to content

Forbidden DwmGetWindowAttribute usage #12206

Closed
@bmarques1995

Description

@bmarques1995

In the file win32_window lines 1277 and 1296, the function DwmGetWindowAttribute saved in DwmGetWindowAttributeFunc are used to retrieve the DWMWA_WINDOW_CORNER_PREFERENCE and the DWMWA_BORDER_COLOR, but this usage for both cases is forbidden, like described in the Microsoft Docs.

Now this issue is not getting misbehavior, but it can causes a crash:

Returning error: clientcore\windows\dwm\dwmapi\attribute.cpp(174)\dwmapi.dll!00007FFE7F18254E: (caller: 00007FFD34734801) ReturnHr(1) tid(b488) 80070057 incorrect parameter.:

For ilustration, these are the forbidden usages:

DwmGetWindowAttributeFunc(hwnd, DWMWA_WINDOW_CORNER_PREFERENCE, &oldPref, sizeof(oldPref))
DwmGetWindowAttributeFunc(hwnd, DWMWA_BORDER_COLOR, &oldPref, sizeof(oldPref))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions