* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
#define _WIN32_DCOM
#define COBJMACROS
#define CONST_VTABLE
-//#include <stdarg.h>
+#include <stdarg.h>
#include <stdio.h>
-#include <windef.h>
-#include <winbase.h>
-#include <winnls.h>
-#include <ole2.h>
-//#include "objbase.h"
-//#include "ocidl.h"
-//#include "initguid.h"
-#include <comcat.h>
-#include <olectl.h>
+#include "windef.h"
+#include "winbase.h"
+#include "objbase.h"
+#include "ocidl.h"
+#include "comcat.h"
+#include "olectl.h"
-#include <wine/test.h>
+#include "wine/test.h"
#define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %d\n", cLocks)
#define ok_no_locks() ok(cLocks == 0, "Number of locks should be 0, but actually is %d\n", cLocks)
#define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error 0x%08x\n", hr)
-#define COUNTOF(x) (sizeof(x) / sizeof(x[0]))
#define CHECK_EXPECTED_METHOD(method_name) \
do { \
hr = CreateBindCtx(0, &pbc);
ok_ole_success(hr, CreateBindCtx);
- for (i = 0; i < sizeof(invalid_parameters)/sizeof(invalid_parameters[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_parameters); i++)
{
eaten = 0xdeadbeef;
pmk = (IMoniker *)0xdeadbeef;
pmk = NULL;
hr = MkParseDisplayName(pbc, wszDisplayName, &eaten, &pmk);
ok_ole_success(hr, MkParseDisplayName);
- ok(eaten == sizeof(wszDisplayName)/sizeof(WCHAR) - 1,
+ ok(eaten == ARRAY_SIZE(wszDisplayName) - 1,
"Processed character count should have been 43 instead of %u\n", eaten);
if (pmk)
{
pmk = NULL;
hr = MkParseDisplayName(pbc, wszDisplayNameRunning, &eaten, &pmk);
ok_ole_success(hr, MkParseDisplayName);
- ok(eaten == sizeof(wszDisplayNameRunning)/sizeof(WCHAR) - 1,
+ ok(eaten == ARRAY_SIZE(wszDisplayNameRunning) - 1,
"Processed character count should have been 15 instead of %u\n", eaten);
if (pmk)
{
expected_display_name = wszDisplayNameProgId1;
hr = MkParseDisplayName(pbc, wszDisplayNameProgId1, &eaten, &pmk);
ok_ole_success(hr, MkParseDisplayName);
- ok(eaten == sizeof(wszDisplayNameProgId1)/sizeof(WCHAR) - 1,
+ ok(eaten == ARRAY_SIZE(wszDisplayNameProgId1) - 1,
"Processed character count should have been 8 instead of %u\n", eaten);
if (pmk)
{
expected_display_name = wszDisplayNameProgId2;
hr = MkParseDisplayName(pbc, wszDisplayNameProgId2, &eaten, &pmk);
ok_ole_success(hr, MkParseDisplayName);
- ok(eaten == sizeof(wszDisplayNameProgId2)/sizeof(WCHAR) - 1,
+ ok(eaten == ARRAY_SIZE(wszDisplayNameProgId2) - 1,
"Processed character count should have been 8 instead of %u\n", eaten);
if (pmk)
{
GetSystemDirectoryA(szDisplayNameFile, sizeof(szDisplayNameFile));
strcat(szDisplayNameFile, "\\kernel32.dll");
- len = MultiByteToWideChar(CP_ACP, 0, szDisplayNameFile, -1, wszDisplayNameFile, sizeof(wszDisplayNameFile)/sizeof(wszDisplayNameFile[0]));
+ len = MultiByteToWideChar(CP_ACP, 0, szDisplayNameFile, -1, wszDisplayNameFile,
+ ARRAY_SIZE(wszDisplayNameFile));
hr = MkParseDisplayName(pbc, wszDisplayNameFile, &eaten, &pmk);
ok_ole_success(hr, MkParseDisplayName);
ok(eaten == len - 1, "Processed character count should have been %d instead of %u\n", len - 1, eaten);
hr = MkParseDisplayName(pbc, wszDisplayName, &eaten, &pmk);
ok_ole_success(hr, MkParseDisplayName);
- ok(eaten == sizeof(wszDisplayName)/sizeof(WCHAR) - 1, "Processed character count should have been 43 instead of %u\n", eaten);
+ ok(eaten == ARRAY_SIZE(wszDisplayName) - 1,
+ "Processed character count should have been 43 instead of %u\n", eaten);
if (pmk)
{
trace("ACP is %u\n", GetACP());
- for (i = 0; i < COUNTOF(wszFile); ++i)
+ for (i = 0; i < ARRAY_SIZE(wszFile); ++i)
{
int j ;
if (i == 2)