Re: urlmon: Rename the wrappers around HeapAlloc() &Co to use the new standard naming.
Hi, On Nov 29, 2007 4:12 PM, Michael Stefaniuc <mstefani(a)redhat.de> wrote:
diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index aeb0eb2..9f31fb9 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -63,22 +63,22 @@ HRESULT start_binding(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
HRESULT create_binding_protocol(LPCWSTR url, IInternetProtocol **protocol);
-static inline void *urlmon_alloc(size_t len) +static inline void *heap_alloc(size_t len) { return HeapAlloc(GetProcessHeap(), 0, len); }
-static inline void *urlmon_alloc_zero(size_t len) +static inline void *heap_alloc_zero(size_t len) { return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); }
-static inline void *urlmon_realloc(void *mem, size_t len) +static inline void *heap_realloc(void *mem, size_t len) { return HeapReAlloc(GetProcessHeap(), 0, mem, len); }
-static inline BOOL urlmon_free(void *mem) +static inline BOOL heap_free(void *mem) { return HeapFree(GetProcessHeap(), 0, mem); }
Rather than duplicating these inline functions in each dlls private header, could we add the heap wrappers somewhere like winbase.h and mark it as a wine extension? Doing it there would make sense as winbase.h is where HeapAlloc and friends is defined. Thanks -- Steven Edwards "There is one thing stronger than all the armies in the world, and that is an idea whose time has come." - Victor Hugo
Hey, Steven Edwards wrote:
On Nov 29, 2007 4:12 PM, Michael Stefaniuc <mstefani(a)redhat.de> wrote:
diff --git a/dlls/urlmon/urlmon_main.h b/dlls/urlmon/urlmon_main.h index aeb0eb2..9f31fb9 100644 --- a/dlls/urlmon/urlmon_main.h +++ b/dlls/urlmon/urlmon_main.h @@ -63,22 +63,22 @@ HRESULT start_binding(LPCWSTR url, IBindCtx *pbc, REFIID riid, void **ppv);
HRESULT create_binding_protocol(LPCWSTR url, IInternetProtocol **protocol);
-static inline void *urlmon_alloc(size_t len) +static inline void *heap_alloc(size_t len) { return HeapAlloc(GetProcessHeap(), 0, len); }
-static inline void *urlmon_alloc_zero(size_t len) +static inline void *heap_alloc_zero(size_t len) { return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); }
-static inline void *urlmon_realloc(void *mem, size_t len) +static inline void *heap_realloc(void *mem, size_t len) { return HeapReAlloc(GetProcessHeap(), 0, mem, len); }
-static inline BOOL urlmon_free(void *mem) +static inline BOOL heap_free(void *mem) { return HeapFree(GetProcessHeap(), 0, mem); }
Rather than duplicating these inline functions in each dlls private header, could we add the heap wrappers somewhere like winbase.h and mark it as a wine extension? Doing it there would make sense as winbase.h is where HeapAlloc and friends is defined. No, the Wine source needs to be compilable with original Windows headers. That's the official policy. A header below include/wine would be possible in theory. The praxis says you would need to convince Alexandre first. Though a wine/util.h could be useful for other things; i still "dream" of replacing the sizeof(array)/sizeof(array[0]) and bastardized forms (some wrong) of it with an ARRAY_SIZE(array) macro.
bye michael -- Michael Stefaniuc Tel.: +49-711-96437-199 Consulting Communications Engineer Fax.: +49-711-96437-111 -------------------------------------------------------------------- Reg. Adresse: Red Hat GmbH, Hauptstätter Strasse 58, 70178 Stuttgart Handelsregister: Amtsgericht Stuttgart HRB 153243 Geschäftsführer: Brendan Lane, Charlie Peters, Michael Cunningham, Werner Knoblich
participants (2)
-
Michael Stefaniuc -
Steven Edwards