46 "MAPIGetDefaultMalloc@0");
47 if (!pMAPIGetDefaultMalloc)
49 win_skip(
"MAPIGetDefaultMalloc is not available\n");
53 lpMalloc = pMAPIGetDefaultMalloc();
54 ok(lpMalloc !=
NULL,
"Expected MAPIGetDefaultMalloc to return non-NULL\n");
57 skip(
"MAPIGetDefaultMalloc failed\n");
62 hRet = IMalloc_QueryInterface(lpMalloc, &
IID_IUnknown, &lpVoid);
64 "IID_IUnknown: expected S_OK, non-null, got 0x%08x, %p\n",
68 hRet = IMalloc_QueryInterface(lpMalloc, &IID_IMalloc, &lpVoid);
70 "IID_IIMalloc: expected S_OK, non-null, got 0x%08x, %p\n",
74 lpMem = IMalloc_Alloc(lpMalloc, 61);
75 ok (lpMem && IMalloc_GetSize(lpMalloc, lpMem) ==
LocalSize(lpMem),
76 "Expected non-null, same size, got %p, %s size\n", lpMem,
77 lpMem ?
"different" :
"same");
79 iRet = IMalloc_DidAlloc(lpMalloc, lpMem);
80 ok (iRet == -1,
"DidAlloc, expected -1. got %d\n", iRet);
82 IMalloc_HeapMinimize(lpMalloc);
86 ulRef = IMalloc_AddRef(lpMalloc);
87 ok (ulRef == 1u,
"AddRef expected 1, returned %d\n", ulRef);
89 ulRef = IMalloc_Release(lpMalloc);
90 ok (ulRef == 1u,
"AddRef expected 1, returned %d\n", ulRef);
92 IMalloc_Release(lpMalloc);
101 win_skip(
"No default mail client installed\n");
108 if (!pScInitMapiUtil)
110 win_skip(
"ScInitMapiUtil is not available\n");
116 ret = pScInitMapiUtil(0);
119 win_skip(
"ScInitMapiUtil is not implemented\n");
125 win_skip(
"ScInitMapiUtil doesn't work on some Win98 and WinME systems\n");
#define GetProcAddress(x, y)
#define ERROR_INVALID_HANDLE
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
SIZE_T NTAPI LocalSize(HLOCAL hMem)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
static BOOL HaveDefaultMailClient(void)
static void test_IMalloc(void)
interface IMalloc * LPMALLOC
DWORD WINAPI GetLastError(void)
#define ERROR_PROC_NOT_FOUND