On Fri, Sep 12, 2008 at 11:08:20AM +0200, Alexandre Julliard wrote:
Marcus Meissner meissner@suse.de writes:
@@ -91,11 +91,11 @@ typedef HRESULT (STDMETHODCALLTYPE MAPILOGONEX)(ULONG_PTR,LPSTR,LPSTR,ULONG,LPMA typedef MAPILOGONEX *LPMAPILOGONEX; MAPILOGONEX MAPILogonEx;
-typedef SCODE (WINAPI MAPIALLOCATEBUFFER)(ULONG,LPVOID*); +typedef SCODE (__WINE_ALLOC_SIZE(1) WINAPI MAPIALLOCATEBUFFER)(ULONG,LPVOID*); typedef MAPIALLOCATEBUFFER *LPMAPIALLOCATEBUFFER; MAPIALLOCATEBUFFER MAPIAllocateBuffer;
-typedef SCODE (WINAPI MAPIALLOCATEMORE)(ULONG,LPVOID,LPVOID*); +typedef SCODE (__WINE_ALLOC_SIZE(1) WINAPI MAPIALLOCATEMORE)(ULONG,LPVOID,LPVOID*); typedef MAPIALLOCATEMORE *LPMAPIALLOCATEMORE; MAPIALLOCATEMORE MAPIAllocateMore;
I don't think it's useful to annotate functions that don't return a pointer.
Umm, yes. Will fix.
@@ -1393,7 +1393,7 @@ void WINAPI InstallHinfSectionW( HWND hwnd, HINSTANCE handle, PCWSTR cmdline BOOL WINAPI IsUserAdmin(VOID); PWSTR WINAPI MultiByteToUnicode(PCSTR lpMultiByteStr, UINT uCodePage); VOID WINAPI MyFree(PVOID lpMem); -PVOID WINAPI MyMalloc(DWORD dwSize); +PVOID WINAPI MyMalloc(DWORD dwSize) __WINE_ALLOC_SIZE(1); PVOID WINAPI MyRealloc(PVOID lpSrc, DWORD dwSize); DWORD WINAPI OpenAndMapForRead(PCWSTR, PDWORD, PHANDLE, PHANDLE, PVOID *); LONG WINAPI QueryRegistryValue(HKEY, PCWSTR, PBYTE *, PDWORD, PDWORD);
Any reason you are not annotating the various realloc functions too?
Can be done too and I will do so for consistency. The realloc functions are however less likely to get fixed sizes for which the alloc_size is intended.
Ciao, Marcus