atl: Use atlbase.h in tests.

This commit is contained in:
Jacek Caban 2012-12-26 13:49:50 +01:00 committed by Alexandre Julliard
parent 6e485f13c0
commit 65493cf137
1 changed files with 22 additions and 65 deletions

View File

@ -24,55 +24,14 @@
#define COBJMACROS
#include <atlbase.h>
#include <wine/test.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <wingdi.h>
#include <winnls.h>
#include <winerror.h>
#include <winnt.h>
#include <wtypes.h>
#include <olectl.h>
#include <ocidl.h>
struct _ATL_OBJMAP_ENTRYW;
struct _AtlCreateWndData;
struct _ATL_TERMFUNC_ELEM;
struct _ATL_MODULEW
{
UINT cbSize;
HINSTANCE m_hInst;
HINSTANCE m_hInstResource;
HINSTANCE m_hInstTypeLib;
struct _ATL_OBJMAP_ENTRYW* m_pObjMap;
LONG m_nLockCnt;
HANDLE m_hHeap;
union
{
CRITICAL_SECTION m_csTypeInfoHolder;
CRITICAL_SECTION m_csStaticDataInit;
} u;
CRITICAL_SECTION m_csWindowCreate;
CRITICAL_SECTION m_csObjMap;
DWORD dwAtlBuildVer;
struct _AtlCreateWndData* m_pCreateWndList;
BOOL m_bDestroyHeap;
GUID* pguidVer;
DWORD m_dwHeaps;
HANDLE* m_phHeaps;
int m_nHeap;
struct _ATL_TERMFUNC_ELEM* m_pTermFuncs;
};
HRESULT WINAPI AtlModuleInit(struct _ATL_MODULEW* pM, struct _ATL_OBJMAP_ENTRYW* p, HINSTANCE h);
#define MAXSIZE 512
static void test_StructSize(void)
{
struct _ATL_MODULEW *tst;
_ATL_MODULEW *tst;
HRESULT hres;
int i;
@ -83,17 +42,15 @@ static void test_StructSize(void)
hres = AtlModuleInit(tst, NULL, NULL);
switch (i) {
case FIELD_OFFSET( struct _ATL_MODULEW, dwAtlBuildVer ):
case sizeof(struct _ATL_MODULEW):
case FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer):
case sizeof(_ATL_MODULEW):
#ifdef _WIN64
case sizeof(struct _ATL_MODULEW) + sizeof(void *):
case sizeof(_ATL_MODULEW) + sizeof(void *):
#endif
ok (hres == S_OK, "AtlModuleInit with %d failed (0x%x).\n", i, (int)hres);
break;
default:
ok (FAILED(hres) ||
broken((i > FIELD_OFFSET( struct _ATL_MODULEW, dwAtlBuildVer )) && (hres == S_OK)), /* Win95 */
"AtlModuleInit with %d succeeded? (0x%x).\n", i, (int)hres);
ok (FAILED(hres), "AtlModuleInit with %d succeeded? (0x%x).\n", i, (int)hres);
break;
}
}