Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
fd1b9afc
Commit
fd1b9afc
authored
Apr 28, 2022
by
Brendan Shanks
Committed by
Alexandre Julliard
May 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
include: Add __WINE_MALLOC attribute and use it for allocation functions.
Signed-off-by:
Brendan Shanks
<
bshanks@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0c856978
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
28 additions
and
22 deletions
+28
-22
wdm.h
include/ddk/wdm.h
+6
-6
objbase.h
include/objbase.h
+1
-1
oleauto.h
include/oleauto.h
+3
-3
rpcndr.h
include/rpcndr.h
+4
-4
winbase.h
include/winbase.h
+3
-3
wincrypt.h
include/wincrypt.h
+1
-1
heap.h
include/wine/heap.h
+3
-3
winnt.h
include/winnt.h
+6
-0
winternl.h
include/winternl.h
+1
-1
No files found.
include/ddk/wdm.h
View file @
fd1b9afc
...
...
@@ -1656,10 +1656,10 @@ BOOLEAN WINAPI ExAcquireResourceExclusiveLite(ERESOURCE*,BOOLEAN);
BOOLEAN
WINAPI
ExAcquireResourceSharedLite
(
ERESOURCE
*
,
BOOLEAN
);
BOOLEAN
WINAPI
ExAcquireSharedStarveExclusive
(
ERESOURCE
*
,
BOOLEAN
);
BOOLEAN
WINAPI
ExAcquireSharedWaitForExclusive
(
ERESOURCE
*
,
BOOLEAN
);
PVOID
WINAPI
ExAllocatePool
(
POOL_TYPE
,
SIZE_T
)
__WINE_ALLOC_SIZE
(
2
);
PVOID
WINAPI
ExAllocatePoolWithQuota
(
POOL_TYPE
,
SIZE_T
)
__WINE_ALLOC_SIZE
(
2
);
PVOID
WINAPI
ExAllocatePoolWithTag
(
POOL_TYPE
,
SIZE_T
,
ULONG
)
__WINE_ALLOC_SIZE
(
2
);
PVOID
WINAPI
ExAllocatePoolWithQuotaTag
(
POOL_TYPE
,
SIZE_T
,
ULONG
)
__WINE_ALLOC_SIZE
(
2
);
PVOID
WINAPI
ExAllocatePool
(
POOL_TYPE
,
SIZE_T
)
__WINE_ALLOC_SIZE
(
2
)
__WINE_MALLOC
;
PVOID
WINAPI
ExAllocatePoolWithQuota
(
POOL_TYPE
,
SIZE_T
)
__WINE_ALLOC_SIZE
(
2
)
__WINE_MALLOC
;
PVOID
WINAPI
ExAllocatePoolWithTag
(
POOL_TYPE
,
SIZE_T
,
ULONG
)
__WINE_ALLOC_SIZE
(
2
)
__WINE_MALLOC
;
PVOID
WINAPI
ExAllocatePoolWithQuotaTag
(
POOL_TYPE
,
SIZE_T
,
ULONG
)
__WINE_ALLOC_SIZE
(
2
)
__WINE_MALLOC
;
void
WINAPI
ExDeleteNPagedLookasideList
(
PNPAGED_LOOKASIDE_LIST
);
void
WINAPI
ExDeletePagedLookasideList
(
PPAGED_LOOKASIDE_LIST
);
NTSTATUS
WINAPI
ExDeleteResourceLite
(
ERESOURCE
*
);
...
...
@@ -1791,8 +1791,8 @@ BOOLEAN WINAPI KeSignalCallDpcSynchronize(void*);
NTSTATUS
WINAPI
KeWaitForMultipleObjects
(
ULONG
,
void
*
[],
WAIT_TYPE
,
KWAIT_REASON
,
KPROCESSOR_MODE
,
BOOLEAN
,
LARGE_INTEGER
*
,
KWAIT_BLOCK
*
);
NTSTATUS
WINAPI
KeWaitForSingleObject
(
void
*
,
KWAIT_REASON
,
KPROCESSOR_MODE
,
BOOLEAN
,
LARGE_INTEGER
*
);
PVOID
WINAPI
MmAllocateContiguousMemory
(
SIZE_T
,
PHYSICAL_ADDRESS
)
__WINE_ALLOC_SIZE
(
1
);
PVOID
WINAPI
MmAllocateNonCachedMemory
(
SIZE_T
)
__WINE_ALLOC_SIZE
(
1
);
PVOID
WINAPI
MmAllocateContiguousMemory
(
SIZE_T
,
PHYSICAL_ADDRESS
)
__WINE_ALLOC_SIZE
(
1
)
__WINE_MALLOC
;
PVOID
WINAPI
MmAllocateNonCachedMemory
(
SIZE_T
)
__WINE_ALLOC_SIZE
(
1
)
__WINE_MALLOC
;
PMDL
WINAPI
MmAllocatePagesForMdl
(
PHYSICAL_ADDRESS
,
PHYSICAL_ADDRESS
,
PHYSICAL_ADDRESS
,
SIZE_T
);
void
WINAPI
MmBuildMdlForNonPagedPool
(
MDL
*
);
NTSTATUS
WINAPI
MmCopyVirtualMemory
(
PEPROCESS
,
void
*
,
PEPROCESS
,
void
*
,
SIZE_T
,
KPROCESSOR_MODE
,
SIZE_T
*
);
...
...
include/objbase.h
View file @
fd1b9afc
...
...
@@ -317,7 +317,7 @@ HRESULT WINAPI CoGetInstanceFromFile(COSERVERINFO* pServerInfo, CLSID* pClsid, I
HRESULT
WINAPI
CoGetInstanceFromIStorage
(
COSERVERINFO
*
pServerInfo
,
CLSID
*
pClsid
,
IUnknown
*
punkOuter
,
DWORD
dwClsCtx
,
IStorage
*
pstg
,
DWORD
dwCount
,
MULTI_QI
*
pResults
);
HRESULT
WINAPI
CoGetMalloc
(
DWORD
dwMemContext
,
LPMALLOC
*
lpMalloc
);
LPVOID
WINAPI
CoTaskMemAlloc
(
SIZE_T
size
)
__WINE_ALLOC_SIZE
(
1
);
LPVOID
WINAPI
CoTaskMemAlloc
(
SIZE_T
size
)
__WINE_ALLOC_SIZE
(
1
)
__WINE_MALLOC
;
void
WINAPI
CoTaskMemFree
(
LPVOID
ptr
);
LPVOID
WINAPI
CoTaskMemRealloc
(
LPVOID
ptr
,
SIZE_T
size
)
__WINE_ALLOC_SIZE
(
2
);
...
...
include/oleauto.h
View file @
fd1b9afc
...
...
@@ -38,9 +38,9 @@ DEFINE_OLEGUID(IID_StdOle, 0x00020430,0,0);
ULONG
WINAPI
OaBuildVersion
(
void
);
/* BSTR functions */
BSTR
WINAPI
SysAllocString
(
const
OLECHAR
*
);
BSTR
WINAPI
SysAllocStringByteLen
(
LPCSTR
,
UINT
);
BSTR
WINAPI
SysAllocStringLen
(
const
OLECHAR
*
,
UINT
);
BSTR
WINAPI
SysAllocString
(
const
OLECHAR
*
)
__WINE_MALLOC
;
BSTR
WINAPI
SysAllocStringByteLen
(
LPCSTR
,
UINT
)
__WINE_MALLOC
;
BSTR
WINAPI
SysAllocStringLen
(
const
OLECHAR
*
,
UINT
)
__WINE_MALLOC
;
void
WINAPI
SysFreeString
(
BSTR
);
INT
WINAPI
SysReAllocString
(
LPBSTR
,
const
OLECHAR
*
);
int
WINAPI
SysReAllocStringLen
(
BSTR
*
,
const
OLECHAR
*
,
UINT
);
...
...
include/rpcndr.h
View file @
fd1b9afc
...
...
@@ -658,7 +658,7 @@ RPCRTAPI LONG RPC_ENTRY
NdrDcomAsyncStubCall
(
struct
IRpcStubBuffer
*
pThis
,
struct
IRpcChannelBuffer
*
pChannel
,
PRPC_MESSAGE
pRpcMsg
,
DWORD
*
pdwStubPhase
);
RPCRTAPI
void
*
RPC_ENTRY
NdrAllocate
(
PMIDL_STUB_MESSAGE
pStubMsg
,
SIZE_T
Len
)
__WINE_ALLOC_SIZE
(
2
);
NdrAllocate
(
PMIDL_STUB_MESSAGE
pStubMsg
,
SIZE_T
Len
)
__WINE_ALLOC_SIZE
(
2
)
__WINE_MALLOC
;
RPCRTAPI
void
RPC_ENTRY
NdrClearOutParameters
(
PMIDL_STUB_MESSAGE
pStubMsg
,
PFORMAT_STRING
pFormat
,
void
*
ArgAddr
);
...
...
@@ -668,7 +668,7 @@ RPCRTAPI RPC_STATUS RPC_ENTRY
ULONG
*
pFaultStatus
,
RPC_STATUS
Status_
);
RPCRTAPI
void
*
RPC_ENTRY
NdrOleAllocate
(
SIZE_T
Size
)
__WINE_ALLOC_SIZE
(
1
);
NdrOleAllocate
(
SIZE_T
Size
)
__WINE_ALLOC_SIZE
(
1
)
__WINE_MALLOC
;
RPCRTAPI
void
RPC_ENTRY
NdrOleFree
(
void
*
NodeToFree
);
...
...
@@ -729,11 +729,11 @@ RPCRTAPI void RPC_ENTRY
RPCRTAPI
void
RPC_ENTRY
NdrRpcSmSetClientToOsf
(
PMIDL_STUB_MESSAGE
pMessage
);
RPCRTAPI
void
*
RPC_ENTRY
NdrRpcSmClientAllocate
(
SIZE_T
Size
)
__WINE_ALLOC_SIZE
(
1
);
NdrRpcSmClientAllocate
(
SIZE_T
Size
)
__WINE_ALLOC_SIZE
(
1
)
__WINE_MALLOC
;
RPCRTAPI
void
RPC_ENTRY
NdrRpcSmClientFree
(
void
*
NodeToFree
);
RPCRTAPI
void
*
RPC_ENTRY
NdrRpcSsDefaultAllocate
(
SIZE_T
Size
)
__WINE_ALLOC_SIZE
(
1
);
NdrRpcSsDefaultAllocate
(
SIZE_T
Size
)
__WINE_ALLOC_SIZE
(
1
)
__WINE_MALLOC
;
RPCRTAPI
void
RPC_ENTRY
NdrRpcSsDefaultFree
(
void
*
NodeToFree
);
...
...
include/winbase.h
View file @
fd1b9afc
...
...
@@ -2350,7 +2350,7 @@ WINBASEAPI BOOL WINAPI GetXStateFeaturesMask(CONTEXT*,DWORD64*);
WINBASEAPI
ATOM
WINAPI
GlobalAddAtomA
(
LPCSTR
);
WINBASEAPI
ATOM
WINAPI
GlobalAddAtomW
(
LPCWSTR
);
#define GlobalAddAtom WINELIB_NAME_AW(GlobalAddAtom)
WINBASEAPI
HGLOBAL
WINAPI
GlobalAlloc
(
UINT
,
SIZE_T
)
__WINE_ALLOC_SIZE
(
2
);
WINBASEAPI
HGLOBAL
WINAPI
GlobalAlloc
(
UINT
,
SIZE_T
)
__WINE_ALLOC_SIZE
(
2
)
__WINE_MALLOC
;
WINBASEAPI
SIZE_T
WINAPI
GlobalCompact
(
DWORD
);
WINBASEAPI
ATOM
WINAPI
GlobalDeleteAtom
(
ATOM
);
WINBASEAPI
ATOM
WINAPI
GlobalFindAtomA
(
LPCSTR
);
...
...
@@ -2373,7 +2373,7 @@ WINBASEAPI BOOL WINAPI GlobalUnlock(HGLOBAL);
WINBASEAPI
BOOL
WINAPI
GlobalUnWire
(
HGLOBAL
);
WINBASEAPI
LPVOID
WINAPI
GlobalWire
(
HGLOBAL
);
#define HasOverlappedIoCompleted(lpOverlapped) ((lpOverlapped)->Internal != STATUS_PENDING)
WINBASEAPI
LPVOID
WINAPI
HeapAlloc
(
HANDLE
,
DWORD
,
SIZE_T
)
__WINE_ALLOC_SIZE
(
3
);
WINBASEAPI
LPVOID
WINAPI
HeapAlloc
(
HANDLE
,
DWORD
,
SIZE_T
)
__WINE_ALLOC_SIZE
(
3
)
__WINE_MALLOC
;
WINBASEAPI
SIZE_T
WINAPI
HeapCompact
(
HANDLE
,
DWORD
);
WINBASEAPI
HANDLE
WINAPI
HeapCreate
(
DWORD
,
SIZE_T
,
SIZE_T
);
WINBASEAPI
BOOL
WINAPI
HeapDestroy
(
HANDLE
);
...
...
@@ -2440,7 +2440,7 @@ WINBASEAPI HMODULE WINAPI LoadLibraryExW(LPCWSTR,HANDLE,DWORD);
WINBASEAPI
DWORD
WINAPI
LoadModule
(
LPCSTR
,
LPVOID
);
WINBASEAPI
HMODULE
WINAPI
LoadPackagedLibrary
(
LPCWSTR
,
DWORD
);
WINBASEAPI
HGLOBAL
WINAPI
LoadResource
(
HMODULE
,
HRSRC
);
WINBASEAPI
HLOCAL
WINAPI
LocalAlloc
(
UINT
,
SIZE_T
)
__WINE_ALLOC_SIZE
(
2
);
WINBASEAPI
HLOCAL
WINAPI
LocalAlloc
(
UINT
,
SIZE_T
)
__WINE_ALLOC_SIZE
(
2
)
__WINE_MALLOC
;
WINBASEAPI
SIZE_T
WINAPI
LocalCompact
(
UINT
);
WINBASEAPI
UINT
WINAPI
LocalFlags
(
HLOCAL
);
WINBASEAPI
HLOCAL
WINAPI
LocalFree
(
HLOCAL
);
...
...
include/wincrypt.h
View file @
fd1b9afc
...
...
@@ -4043,7 +4043,7 @@ WINADVAPI BOOL WINAPI CryptVerifySignatureW (HCRYPTHASH, const BYTE *, DWORD, HC
#define CryptVerifySignature WINELIB_NAME_AW(CryptVerifySignature)
/* crypt32.dll functions */
LPVOID
WINAPI
CryptMemAlloc
(
ULONG
cbSize
)
__WINE_ALLOC_SIZE
(
1
);
LPVOID
WINAPI
CryptMemAlloc
(
ULONG
cbSize
)
__WINE_ALLOC_SIZE
(
1
)
__WINE_MALLOC
;
LPVOID
WINAPI
CryptMemRealloc
(
LPVOID
pv
,
ULONG
cbSize
)
__WINE_ALLOC_SIZE
(
2
);
VOID
WINAPI
CryptMemFree
(
LPVOID
pv
);
...
...
include/wine/heap.h
View file @
fd1b9afc
...
...
@@ -24,12 +24,12 @@
#include <winbase.h>
static
inline
void
*
__WINE_ALLOC_SIZE
(
1
)
heap_alloc
(
SIZE_T
len
)
static
inline
void
*
__WINE_ALLOC_SIZE
(
1
)
__WINE_MALLOC
heap_alloc
(
SIZE_T
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
len
);
}
static
inline
void
*
__WINE_ALLOC_SIZE
(
1
)
heap_alloc_zero
(
SIZE_T
len
)
static
inline
void
*
__WINE_ALLOC_SIZE
(
1
)
__WINE_MALLOC
heap_alloc_zero
(
SIZE_T
len
)
{
return
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
);
}
...
...
@@ -46,7 +46,7 @@ static inline void heap_free(void *mem)
HeapFree
(
GetProcessHeap
(),
0
,
mem
);
}
static
inline
void
*
__WINE_ALLOC_SIZE
(
1
,
2
)
heap_calloc
(
SIZE_T
count
,
SIZE_T
size
)
static
inline
void
*
__WINE_ALLOC_SIZE
(
1
,
2
)
__WINE_MALLOC
heap_calloc
(
SIZE_T
count
,
SIZE_T
size
)
{
SIZE_T
len
=
count
*
size
;
...
...
include/winnt.h
View file @
fd1b9afc
...
...
@@ -204,6 +204,12 @@ extern "C" {
#define __WINE_ALLOC_SIZE(...)
#endif
#if defined(__GNUC__) && (__GNUC__ > 2)
#define __WINE_MALLOC __attribute__((malloc))
#else
#define __WINE_MALLOC
#endif
/* Anonymous union/struct handling */
#ifndef NONAMELESSSTRUCT
...
...
include/winternl.h
View file @
fd1b9afc
...
...
@@ -4200,7 +4200,7 @@ NTSYSAPI PVOID WINAPI RtlAddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTI
NTSYSAPI
NTSTATUS
WINAPI
RtlAdjustPrivilege
(
ULONG
,
BOOLEAN
,
BOOLEAN
,
PBOOLEAN
);
NTSYSAPI
NTSTATUS
WINAPI
RtlAllocateAndInitializeSid
(
PSID_IDENTIFIER_AUTHORITY
,
BYTE
,
DWORD
,
DWORD
,
DWORD
,
DWORD
,
DWORD
,
DWORD
,
DWORD
,
DWORD
,
PSID
*
);
NTSYSAPI
RTL_HANDLE
*
WINAPI
RtlAllocateHandle
(
RTL_HANDLE_TABLE
*
,
ULONG
*
);
NTSYSAPI
PVOID
WINAPI
RtlAllocateHeap
(
HANDLE
,
ULONG
,
SIZE_T
)
__WINE_ALLOC_SIZE
(
3
);
NTSYSAPI
PVOID
WINAPI
RtlAllocateHeap
(
HANDLE
,
ULONG
,
SIZE_T
)
__WINE_ALLOC_SIZE
(
3
)
__WINE_MALLOC
;
NTSYSAPI
WCHAR
WINAPI
RtlAnsiCharToUnicodeChar
(
LPSTR
*
);
NTSYSAPI
DWORD
WINAPI
RtlAnsiStringToUnicodeSize
(
const
STRING
*
);
NTSYSAPI
NTSTATUS
WINAPI
RtlAnsiStringToUnicodeString
(
PUNICODE_STRING
,
PCANSI_STRING
,
BOOLEAN
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment