[INETCOMM] Sync with Wine Staging 1.9.4. CORE-10912 [PSDK] Update objidl.idl. [MAPI32...
[reactos.git] / reactos / dll / win32 / mapi32 / imalloc.c
index 15c3425..a3264aa 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
-#include <stdarg.h>
-
-#define COBJMACROS
-#define NONAMELESSUNION
-#define NONAMELESSSTRUCT
-#include <windef.h>
-#include <winbase.h>
-//#include "winreg.h"
-//#include "winuser.h"
-//#include "winerror.h"
-//#include "winternl.h"
-//#include "objbase.h"
-//#include "shlwapi.h"
-#include <mapiutil.h>
-#include "util.h"
-#include <wine/debug.h>
-
-WINE_DEFAULT_DEBUG_CHANNEL(mapi);
+#include "precomp.h"
 
 static const IMallocVtbl MAPI_IMalloc_vt;
 
 typedef struct
 {
-  const IMallocVtbl *lpVtbl;
+  IMalloc IMalloc_iface;
   LONG lRef;
 } MAPI_IMALLOC;
 
-static MAPI_IMALLOC MAPI_IMalloc = { &MAPI_IMalloc_vt, 0u };
+static MAPI_IMALLOC MAPI_IMalloc = { { &MAPI_IMalloc_vt }, 0 };
 
 extern LONG MAPI_ObjectCount; /* In mapi32_main.c */
 
@@ -71,8 +50,8 @@ LPMALLOC WINAPI MAPIGetDefaultMalloc(void)
     if (mapiFunctions.MAPIGetDefaultMalloc)
         return mapiFunctions.MAPIGetDefaultMalloc();
 
-    IMalloc_AddRef((LPMALLOC)&MAPI_IMalloc);
-    return (LPMALLOC)&MAPI_IMalloc;
+    IMalloc_AddRef(&MAPI_IMalloc.IMalloc_iface);
+    return &MAPI_IMalloc.IMalloc_iface;
 }
 
 /**************************************************************************
@@ -117,7 +96,7 @@ static ULONG WINAPI IMAPIMalloc_fnRelease(LPMALLOC iface)
 /**************************************************************************
  * IMAPIMalloc_Alloc
  */
-static LPVOID WINAPI IMAPIMalloc_fnAlloc(LPMALLOC iface, DWORD cb)
+static LPVOID WINAPI IMAPIMalloc_fnAlloc(LPMALLOC iface, SIZE_T cb)
 {
     TRACE("(%p)->(%d)\n", iface, cb);
 
@@ -127,7 +106,7 @@ static LPVOID WINAPI IMAPIMalloc_fnAlloc(LPMALLOC iface, DWORD cb)
 /**************************************************************************
  * IMAPIMalloc_Realloc
  */
-static LPVOID WINAPI IMAPIMalloc_fnRealloc(LPMALLOC iface, LPVOID pv, DWORD cb)
+static LPVOID WINAPI IMAPIMalloc_fnRealloc(LPMALLOC iface, LPVOID pv, SIZE_T cb)
 {
     TRACE("(%p)->(%p, %d)\n", iface, pv, cb);
 
@@ -153,7 +132,7 @@ static void WINAPI IMAPIMalloc_fnFree(LPMALLOC iface, LPVOID pv)
 /**************************************************************************
  * IMAPIMalloc_GetSize
  */
-static DWORD WINAPI IMAPIMalloc_fnGetSize(LPMALLOC iface, LPVOID pv)
+static SIZE_T WINAPI IMAPIMalloc_fnGetSize(LPMALLOC iface, LPVOID pv)
 {
     TRACE("(%p)->(%p)\n", iface, pv);
     return LocalSize(pv);