Best method for storing this pointer for use in WndProc

前端 未结 10 825
南旧
南旧 2020-11-29 20:06

I\'m interested to know the best / common way of storing a this pointer for use in the WndProc. I know of several approaches, but each as I underst

10条回答
  •  感动是毒
    2020-11-29 20:20

    With regard to SetWindowLong() / GetWindowLong() security, according to Microsoft:

    The SetWindowLong function fails if the window specified by the hWnd parameter does not belong to the same process as the calling thread.

    Unfortunately, until the release of a Security Update on October 12, 2004, Windows would not enforce this rule, allowing an application to set any other application's GWL_USERDATA. Therefore, applications running on unpatched systems are vulnerable to attack through calls to SetWindowLong().

提交回复
热议问题