[PATCH 0/1] MR9907: include: Annotate p_wglAllocateMemoryNV with __WINE_ALLOC_SIZE.
From: Alex Henrie <alexhenrie24@gmail.com> --- include/wine/opengl_driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/wine/opengl_driver.h b/include/wine/opengl_driver.h index 7ec2110fd35..357f513b128 100644 --- a/include/wine/opengl_driver.h +++ b/include/wine/opengl_driver.h @@ -96,7 +96,7 @@ struct opengl_funcs BOOL (*p_wglShareLists)( struct wgl_context * hrcSrvShare, struct wgl_context * hrcSrvSource ); BOOL (*p_wglSwapBuffers)( HDC hdc ); void (*p_get_pixel_formats)( struct wgl_pixel_format *formats, UINT max_formats, UINT *num_formats, UINT *num_onscreen_formats ); - void * (*p_wglAllocateMemoryNV)( GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority ); + void * (__WINE_ALLOC_SIZE(1) *p_wglAllocateMemoryNV)( GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority ); BOOL (*p_wglBindTexImageARB)( struct wgl_pbuffer * hPbuffer, int iBuffer ); BOOL (*p_wglChoosePixelFormatARB)( HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats ); struct wgl_context * (*p_wglCreateContextAttribsARB)( HDC hDC, struct wgl_context * hShareContext, const int *attribList ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9907
How is this useful? We don't even use that function. Also I was hoping that we could use the generated function pointers at some point. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9907#note_127181
On Fri Jan 16 16:24:24 2026 +0000, Rémi Bernon wrote:
How is this useful? We don't even use that function. Also I was hoping that we could use the generated function pointers at some point. In general, the [alloc_size](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-all...) attribute helps [GCC's static analyzer](https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Static-Analyzer-Options.html) spot out-of-bounds reads and writes. But it looks like p_wglAllocateMemoryNV is only used in [unix_thunks.c](https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/opengl32/unix_thunks....), so you're right, there's not much opportunity to make mistakes with it.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9907#note_127201
This merge request was closed by Rémi Bernon. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9907
participants (3)
-
Alex Henrie -
Alex Henrie (@alexhenrie) -
Rémi Bernon (@rbernon)