1,204 changes: 465 additions & 739 deletions ANNOUNCE

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Alexandre Bique
Alexandre Goujon
Alexandre Julliard
Alexandre Rostovtsev
Alexandros Frantzis
Alexandru Balut
Alex Arazi
Alex Busenius
Expand Down Expand Up @@ -305,6 +306,7 @@ Christian Schlaile
Christoph Brill
Christoph Bumiller
Christopher Berner
Christopher Egert
Christopher Gautier
Christopher Harvey
Christopher Thielen
Expand Down Expand Up @@ -1295,6 +1297,7 @@ Pablo Spallanzani
Panagiotis Christeas
Pascal Cuoq
Pascal Lessard
Pat Leamon
Patrick Ammann
Patrick Armstrong
Patrick Gauthier
Expand Down Expand Up @@ -1515,6 +1518,7 @@ Samuel Lidén Borell
Sander van Leeuwen
Sandijs Ribaks
Sanghoon Park
Santino Mazza
Santosh Siddheshwar
Sasha Slijepcevic
Sato Kazuyuki
Expand Down Expand Up @@ -1619,6 +1623,7 @@ Sylvain Bouchard
Sylvain Petreolle
Sylvain St-Germain
Tapio Kautto
Tatsuyuki Ishi
Tatyana Fokina
Ted Lyngmo
Ted Percival
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ F: dlls/combase/
F: dlls/ole32/compobj.c
F: dlls/ole32/marshal.c
F: dlls/ole32/usrmarshal.c
F: programs/dllhost/

OLE Storage
M: Esme Povirk <esme@codeweavers.com>
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Wine version 7.2
Wine version 7.5
679 changes: 311 additions & 368 deletions configure

Large diffs are not rendered by default.

105 changes: 58 additions & 47 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ AC_ARG_WITH(udev, AS_HELP_STRING([--without-udev],[do not use udev (plug an
AC_ARG_WITH(unwind, AS_HELP_STRING([--without-unwind],[do not use the libunwind library (exception handling)]))
AC_ARG_WITH(usb, AS_HELP_STRING([--without-usb],[do not use the libusb library]))
AC_ARG_WITH(v4l2, AS_HELP_STRING([--without-v4l2],[do not use v4l2 (video capture)]))
AC_ARG_WITH(vkd3d, AS_HELP_STRING([--without-vkd3d],[do not use vkd3d (Direct3D 12 support)]))
AC_ARG_WITH(vulkan, AS_HELP_STRING([--without-vulkan],[do not use Vulkan]))
AC_ARG_WITH(xcomposite,AS_HELP_STRING([--without-xcomposite],[do not use the Xcomposite extension]),
[if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xcomposite_h=no; fi])
Expand Down Expand Up @@ -193,10 +192,6 @@ case $host in
TARGETFLAGS="$TARGETFLAGS -mfloat-abi=$float_abi"
;;
aarch64*)
AC_CACHE_CHECK([whether $CC supports __builtin_ms_va_list],wine_cv_builtin_ms_va_list,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>]], [[void func(__builtin_ms_va_list *args);]])],
[wine_cv_builtin_ms_va_list=yes],[wine_cv_builtin_ms_va_list=no])])
test $wine_cv_builtin_ms_va_list != no || AC_MSG_ERROR([You need clang >= 5.0 to build Wine for arm64.])
enable_wow64=${enable_wow64:-yes}
enable_wow64win=${enable_wow64win:-yes}
;;
Expand Down Expand Up @@ -435,7 +430,6 @@ AC_CHECK_HEADERS(\
elf.h \
float.h \
gettext-po.h \
ieeefp.h \
libproc.h \
link.h \
linux/cdrom.h \
Expand Down Expand Up @@ -779,7 +773,7 @@ case $host_os in
LIBS="$ac_save_LIBS"
fi

UNIXLDFLAGS="-dynamiclib -install_name @loader_path/\$(UNIXLIB)"
UNIXLDFLAGS="-dynamiclib -install_name @rpath/\$(UNIXLIB) -Wl,-rpath,@loader_path\/"
AC_SUBST(LIBWINE_SHAREDLIB,"libwine.$libwine_version.dylib")
AC_SUBST(LIBWINE_LDFLAGS,["-dynamiclib -install_name @rpath/libwine.$libwine_soversion.dylib -Wl,-rpath,@loader_path/ -compatibility_version $libwine_soversion -current_version $libwine_version"])
AC_SUBST(WINELOADER_DEPENDS,"wine_info.plist")
Expand Down Expand Up @@ -919,6 +913,23 @@ then
AC_SUBST(DELAYLOADFLAG,["-Wl,-delayload,"])
CFLAGS="$CFLAGS $llvm_cflags"])
fi
AC_MSG_CHECKING([for $CROSSCC option to enable C99 features])
AC_CACHE_VAL([wine_cv_crosscc_c99],
[wine_cv_crosscc_c99=no
for arg in '' '-std=gnu99'
do
CC="$CROSSCC $arg"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([$ac_c_conftest_c99_program])],
[wine_cv_crosscc_c99=$arg],[wine_cv_crosscc_c99=no])
test "x$wine_cv_crosscc_c99" != xno && break
done])
case "x$wine_cv_crosscc_c99" in
x) AC_MSG_RESULT([none needed]) ;;
xno) AC_MSG_RESULT([unsupported]) ;;
x*) AC_MSG_RESULT([$wine_cv_crosscc_c99])
CROSSCC="$CROSSCC $wine_cv_crosscc_c99" ;;
esac

WINE_TRY_CROSSCFLAGS([-fno-strict-aliasing])
dnl clang needs to be told to fail on unknown options
WINE_TRY_CROSSCFLAGS([-Werror=unknown-warning-option],[CFLAGS="$CFLAGS -Werror=unknown-warning-option"])
Expand Down Expand Up @@ -995,6 +1006,10 @@ fi
WINE_NOTICE_WITH(mingw,[test "x$CROSSTARGET" = "x"],
[MinGW compiler not found, cross-compiling PE files won't be supported.])

case $host_cpu in
aarch64*) test "x$CROSSTARGET" != x || AC_MSG_ERROR([PE cross-compilation is required for ARM64, please install clang/llvm-dlltool/lld, or llvm-mingw.]) ;;
esac

dnl **** External libraries ****

if test "x$with_system_dllpath" != "x" -a "$CROSSCC" != "false"
Expand Down Expand Up @@ -1086,6 +1101,27 @@ then
WINE_NOTICE([libxslt ${notice_platform}MinGW development files not found; using bundled version.])
fi

WINE_MINGW_PACKAGE_FLAGS(VKD3D,[libvkd3d libvkd3d-shader],[-lvkd3d -lvkd3d-shader],
[WINE_CHECK_MINGW_HEADER(vkd3d.h)
WINE_CHECK_MINGW_HEADER(vkd3d_shader.h)
if test "$ac_cv_mingw_header_vkd3d_h" = "yes" -a "$ac_cv_mingw_header_vkd3d_shader_h" = "yes"
then
WINE_CHECK_MINGW_LIB(vkd3d,vkd3d_serialize_versioned_root_signature,[:],[:],[$VKD3D_PE_LIBS])
WINE_CHECK_MINGW_LIB(vkd3d-shader,vkd3d_shader_compile,[:],[:],[$VKD3D_PE_LIBS])
if test "$ac_cv_mingw_lib_vkd3d" = "no" -o "$ac_cv_mingw_lib_vkd3d_shader" = "no"
then
VKD3D_PE_CFLAGS=""
VKD3D_PE_LIBS=""
fi
else
VKD3D_PE_CFLAGS=""
VKD3D_PE_LIBS=""
fi])
if test "x$VKD3D_PE_LIBS" = "x"
then
WINE_NOTICE([libvkd3d ${notice_platform}MinGW development files not found; using bundled version.])
fi

WINE_MINGW_PACKAGE_FLAGS(ZLIB,[zlib],[-lz],
[WINE_CHECK_MINGW_HEADER(zlib.h,
[WINE_CHECK_MINGW_LIB(z,inflate,[:],[ZLIB_PE_CFLAGS=""; ZLIB_PE_LIBS=""],[$ZLIB_PE_LIBS])],
Expand All @@ -1104,6 +1140,7 @@ WINE_EXTLIB_FLAGS(LCMS2, lcms2, lcms2, "-I\$(top_srcdir)/libs/lcms2/include")
WINE_EXTLIB_FLAGS(MPG123, mpg123, mpg123, "-I\$(top_srcdir)/libs/mpg123/src/libmpg123")
WINE_EXTLIB_FLAGS(PNG, png, "png \$(ZLIB_PE_LIBS)", "-I\$(top_srcdir)/libs/png")
WINE_EXTLIB_FLAGS(TIFF, tiff, "tiff \$(ZLIB_PE_LIBS)", "-I\$(top_srcdir)/libs/tiff/libtiff")
WINE_EXTLIB_FLAGS(VKD3D, vkd3d, vkd3d, "-I\$(top_srcdir)/libs/vkd3d/include")
WINE_EXTLIB_FLAGS(XML2, xml2, xml2, "-I\$(top_srcdir)/libs/xml2/include -DLIBXML_STATIC")
WINE_EXTLIB_FLAGS(XSLT, xslt, xslt, "-I\$(top_srcdir)/libs/xslt -DLIBXSLT_STATIC")
WINE_EXTLIB_FLAGS(ZLIB, zlib, z, "-I\$(top_srcdir)/libs/zlib -DFAR= -DZ_SOLO")
Expand Down Expand Up @@ -1647,7 +1684,7 @@ then
AC_CHECK_LIB(capi20,capi20_register,[:],[CAPI20_LIBS=""],[$CAPI20_LIBS])
fi])
fi
WINE_NOTICE_WITH(capi,[test "x$ac_cv_lib_capi20_capi20_register" = "x"],
WINE_NOTICE_WITH(capi,[test "x$ac_cv_lib_capi20_capi20_register" != xyes],
[libcapi20 ${notice_platform}development files not found, ISDN won't be supported.],
[enable_capi2032])

Expand Down Expand Up @@ -1771,18 +1808,6 @@ fi
WINE_NOTICE_WITH(vulkan,[test "x$ac_cv_lib_soname_vulkan" = "x" -a "x$ac_cv_lib_soname_MoltenVK" = "x"],
[libvulkan and libMoltenVK ${notice_platform}development files not found, Vulkan won't be supported.])

dnl **** Check for vkd3d ****
if test "x$with_vkd3d" != "xno"
then
WINE_PACKAGE_FLAGS(VKD3D,[libvkd3d],,,,
[WINE_CHECK_SONAME(vkd3d,vkd3d_serialize_versioned_root_signature,,,[$VKD3D_LIBS])])
WINE_PACKAGE_FLAGS(VKD3D_SHADER,[libvkd3d-shader],,,,
[WINE_CHECK_SONAME(vkd3d-shader,vkd3d_shader_compile,,,[$VKD3D_SHADER_LIBS])])
fi
WINE_NOTICE_WITH(vkd3d,[test "x$ac_cv_lib_soname_vkd3d" = "x"],
[vkd3d ${notice_platform}development files not found (or too old), Direct3D 12 won't be supported.])
test "x$ac_cv_lib_soname_vkd3d" != "x" || enable_d3d12=${enable_d3d12:-no}

dnl **** Check for gcc specific options ****

if test "x${GCC}" = "xyes"
Expand Down Expand Up @@ -1893,7 +1918,17 @@ char*f(const char *h,char n) {return strchr(h,n);}]])],[ac_cv_c_logicalop_noisy=
dnl Mingw uses Windows 64-bit types, not Unix ones
cygwin*|mingw32*) WINE_TRY_CFLAGS([-Wno-format]) ;;
dnl Default to ms_abi on 64-bit
*) WINE_TRY_CFLAGS([-mabi=ms],[MSVCRTFLAGS="$MSVCRTFLAGS -mabi=ms"]) ;;
*) if test -z "$CROSSTARGET"
then
AC_CACHE_CHECK([for working -mabi=ms], ac_cv_mabi_ms,
[CFLAGS="$CFLAGS -mabi=ms"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
int a(int b, ...) { __builtin_ms_va_list list; __builtin_ms_va_start(list,b); }]])],
[ac_cv_mabi_ms=yes],[ac_cv_mabi_ms=no])
CFLAGS=$saved_CFLAGS])
test $ac_cv_mabi_ms = yes || AC_MSG_ERROR([The compiler doesn't support -mabi=ms. Use gcc instead of clang, or install mingw-w64.])
fi
MSVCRTFLAGS="$MSVCRTFLAGS -mabi=ms" ;;
esac ;;
esac

Expand Down Expand Up @@ -2234,32 +2269,6 @@ AC_CHECK_MEMBERS([struct sysinfo.totalram, struct sysinfo.mem_unit],,,
# include <sys/sysinfo.h>
#endif])

dnl Check for isfinite
ac_save_LIBS="$LIBS"
LIBS="$LIBS -lm"
AC_CACHE_CHECK([for isfinite], ac_cv_have_isfinite,
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[float f = 0.0; return isfinite(f)]])],[ac_cv_have_isfinite="yes"],[ac_cv_have_isfinite="no"]))
if test "$ac_cv_have_isfinite" = "yes"
then
AC_DEFINE(HAVE_ISFINITE, 1, [Define to 1 if you have the `isfinite' function.])
fi

dnl Check for isinf
AC_CACHE_CHECK([for isinf], ac_cv_have_isinf,
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[float f = 0.0; return isinf(f)]])],[ac_cv_have_isinf="yes"],[ac_cv_have_isinf="no"]))
if test "$ac_cv_have_isinf" = "yes"
then
AC_DEFINE(HAVE_ISINF, 1, [Define to 1 if you have the `isinf' function.])
fi

dnl Check for isnan
AC_CACHE_CHECK([for isnan], ac_cv_have_isnan,
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]], [[float f = 0.0; return isnan(f)]])],[ac_cv_have_isnan="yes"],[ac_cv_have_isnan="no"]))
if test "$ac_cv_have_isnan" = "yes"
then
AC_DEFINE(HAVE_ISNAN, 1, [Define to 1 if you have the `isnan' function.])
fi

LIBS="$ac_save_LIBS"

dnl Check for __builtin_popcount
Expand Down Expand Up @@ -3235,6 +3244,7 @@ WINE_CONFIG_MAKEFILE(libs/strmbase)
WINE_CONFIG_MAKEFILE(libs/strmiids)
WINE_CONFIG_MAKEFILE(libs/tiff)
WINE_CONFIG_MAKEFILE(libs/uuid)
WINE_CONFIG_MAKEFILE(libs/vkd3d)
WINE_CONFIG_MAKEFILE(libs/wbemuuid)
WINE_CONFIG_MAKEFILE(libs/wine)
WINE_CONFIG_MAKEFILE(libs/wmcodecdspuuid)
Expand All @@ -3258,6 +3268,7 @@ WINE_CONFIG_MAKEFILE(programs/conhost/tests)
WINE_CONFIG_MAKEFILE(programs/control)
WINE_CONFIG_MAKEFILE(programs/cscript)
WINE_CONFIG_MAKEFILE(programs/dism)
WINE_CONFIG_MAKEFILE(programs/dllhost)
WINE_CONFIG_MAKEFILE(programs/dplaysvr)
WINE_CONFIG_MAKEFILE(programs/dpnsvr)
WINE_CONFIG_MAKEFILE(programs/dpvsetup)
Expand Down
16 changes: 16 additions & 0 deletions dlls/advapi32/advapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,19 @@ void WINAPI RegisterWaitChainCOMCallback(PCOGETCALLSTATE call_state_cb,
{
FIXME("%p, %p\n", call_state_cb, activation_state_cb);
}

HWCT WINAPI OpenThreadWaitChainSession(DWORD flags, PWAITCHAINCALLBACK callback)
{
FIXME("flags %ld, callback %p stub!\n", flags, callback);
SetLastError(ERROR_NOT_SUPPORTED);
return NULL;
}

BOOL WINAPI GetThreadWaitChain(HWCT handle, DWORD_PTR ctx, DWORD flags, DWORD thread_id, DWORD *node_count,
WAITCHAIN_NODE_INFO *node_info_arr, BOOL *is_cycle)
{
FIXME( "handle %p, ctx %Ix, flags %ld, thread_id %ld, node_count %p, node_info_arr %p, is_cycle %p stub!\n",
handle, ctx, flags, thread_id, node_count, node_info_arr, is_cycle );
SetLastError(ERROR_NOT_SUPPORTED);
return FALSE;
}
4 changes: 2 additions & 2 deletions dlls/advapi32/advapi32.spec
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
@ stdcall -import GetSidSubAuthorityCount(ptr)
@ stub GetSiteSidFromToken
# @ stub GetStringConditionFromBinary
# @ stub GetThreadWaitChain
@ stdcall GetThreadWaitChain(ptr ptr long long ptr ptr ptr)
@ stdcall -import GetTokenInformation(long long ptr long ptr)
@ stdcall GetTraceEnableFlags(int64) ntdll.EtwGetTraceEnableFlags
@ stdcall GetTraceEnableLevel(int64) ntdll.EtwGetTraceEnableLevel
Expand Down Expand Up @@ -548,7 +548,7 @@
@ stdcall -import OpenServiceA(long str long)
@ stdcall -import OpenServiceW(long wstr long)
@ stdcall -import OpenThreadToken(long long long ptr)
# @ stub OpenThreadWaitChainSession
@ stdcall OpenThreadWaitChainSession(long ptr)
@ stdcall -ret64 OpenTraceA(ptr)
@ stdcall -ret64 -import OpenTraceW(ptr)
# @ stub OperationEnd
Expand Down
20 changes: 9 additions & 11 deletions dlls/bcrypt/bcrypt_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ struct key_asymmetric
{
ULONG bitlen; /* ignored for ECC keys */
unsigned flags;
UCHAR *pubkey;
unsigned pubkey_len;
DSSSEED dss_seed;
};

Expand Down Expand Up @@ -268,18 +266,22 @@ struct key_asymmetric_verify_params
unsigned flags;
};

struct key_export_params
#define KEY_EXPORT_FLAG_PUBLIC 0x00000001
#define KEY_EXPORT_FLAG_RSA_FULL 0x00000002
struct key_asymmetric_export_params
{
struct key *key;
ULONG flags;
UCHAR *buf;
ULONG len;
ULONG *ret_len;
BOOL full;
};

struct key_import_params
#define KEY_IMPORT_FLAG_PUBLIC 0x00000001
struct key_asymmetric_import_params
{
struct key *key;
ULONG flags;
UCHAR *buf;
ULONG len;
};
Expand All @@ -300,12 +302,8 @@ enum key_funcs
unix_key_asymmetric_sign,
unix_key_asymmetric_verify,
unix_key_asymmetric_destroy,
unix_key_export_dsa_capi,
unix_key_export_ecc,
unix_key_export_rsa,
unix_key_import_dsa_capi,
unix_key_import_ecc,
unix_key_import_rsa,
unix_key_asymmetric_export,
unix_key_asymmetric_import,
};

#endif /* __BCRYPT_INTERNAL_H */
270 changes: 153 additions & 117 deletions dlls/bcrypt/bcrypt_main.c

Large diffs are not rendered by default.

723 changes: 348 additions & 375 deletions dlls/bcrypt/gnutls.c

Large diffs are not rendered by default.

115 changes: 111 additions & 4 deletions dlls/bcrypt/tests/bcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ static void test_BCryptGenerateSymmetricKey(void)
BCRYPT_KEY_LENGTHS_STRUCT key_lengths;
ULONG size, len, i;
NTSTATUS ret;
DWORD keylen;

ret = BCryptOpenAlgorithmProvider(&aes, BCRYPT_AES_ALGORITHM, NULL, 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
Expand Down Expand Up @@ -706,6 +707,13 @@ static void test_BCryptGenerateSymmetricKey(void)
sizeof(BCRYPT_CHAIN_MODE_CBC), 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);

todo_wine
{
keylen = 512;
ret = BCryptSetProperty(aes, BCRYPT_KEY_LENGTH, (UCHAR *)&keylen, sizeof(keylen), 0);
ok(ret == STATUS_NOT_SUPPORTED, "got %#lx\n", ret);
}

size = 0;
memset(mode, 0, sizeof(mode));
ret = BCryptGetProperty(key, BCRYPT_CHAINING_MODE, mode, sizeof(mode), &size, 0);
Expand Down Expand Up @@ -1845,9 +1853,23 @@ static void test_ECDSA(void)

ecckey->dwMagic = BCRYPT_ECDSA_PUBLIC_P256_MAGIC;
ecckey->cbKey = 32;
status = BCryptImportKeyPair(alg, NULL, BCRYPT_PUBLIC_KEY_BLOB, &key, buffer, size, 0);
ok(!status, "BCryptImportKeyPair failed: %#lx\n", status);
BCryptDestroyKey(key);

status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &key, buffer, size, 0);
ok(!status, "BCryptImportKeyPair failed: %#lx\n", status);

memset(buffer, 0xcc, sizeof(buffer));
status = BCryptExportKey(key, NULL, BCRYPT_ECCPUBLIC_BLOB, buffer, sizeof(buffer), &size, 0);
ok(!status, "Got unexpected status %#lx\n", status);
ok(ecckey->dwMagic == BCRYPT_ECDSA_PUBLIC_P256_MAGIC, "Got unexpected magic %#lx.\n", ecckey->dwMagic);
ok(ecckey->cbKey == 32, "got %lu\n", ecckey->cbKey);
ok(!memcmp(ecckey + 1, eccPubkey, sizeof(eccPubkey)), "Got unexpected key data.\n");

status = BCryptExportKey(key, NULL, BCRYPT_ECCPRIVATE_BLOB, buffer, sizeof(buffer), &size, 0);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx\n", status);

status = BCryptVerifySignature(key, NULL, certHash, sizeof(certHash) - 1, certSignature, sizeof(certSignature), 0);
ok(status == STATUS_INVALID_SIGNATURE, "Expected STATUS_INVALID_SIGNATURE, got %#lx\n", status);

Expand All @@ -1873,6 +1895,14 @@ static void test_ECDSA(void)
status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPRIVATE_BLOB, &key, buffer, size, 0);
ok(!status, "BCryptImportKeyPair failed: %#lx\n", status);

memset( buffer, 0xcc, sizeof(buffer) );
status = BCryptExportKey(key, NULL, BCRYPT_ECCPUBLIC_BLOB, buffer, sizeof(buffer), &size, 0);
ok(!status, "Got unexpected status %#lx\n", status);
ok(ecckey->dwMagic == BCRYPT_ECDSA_PUBLIC_P256_MAGIC, "got %#lx\n", ecckey->dwMagic);
ok(ecckey->cbKey == 32, "got %lu\n", ecckey->cbKey);
ok(!memcmp(ecckey + 1, eccPrivkey, sizeof(eccPubkey)), "Got unexpected key data.\n");

size = sizeof(BCRYPT_ECCKEY_BLOB) + sizeof(eccPrivkey);
memset( buffer, 0, sizeof(buffer) );
status = BCryptExportKey(key, NULL, BCRYPT_ECCPRIVATE_BLOB, buffer, size, &size, 0);
ok(status == STATUS_SUCCESS, "got %#lx\n", status);
Expand Down Expand Up @@ -1971,6 +2001,24 @@ static UCHAR rsaFullPrivateBlob[] =
0x9d, 0xe2, 0xcc, 0x5a, 0xf1, 0x68, 0x30, 0xe5, 0xbc, 0x8d, 0xad,
};


static UCHAR rsaPublicBlobWithInvalidPublicExpSize[] =
{
0x52, 0x53, 0x41, 0x31, 0x00, 0x04, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x01, 0xc7, 0x8f, 0xac, 0x2a, 0xce, 0xbf, 0xc9, 0x6c, 0x7b,
0x85, 0x74, 0x71, 0xbb, 0xff, 0xbb, 0x9b, 0x20, 0x03, 0x79, 0x17, 0x34,
0xe7, 0x26, 0x91, 0x5c, 0x1f, 0x1b, 0x03, 0x3d, 0x46, 0xdf, 0xb6, 0xf2,
0x10, 0x55, 0xf0, 0x39, 0x55, 0x0a, 0xe3, 0x9c, 0x0c, 0x63, 0xc2, 0x14,
0x03, 0x94, 0x51, 0x0d, 0xb4, 0x22, 0x09, 0xf2, 0x5c, 0xb2, 0xd1, 0xc3,
0xac, 0x6f, 0xa8, 0xc4, 0xac, 0xb8, 0xbc, 0x59, 0xe7, 0xed, 0x77, 0x6e,
0xb1, 0x80, 0x58, 0x7d, 0xb2, 0x94, 0x46, 0xe5, 0x00, 0xe2, 0xb7, 0x33,
0x48, 0x7a, 0xd3, 0x78, 0xe9, 0x26, 0x01, 0xc7, 0x00, 0x7b, 0x41, 0x6d,
0x94, 0x3a, 0xe1, 0x50, 0x2b, 0x9f, 0x6b, 0x1c, 0x08, 0xa3, 0xfc, 0x0a,
0x44, 0x81, 0x09, 0x41, 0x80, 0x23, 0x7b, 0xf6, 0x3f, 0xaf, 0x91, 0xa1,
0x87, 0x75, 0x33, 0x15, 0xb8, 0xde, 0x32, 0x30, 0xb4, 0x5e, 0xfd
};

static void test_RSA(void)
{
static UCHAR hash[] =
Expand All @@ -1983,6 +2031,7 @@ static void test_RSA(void)
ULONG len, size, size2, schemes;
NTSTATUS ret;
BYTE *buf;
DWORD keylen;

ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_RSA_ALGORITHM, NULL, 0);
if (ret)
Expand All @@ -1997,6 +2046,10 @@ static void test_RSA(void)
ok(schemes, "schemes not set\n");
ok(size == sizeof(schemes), "got %lu\n", size);

ret = BCryptImportKeyPair(alg, NULL, BCRYPT_PUBLIC_KEY_BLOB, &key, rsaPublicBlob, sizeof(rsaPublicBlob), 0);
ok(!ret, "BCryptImportKeyPair failed: %#lx\n", ret);
BCryptDestroyKey(key);

ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPUBLIC_BLOB, &key, rsaPublicBlob, sizeof(rsaPublicBlob), 0);
ok(!ret, "BCryptImportKeyPair failed: %#lx\n", ret);

Expand Down Expand Up @@ -2026,12 +2079,21 @@ static void test_RSA(void)
ok(!ret, "BCryptDestroyKey failed: %#lx\n", ret);

/* sign/verify with export/import round-trip */
ret = BCryptGenerateKeyPair(alg, &key, 512, 0);
ret = BCryptGenerateKeyPair(alg, &key, 1024, 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);

keylen = 512;
ret = BCryptSetProperty(key, BCRYPT_KEY_LENGTH, (UCHAR *)&keylen, 2, 0);
ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);
ret = BCryptSetProperty(key, BCRYPT_KEY_LENGTH, (UCHAR *)&keylen, sizeof(keylen), 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);

ret = BCryptFinalizeKeyPair(key, 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);

ret = BCryptSetProperty(key, BCRYPT_KEY_LENGTH, (UCHAR *)&keylen, sizeof(keylen), 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);

pad.pszAlgId = BCRYPT_SHA1_ALGORITHM;
memset(sig, 0, sizeof(sig));
ret = BCryptSignHash(key, &pad, hash, sizeof(hash), sig, sizeof(sig), &len, BCRYPT_PAD_PKCS1);
Expand Down Expand Up @@ -2076,7 +2138,7 @@ static void test_RSA(void)
ok(size == size2, "got %lu expected %lu\n", size2, size);
HeapFree(GetProcessHeap(), 0, buf);

/* export public key */
/* import/export public key */
size = 0;
ret = BCryptExportKey(key, NULL, BCRYPT_RSAPUBLIC_BLOB, NULL, 0, &size, 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
Expand All @@ -2096,6 +2158,10 @@ static void test_RSA(void)
ret = BCryptDestroyKey(key);
ok(!ret, "got %#lx\n", ret);

ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPUBLIC_BLOB, &key, rsaPublicBlobWithInvalidPublicExpSize,
sizeof(rsaPublicBlobWithInvalidPublicExpSize), 0);
ok(ret == NTE_BAD_DATA, "got %#lx\n", ret);

ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPUBLIC_BLOB, &key, buf, size, 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);
HeapFree(GetProcessHeap(), 0, buf);
Expand All @@ -2109,6 +2175,9 @@ static void test_RSA(void)
ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPRIVATE_BLOB, &key, rsaPrivateBlob, sizeof(rsaPrivateBlob), 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);

ret = BCryptFinalizeKeyPair(key, 0);
ok(ret == STATUS_INVALID_HANDLE, "got %#lx\n", ret);

size = 0;
buf = HeapAlloc(GetProcessHeap(), 0, sizeof(rsaPrivateBlob));
ret = BCryptExportKey(key, NULL, BCRYPT_RSAPRIVATE_BLOB, buf, sizeof(rsaPrivateBlob), &size, 0);
Expand Down Expand Up @@ -2143,7 +2212,7 @@ static void test_RSA_SIGN(void)
BCRYPT_RSAKEY_BLOB *rsablob;
NTSTATUS ret;
ULONG size, size2;
BYTE *buf;
BYTE *buf, buf2[sizeof(BCRYPT_RSAKEY_BLOB) + sizeof(rsaPublicBlob)];

ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_RSA_SIGN_ALGORITHM, NULL, 0);
if (ret)
Expand All @@ -2155,6 +2224,22 @@ static void test_RSA_SIGN(void)
ret = BCryptImportKeyPair(alg, NULL, BCRYPT_RSAPUBLIC_BLOB, &key, rsaPublicBlob, sizeof(rsaPublicBlob), 0);
ok(!ret, "BCryptImportKeyPair failed: %#lx\n", ret);

memset(buf2, 0xcc, sizeof(buf2));
ret = BCryptExportKey(key, NULL, BCRYPT_RSAPUBLIC_BLOB, buf2, sizeof(buf2), &size, 0);
ok(!ret, "got %#lx\n", ret);
rsablob = (BCRYPT_RSAKEY_BLOB *)buf2;
ok(rsablob->Magic == BCRYPT_RSAPUBLIC_MAGIC, "got %#lx\n", rsablob->Magic);
ok(rsablob->BitLength == 2048, "got %lu\n", rsablob->BitLength);
ok(rsablob->cbPublicExp == 3, "got %lu\n", rsablob->cbPublicExp);
ok(rsablob->cbModulus == 256, "got %lu\n", rsablob->cbModulus);
ok(rsablob->cbPrime1 == 0, "got %lu\n", rsablob->cbPrime1);
ok(rsablob->cbPrime2 == 0, "got %lu\n", rsablob->cbPrime2);
size2 = sizeof(*rsablob) + rsablob->cbPublicExp + rsablob->cbModulus + rsablob->cbPrime1 + rsablob->cbPrime2;
ok(size == size2, "got %lu expected %lu\n", size2, size);

ret = BCryptExportKey(key, NULL, BCRYPT_RSAPRIVATE_BLOB, buf2, sizeof(buf2), &size, 0);
ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);

pad.pszAlgId = BCRYPT_SHA1_ALGORITHM;
ret = BCryptVerifySignature(key, &pad, rsaHash, sizeof(rsaHash), rsaSignature, sizeof(rsaSignature), BCRYPT_PAD_PKCS1);
ok(!ret, "BCryptVerifySignature failed: %#lx\n", ret);
Expand Down Expand Up @@ -2317,6 +2402,10 @@ static void test_ECDH(void)
ok(ecckey->cbKey == 32, "got %lu\n", ecckey->cbKey);
ok(size == sizeof(*ecckey) + ecckey->cbKey * 2, "got %lu\n", size);

status = BCryptImportKeyPair(alg, NULL, BCRYPT_PUBLIC_KEY_BLOB, &pubkey, buf, size, 0);
ok(status == STATUS_SUCCESS, "got %#lx\n", status);
BCryptDestroyKey(pubkey);

status = BCryptImportKeyPair(alg, NULL, BCRYPT_ECCPUBLIC_BLOB, &pubkey, buf, size, 0);
ok(status == STATUS_SUCCESS, "got %#lx\n", status);
HeapFree(GetProcessHeap(), 0, buf);
Expand Down Expand Up @@ -2513,6 +2602,9 @@ static void test_BCryptSignHash(void)
ret = BCryptFinalizeKeyPair(key, 0);
ok(ret == STATUS_SUCCESS, "got %#lx\n", ret);

ret = BCryptFinalizeKeyPair(key, 0);
ok(ret == STATUS_INVALID_HANDLE, "got %#lx\n", ret);

len = 0;
memset(sig, 0, sizeof(sig));

Expand Down Expand Up @@ -2810,17 +2902,32 @@ static void test_DSA(void)
UCHAR sig[40], schemes;
ULONG len, size;
NTSTATUS ret;
BYTE *buf;
BYTE *buf, buf2[sizeof(BCRYPT_DSA_KEY_BLOB) + sizeof(dsaPublicBlob)];

ret = BCryptOpenAlgorithmProvider(&alg, BCRYPT_DSA_ALGORITHM, NULL, 0);
ok(!ret, "got %#lx\n", ret);

ret = BCryptGetProperty(alg, L"PaddingSchemes", (UCHAR *)&schemes, sizeof(schemes), &size, 0);
ok(ret == STATUS_NOT_SUPPORTED, "got %#lx\n", ret);

ret = BCryptImportKeyPair(alg, NULL, BCRYPT_PUBLIC_KEY_BLOB, &key, dsaPublicBlob, sizeof(dsaPublicBlob), 0);
ok(!ret, "got %#lx\n", ret);
BCryptDestroyKey(key);

ret = BCryptImportKeyPair(alg, NULL, BCRYPT_DSA_PUBLIC_BLOB, &key, dsaPublicBlob, sizeof(dsaPublicBlob), 0);
ok(!ret, "got %#lx\n", ret);

memset(buf2, 0xcc, sizeof(buf2));
ret = BCryptExportKey(key, NULL, BCRYPT_DSA_PUBLIC_BLOB, buf2, sizeof(buf2), &size, 0);
ok(!ret, "got %#lx\n", ret);
dsablob = (BCRYPT_DSA_KEY_BLOB *)buf2;
ok(dsablob->dwMagic == BCRYPT_DSA_PUBLIC_MAGIC, "got %#lx\n", dsablob->dwMagic);
ok(dsablob->cbKey == 64, "got %lu\n", dsablob->cbKey);
ok(size == sizeof(*dsablob) + dsablob->cbKey * 3, "got %lu\n", size);

ret = BCryptExportKey(key, NULL, BCRYPT_DSA_PRIVATE_BLOB, buf2, sizeof(buf2), &size, 0);
todo_wine ok(ret == STATUS_INVALID_PARAMETER, "got %#lx\n", ret);

ret = BCryptVerifySignature(key, NULL, dsaHash, sizeof(dsaHash), dsaSignature, sizeof(dsaSignature), 0);
ok(!ret, "got %#lx\n", ret);

Expand Down
18 changes: 12 additions & 6 deletions dlls/combase/combase.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ HRESULT open_key_for_clsid(REFCLSID clsid, const WCHAR *keyname, REGSAM access,

lstrcpyW(path, clsidW);
StringFromGUID2(clsid, path + lstrlenW(clsidW), CHARS_IN_GUID);
res = open_classes_key(HKEY_CLASSES_ROOT, path, keyname ? KEY_READ : access, &key);
res = open_classes_key(HKEY_CLASSES_ROOT, path, access, &key);
if (res == ERROR_FILE_NOT_FOUND)
return REGDB_E_CLASSNOTREG;
else if (res != ERROR_SUCCESS)
Expand Down Expand Up @@ -350,7 +350,7 @@ HRESULT open_appidkey_from_clsid(REFCLSID clsid, REGSAM access, HKEY *subkey)
HRESULT hr;

/* read the AppID value under the class's key */
hr = open_key_for_clsid(clsid, NULL, KEY_READ, &hkey);
hr = open_key_for_clsid(clsid, NULL, access, &hkey);
if (FAILED(hr))
return hr;

Expand Down Expand Up @@ -1249,6 +1249,8 @@ HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *progi
ACTCTX_SECTION_KEYED_DATA data;
LONG progidlen = 0;
HKEY hkey;
REGSAM opposite = (sizeof(void *) > sizeof(int)) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY;
BOOL is_wow64;
HRESULT hr;

if (!progid)
Expand Down Expand Up @@ -1277,8 +1279,12 @@ HRESULT WINAPI DECLSPEC_HOTPATCH ProgIDFromCLSID(REFCLSID clsid, LPOLESTR *progi
}

hr = open_key_for_clsid(clsid, L"ProgID", KEY_READ, &hkey);
if (FAILED(hr))
return hr;
if (FAILED(hr) && (opposite == KEY_WOW64_32KEY || (IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64)))
{
hr = open_key_for_clsid(clsid, L"ProgID", opposite | KEY_READ, &hkey);
if (FAILED(hr))
return hr;
}

if (RegQueryValueW(hkey, NULL, NULL, &progidlen))
hr = REGDB_E_CLASSNOTREG;
Expand Down Expand Up @@ -2320,9 +2326,9 @@ HRESULT WINAPI CoGetPSClsid(REFIID riid, CLSID *pclsid)
StringFromGUID2(riid, path + ARRAY_SIZE(interfaceW) - 1, CHARS_IN_GUID);
lstrcpyW(path + ARRAY_SIZE(interfaceW) - 1 + CHARS_IN_GUID - 1, psW);

hr = get_ps_clsid_from_registry(path, 0, pclsid);
hr = get_ps_clsid_from_registry(path, KEY_READ, pclsid);
if (FAILED(hr) && (opposite == KEY_WOW64_32KEY || (IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64)))
hr = get_ps_clsid_from_registry(path, opposite, pclsid);
hr = get_ps_clsid_from_registry(path, opposite | KEY_READ, pclsid);

if (hr == S_OK)
TRACE("() Returning CLSID %s\n", debugstr_guid(pclsid));
Expand Down
2 changes: 1 addition & 1 deletion dlls/combase/combase.spec
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
@ stub RoReportUnhandledError
@ stub RoResolveRestrictedErrorInfoReference
@ stub RoRevokeActivationFactories
@ stub RoSetErrorReportingFlags
@ stdcall RoSetErrorReportingFlags(long)
@ stub RoTransformError
@ stub RoTransformErrorW
@ stdcall RoUninitialize()
Expand Down
9 changes: 9 additions & 0 deletions dlls/combase/roapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,15 @@ BOOL WINAPI RoOriginateError(HRESULT error, HSTRING message)
return FALSE;
}

/***********************************************************************
* RoSetErrorReportingFlags (combase.@)
*/
HRESULT WINAPI RoSetErrorReportingFlags(UINT32 flags)
{
FIXME("(%08x): stub\n", flags);
return S_OK;
}

/***********************************************************************
* CleanupTlsOleState (combase.@)
*/
Expand Down
75 changes: 74 additions & 1 deletion dlls/combase/rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,78 @@ static HRESULT create_server(REFCLSID rclsid, HANDLE *process)
return S_OK;
}

static HRESULT create_surrogate_server(REFCLSID rclsid, HANDLE *process)
{
static const WCHAR processidW[] = L" /PROCESSID:";
HKEY key;
int arch = (sizeof(void *) > sizeof(int)) ? 64 : 32;
REGSAM opposite = (arch == 64) ? KEY_WOW64_32KEY : KEY_WOW64_64KEY;
BOOL is_wow64 = FALSE;
HRESULT hr;
WCHAR command[MAX_PATH + ARRAY_SIZE(processidW) + CHARS_IN_GUID];
DWORD size;
STARTUPINFOW si;
PROCESS_INFORMATION pi;
LONG ret;

TRACE("Attempting to start surrogate server for %s\n", debugstr_guid(rclsid));

hr = open_appidkey_from_clsid(rclsid, KEY_READ, &key);
if (FAILED(hr) && (arch == 64 || (IsWow64Process(GetCurrentProcess(), &is_wow64) && is_wow64)))
{
hr = open_appidkey_from_clsid(rclsid, opposite | KEY_READ, &key);
if (FAILED(hr)) return hr;
}

size = (MAX_PATH + 1) * sizeof(WCHAR);
ret = RegQueryValueExW(key, L"DllSurrogate", NULL, NULL, (LPBYTE)command, &size);
RegCloseKey(key);
if (ret || !size || !command[0])
{
TRACE("No value for DllSurrogate key\n");

if ((sizeof(void *) == 8 || is_wow64) && opposite == KEY_WOW64_32KEY)
GetSystemWow64DirectoryW(command, MAX_PATH - ARRAY_SIZE(L"\\dllhost.exe"));
else
GetSystemDirectoryW(command, MAX_PATH - ARRAY_SIZE(L"\\dllhost.exe"));

wcscat(command, L"\\dllhost.exe");
}

/* Surrogate EXE servers are started with the /PROCESSID:{GUID} switch. */
wcscat(command, processidW);
StringFromGUID2(rclsid, command + wcslen(command), CHARS_IN_GUID);

memset(&si, 0, sizeof(si));
si.cb = sizeof(si);

TRACE("Activating surrogate local server %s\n", debugstr_w(command));

if (is_wow64 && arch == 64)
{
void *cookie;
Wow64DisableWow64FsRedirection(&cookie);
if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi))
{
WARN("failed to run surrogate local server %s\n", debugstr_w(command));
hr = HRESULT_FROM_WIN32(GetLastError());
}
Wow64RevertWow64FsRedirection(cookie);
}
else if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, DETACHED_PROCESS, NULL, NULL, &si, &pi))
{
WARN("failed to run surrogate local server %s\n", debugstr_w(command));
hr = HRESULT_FROM_WIN32(GetLastError());
}

if (FAILED(hr)) return hr;

*process = pi.hProcess;
CloseHandle(pi.hThread);

return S_OK;
}

HRESULT rpc_get_local_class_object(REFCLSID rclsid, REFIID riid, void **obj)
{
PMInterfacePointer objref = NULL;
Expand All @@ -546,7 +618,8 @@ HRESULT rpc_get_local_class_object(REFCLSID rclsid, REFIID riid, void **obj)

if (tries == 1)
{
if ((hr = create_local_service(rclsid)) && (hr = create_server(rclsid, &process)) )
if ((hr = create_local_service(rclsid)) && (hr = create_server(rclsid, &process)) &&
(hr = create_surrogate_server(rclsid, &process)) )
return hr;
}

Expand Down
11 changes: 11 additions & 0 deletions dlls/comctl32/static.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,17 @@ static HBITMAP create_alpha_bitmap( HBITMAP hbitmap )
DeleteObject( alpha );
alpha = 0;
}
else
{
/* pre-multiply by alpha */
for (i = 0, ptr = bits; i < bm.bmWidth * bm.bmHeight; i++, ptr += 4)
{
unsigned int alpha = ptr[3];
ptr[0] = (ptr[0] * alpha + 127) / 255;
ptr[1] = (ptr[1] * alpha + 127) / 255;
ptr[2] = (ptr[2] * alpha + 127) / 255;
}
}
}

DeleteDC( hdc );
Expand Down
1 change: 0 additions & 1 deletion dlls/comctl32/tests/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = comctl32.dll
IMPORTS = ole32 user32 gdi32 advapi32

Expand Down
4 changes: 2 additions & 2 deletions dlls/comctl32/tests/animate.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ static void test_play(void)
res = SendMessageA(hAnimateWnd, ACM_OPENA,(WPARAM)shell32, MAKEINTRESOURCE(INVALID_AVI_INDEX));
err = GetLastError();
ok(res == 0, "Invalid video should have failed\n");
ok(err == ERROR_RESOURCE_NAME_NOT_FOUND, "Expected 1814, got %u\n", err);
ok(err == ERROR_RESOURCE_NAME_NOT_FOUND, "Expected 1814, got %lu\n", err);

SetLastError(0xdeadbeef);
res = SendMessageA(hAnimateWnd, ACM_PLAY, (WPARAM) -1, MAKELONG(0, -1));
err = GetLastError();
ok(res == 0, "Play should have failed\n");
ok(err == 0xdeadbeef, "Expected 0xdeadbeef, got %u\n", err);
ok(err == 0xdeadbeef, "Expected 0xdeadbeef, got %lu\n", err);
destroy_animate();

create_animate(0, 0);
Expand Down
198 changes: 99 additions & 99 deletions dlls/comctl32/tests/button.c

Large diffs are not rendered by default.

114 changes: 57 additions & 57 deletions dlls/comctl32/tests/combo.c

Large diffs are not rendered by default.

62 changes: 31 additions & 31 deletions dlls/comctl32/tests/datetime.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
#include "msg.h"
#include "v6util.h"

#define expect(EXPECTED, GOT) ok((GOT)==(EXPECTED), "Expected %d, got %ld\n", (EXPECTED), (GOT))
#define expect(EXPECTED, GOT) ok((GOT)==(EXPECTED), "Expected %d, got %Id\n", (EXPECTED), (GOT))

#define expect_unsuccess(EXPECTED, GOT) ok((GOT)==(EXPECTED), "Expected %d(unsuccessful), got %ld(successful)\n", (EXPECTED), (GOT))
#define expect_unsuccess(EXPECTED, GOT) ok((GOT)==(EXPECTED), "Expected %d(unsuccessful), got %Id(successful)\n", (EXPECTED), (GOT))

#define NUM_MSG_SEQUENCES 1
#define DATETIME_SEQ_INDEX 0
Expand Down Expand Up @@ -220,17 +220,17 @@ static void test_mccolor_types(HWND hWndDateTime, int mccolor_type, const char*

theColor=RGB(0,0,0);
crColor = SendMessageA(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor);
ok(crColor != ~0u, "%s: Set RGB(0,0,0): Expected COLORREF of previous value, got %d\n", mccolor_name, crColor);
ok(crColor != ~0u, "%s: Set RGB(0,0,0): Expected COLORREF of previous value, got %ld\n", mccolor_name, crColor);
prevColor=theColor;
theColor=RGB(255,255,255);
crColor = SendMessageA(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor);
ok(crColor==prevColor, "%s: Set RGB(255,255,255): Expected COLORREF of previous value, got %d\n", mccolor_name, crColor);
ok(crColor==prevColor, "%s: Set RGB(255,255,255): Expected COLORREF of previous value, got %ld\n", mccolor_name, crColor);
prevColor=theColor;
theColor=RGB(100,180,220);
crColor = SendMessageA(hWndDateTime, DTM_SETMCCOLOR, mccolor_type, theColor);
ok(crColor==prevColor, "%s: Set RGB(100,180,220): Expected COLORREF of previous value, got %d\n", mccolor_name, crColor);
ok(crColor==prevColor, "%s: Set RGB(100,180,220): Expected COLORREF of previous value, got %ld\n", mccolor_name, crColor);
crColor = SendMessageA(hWndDateTime, DTM_GETMCCOLOR, mccolor_type, 0);
ok(crColor==theColor, "%s: GETMCCOLOR: Expected %d, got %d\n", mccolor_name, theColor, crColor);
ok(crColor==theColor, "%s: GETMCCOLOR: Expected %ld, got %ld\n", mccolor_name, theColor, crColor);
}

static void test_dtm_set_and_get_mccolor(void)
Expand Down Expand Up @@ -282,7 +282,7 @@ static void test_dtm_get_monthcal(void)

todo_wine {
r = SendMessageA(hWnd, DTM_GETMONTHCAL, 0, 0);
ok(r == 0, "Expected NULL(no child month calendar control), got %ld\n", r);
ok(r == 0, "Expected NULL(no child month calendar control), got %Id\n", r);
}

ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_get_monthcal_seq, "test_dtm_get_monthcal", FALSE);
Expand Down Expand Up @@ -348,7 +348,7 @@ static void test_dtm_set_and_get_range(void)
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN, (LPARAM)st);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == GDTR_MIN, "Expected %x, not %x(GDTR_MAX) or %x(GDTR_MIN | GDTR_MAX), got %lx\n", GDTR_MIN, GDTR_MAX, GDTR_MIN | GDTR_MAX, r);
ok(r == GDTR_MIN, "Expected %x, not %x(GDTR_MAX) or %x(GDTR_MIN | GDTR_MAX), got %Ix\n", GDTR_MIN, GDTR_MAX, GDTR_MIN | GDTR_MAX, r);
expect_systime(&st[0], &getSt[0]);

r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MAX, (LPARAM)st);
Expand All @@ -362,7 +362,7 @@ static void test_dtm_set_and_get_range(void)
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == GDTR_MAX, "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MIN | GDTR_MAX), got %lx\n", GDTR_MAX, GDTR_MIN, GDTR_MIN | GDTR_MAX, r);
ok(r == GDTR_MAX, "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MIN | GDTR_MAX), got %Ix\n", GDTR_MAX, GDTR_MIN, GDTR_MIN | GDTR_MAX, r);
expect_systime(&st[1], &getSt[1]);

r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN, (LPARAM)st);
Expand All @@ -376,7 +376,7 @@ static void test_dtm_set_and_get_range(void)
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
expect_systime(&st[0], &getSt[0]);
expect_systime(&st[1], &getSt[1]);

Expand All @@ -388,7 +388,7 @@ static void test_dtm_set_and_get_range(void)
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
expect_systime(&st[0], &getSt[0]);
expect_systime(&st[1], &getSt[1]);

Expand All @@ -400,17 +400,17 @@ static void test_dtm_set_and_get_range(void)
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
expect_systime(&st[0], &getSt[0]);
expect_systime(&st[1], &getSt[1]);

ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_set_and_get_range_seq, "test_dtm_set_and_get_range", FALSE);

/* DTM_SETRANGE with 0 flags */
r = SendMessageA(hWnd, DTM_SETRANGE, 0, (LPARAM)st);
ok(r, "got %lu\n", r);
ok(r, "got %Iu\n", r);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == 0, "got %lu\n", r);
ok(r == 0, "got %Iu\n", r);
ok(getSt[0].wYear == 0 && getSt[1].wYear == 0, "got %u, %u\n", getSt[0].wYear, getSt[1].wYear);

DestroyWindow(hWnd);
Expand All @@ -435,7 +435,7 @@ static void test_dtm_set_range_swap_min_max(void)
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&origSt);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
expect_systime(&st[0], &origSt);

/* set st[0] to value higher than st[1] */
Expand All @@ -447,7 +447,7 @@ static void test_dtm_set_range_swap_min_max(void)
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
todo_wine {
ok(compare_systime(&st[0], &getSt[0]) == 1 ||
broken(compare_systime(&st[0], &getSt[1]) == 1), /* comctl32 version <= 5.80 */
Expand All @@ -463,7 +463,7 @@ static void test_dtm_set_range_swap_min_max(void)
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
/* the time part seems to not change after swapping the min and max values
and doing DTM_SETSYSTEMTIME */
expect_systime_date(&st[0], &getSt[0]);
Expand All @@ -484,7 +484,7 @@ static void test_dtm_set_range_swap_min_max(void)
whenever we do a DTM_SETRANGE, the DTM_GETRANGE will return the values
swapped*/
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
todo_wine {
ok(compare_systime(&st[0], &getSt[1]) == 1 ||
broken(compare_systime(&st[0], &getSt[0]) == 1), /* comctl32 version <= 5.80 */
Expand All @@ -504,7 +504,7 @@ static void test_dtm_set_range_swap_min_max(void)
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
expect_systime(&st[0], &getSt[1]);
expect_systime(&st[1], &getSt[0]);

Expand All @@ -516,7 +516,7 @@ static void test_dtm_set_range_swap_min_max(void)
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
expect_systime(&st[0], &getSt[0]);
expect_systime(&st[1], &getSt[1]);

Expand Down Expand Up @@ -544,7 +544,7 @@ static void test_dtm_set_and_get_system_time(void)
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_NONE, (LPARAM)&st);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
ok(r == GDT_NONE, "Expected %d, not %d(GDT_VALID) or %d(GDT_ERROR), got %ld\n", GDT_NONE, GDT_VALID, GDT_ERROR, r);
ok(r == GDT_NONE, "Expected %d, not %d(GDT_VALID) or %d(GDT_ERROR), got %Id\n", GDT_NONE, GDT_VALID, GDT_ERROR, r);

/* set st to lowest possible value */
fill_systime_struct(&st, 1601, 1, 0, 1, 0, 0, 0, 0);
Expand All @@ -564,7 +564,7 @@ static void test_dtm_set_and_get_system_time(void)
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
expect_systime(&st, &getSt);

/* set st to invalid value */
Expand Down Expand Up @@ -687,7 +687,7 @@ static void test_dtm_set_and_get_systemtime_with_limits(void)
r = SendMessageA(hWnd, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETRANGE, 0, (LPARAM)getSt);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
ok(r == (GDTR_MIN | GDTR_MAX), "Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %Ix\n", (GDTR_MIN | GDTR_MAX), GDTR_MIN, GDTR_MAX, r);
expect_systime(&st[0], &getSt[0]);
expect_systime(&st[1], &getSt[1]);

Expand All @@ -696,7 +696,7 @@ static void test_dtm_set_and_get_systemtime_with_limits(void)
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&refSt);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
expect_systime(&refSt, &getSt[0]);

/* Now set an out-of-bounds time */
Expand All @@ -705,15 +705,15 @@ static void test_dtm_set_and_get_systemtime_with_limits(void)
r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
expect_systime(&refSt, &getSt[0]);

fill_systime_struct(&st[0], 1977, 1, 0, 1, 0, 0, 0, 0);

r = SendMessageA(hWnd, DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM)&st[0]);
expect(1, r);
r = SendMessageA(hWnd, DTM_GETSYSTEMTIME, 0, (LPARAM)&getSt[0]);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
ok(r == GDT_VALID, "Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %Id\n", GDT_VALID, GDT_NONE, GDT_ERROR, r);
expect_systime(&refSt, &getSt[0]);

ok_sequence(sequences, DATETIME_SEQ_INDEX, test_dtm_set_and_get_systime_with_limits, "test_dtm_set_and_get_systime_with_limits", FALSE);
Expand Down Expand Up @@ -755,7 +755,7 @@ static void test_dtm_get_ideal_size(void)
r = SendMessageA(hwnd, DTM_GETIDEALSIZE, 0, (LPARAM)&size);
ok(r, "Expect DTM_GETIDEALSIZE message to return true\n");
ok(size.cx > 0 && size.cy >= tm.tmHeight,
"Expect size.cx > 0 and size.cy >= %d, got cx:%d cy:%d\n", tm.tmHeight, size.cx, size.cy);
"Expect size.cx > 0 and size.cy >= %ld, got cx:%ld cy:%ld\n", tm.tmHeight, size.cx, size.cy);

DestroyWindow(hwnd);
DeleteObject(hfont);
Expand All @@ -775,7 +775,7 @@ static void test_wm_set_get_text(void)
ok(CB_ERR == ret ||
broken(0 == ret) || /* comctl32 <= 4.72 */
broken(1 == ret), /* comctl32 <= 4.70 */
"Expected CB_ERR, got %ld\n", ret);
"Expected CB_ERR, got %Id\n", ret);

buff[0] = 0;
ret = SendMessageA(hWnd, WM_GETTEXT, sizeof(buff), (LPARAM)buff);
Expand All @@ -785,20 +785,20 @@ static void test_wm_set_get_text(void)
SetLastError(0xdeadbeef);
ret = GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_ICALENDARTYPE, caltype, 3);
if (ret == 0)
skip("Must know local calendar type (%x)\n", GetLastError());
skip("Must know local calendar type (%lx)\n", GetLastError());
else if (atoi(caltype) != CAL_GREGORIAN)
skip("DateTimePicker Control only supports Gregorian calendar (type: %s)\n", caltype);
else {
SetLastError(0xdeadbeef);
ret = GetDateFormatA(LOCALE_USER_DEFAULT, 0, NULL, NULL, time, sizeof(time));
if (ret == 0)
skip("GetDateFormat failed, returned %ld, error %d\n", ret, GetLastError());
skip("GetDateFormat failed, returned %Id, error %ld\n", ret, GetLastError());
else
{
ok(!strcmp(buff, time), "Expected %s, got %s\n", time, buff);

ret = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0);
ok(ret == strlen(time), "Got wrong length: %ld, expected %d.\n", ret, strlen(time));
ok(ret == strlen(time), "Got wrong length: %Id, expected %Id.\n", ret, strlen(time));
}
}

Expand Down
72 changes: 38 additions & 34 deletions dlls/comctl32/tests/dpa.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
#include "wine/test.h"
#include "v6util.h"

#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
#define expect(expected,got) expect_(__LINE__, expected, got)
static inline void expect_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
}

typedef struct _STREAMDATA
{
Expand Down Expand Up @@ -92,13 +96,13 @@ static void init_functions(void)
/* Callbacks */
static INT CALLBACK CB_CmpLT(PVOID p1, PVOID p2, LPARAM lp)
{
ok(lp == 0x1abe11ed, "lp=%ld\n", lp);
ok(lp == 0x1abe11ed, "lp=%Id\n", lp);
return p1 < p2 ? -1 : p1 > p2 ? 1 : 0;
}

static INT CALLBACK CB_CmpGT(PVOID p1, PVOID p2, LPARAM lp)
{
ok(lp == 0x1abe11ed, "lp=%ld\n", lp);
ok(lp == 0x1abe11ed, "lp=%Id\n", lp);
return p1 > p2 ? -1 : p1 < p2 ? 1 : 0;
}

Expand All @@ -111,14 +115,14 @@ static INT nMessages[4];
static PVOID CALLBACK CB_MergeInsertSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp)
{
nMessages[op]++;
ok(lp == 0x1abe11ed, "lp=%ld\n", lp);
ok(lp == 0x1abe11ed, "lp=%Id\n", lp);
return p1;
}

static PVOID CALLBACK CB_MergeDeleteOddSrc(UINT op, PVOID p1, PVOID p2, LPARAM lp)
{
nMessages[op]++;
ok(lp == 0x1abe11ed, "lp=%ld\n", lp);
ok(lp == 0x1abe11ed, "lp=%Id\n", lp);
return ((PCHAR)p2)+1;
}

Expand Down Expand Up @@ -205,12 +209,12 @@ static void test_dpa(void)

GetSystemInfo(&si);
hHeap = HeapCreate(0, 1, 2);
ok(hHeap != NULL, "error=%d\n", GetLastError());
ok(hHeap != NULL, "error=%ld\n", GetLastError());
dpa3 = pDPA_CreateEx(0, hHeap);
ok(dpa3 != NULL, "\n");
ret = pDPA_Grow(dpa3, si.dwPageSize + 1);
ok(!ret && GetLastError() == ERROR_NOT_ENOUGH_MEMORY,
"ret=%d error=%d\n", ret, GetLastError());
"ret=%d error=%ld\n", ret, GetLastError());

dpa = pDPA_Create(0);
ok(dpa != NULL, "\n");
Expand All @@ -220,7 +224,7 @@ static void test_dpa(void)
/* Fill the created gap */
ok(pDPA_SetPtr(dpa, 0, (PVOID)5), "\n");
rc=CheckDPA(dpa, 0x56, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);

/* Prepend item */
ret = pDPA_InsertPtr(dpa, 1, (PVOID)1);
Expand All @@ -236,7 +240,7 @@ static void test_dpa(void)
ok(ret == 5, "ret=%d\n", ret);

rc=CheckDPA(dpa, 0x516324, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);

for(i = 1; i <= 6; i++)
{
Expand All @@ -250,28 +254,28 @@ static void test_dpa(void)
/* Sort DPA */
ok(pDPA_Sort(dpa, CB_CmpGT, 0x1abe11ed), "\n");
rc=CheckDPA(dpa, 0x654321, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);

/* Clone into a new DPA */
dpa2 = pDPA_Clone(dpa, NULL);
ok(dpa2 != NULL, "\n");
/* The old data should have been preserved */
rc=CheckDPA(dpa2, 0x654321, &dw2);
ok(rc, "dw=0x%x\n", dw2);
ok(rc, "dw=0x%lx\n", dw2);
ok(pDPA_Sort(dpa, CB_CmpLT, 0x1abe11ed), "\n");

/* Test if the DPA itself was really copied */
rc=CheckDPA(dpa, 0x123456, &dw);
ok(rc, "dw=0x%x\n", dw );
ok(rc, "dw=0x%lx\n", dw );
rc=CheckDPA(dpa2, 0x654321, &dw2);
ok(rc, "dw2=0x%x\n", dw2);
ok(rc, "dw2=0x%lx\n", dw2);

/* Clone into an old DPA */
SetLastError(ERROR_SUCCESS);
p = pDPA_Clone(dpa, dpa3);
ok(p == dpa3, "p=%p\n", p);
rc=CheckDPA(dpa3, 0x123456, &dw3);
ok(rc, "dw3=0x%x\n", dw3);
ok(rc, "dw3=0x%lx\n", dw3);

for(i = 1; i <= 6; i++)
{
Expand Down Expand Up @@ -305,7 +309,7 @@ static void test_dpa(void)
p = pDPA_DeletePtr(dpa, 2);
ok(p == (PVOID)3, "p=%p\n", p);
rc=CheckDPA(dpa, 0x12456, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);

/* Check where to re-insert the deleted item */
i = pDPA_Search(dpa, (PVOID)3, 0,
Expand All @@ -324,7 +328,7 @@ static void test_dpa(void)
ret = pDPA_InsertPtr(dpa, 2, (PVOID)3);
ok(ret == 2, "ret=%d i=%d\n", ret, 2);
rc=CheckDPA(dpa, 0x123456, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);

/* When doing a binary search while claiming reverse order all indexes
* should be bogus */
Expand All @@ -342,7 +346,7 @@ static void test_dpa(void)

pDPA_DeleteAllPtrs(dpa2);
rc=CheckDPA(dpa2, 0, &dw2);
ok(rc, "dw2=0x%x\n", dw2);
ok(rc, "dw2=0x%lx\n", dw2);

pDPA_Destroy(dpa);
pDPA_Destroy(dpa2);
Expand All @@ -368,7 +372,7 @@ static void test_DPA_Merge(void)
ok(ret == 2, "ret=%d\n", ret);

rc = CheckDPA(dpa, 0x135, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);

for (i = 0; i < 6; i++)
{
Expand All @@ -379,16 +383,16 @@ static void test_DPA_Merge(void)
}

rc = CheckDPA(dpa2, 0x654321, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);
rc = CheckDPA(dpa3, 0x123456, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);

/* Delete all odd entries from dpa2 */
memset(nMessages, 0, sizeof(nMessages));
pDPA_Merge(dpa2, dpa, DPAM_INTERSECT,
CB_CmpLT, CB_MergeDeleteOddSrc, 0x1abe11ed);
rc = CheckDPA(dpa2, 0x246, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);

expect(3, nMessages[DPAMM_MERGE]);
expect(3, nMessages[DPAMM_DELETE]);
Expand All @@ -405,7 +409,7 @@ static void test_DPA_Merge(void)
pDPA_Merge(dpa2, dpa, DPAM_INTERSECT,
CB_CmpLT, CB_MergeInsertSrc, 0x1abe11ed);
rc = CheckDPA(dpa2, 0x135, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);

expect(3, nMessages[DPAMM_MERGE]);
expect(6, nMessages[DPAMM_DELETE]);
Expand All @@ -427,7 +431,7 @@ static void test_DPA_Merge(void)
rc = CheckDPA(dpa2, 0x123456, &dw);
ok(rc ||
broken(!rc && dw == 0x23456), /* 4.7x */
"dw=0x%x\n", dw);
"dw=0x%lx\n", dw);

expect(0, nMessages[DPAMM_MERGE]);
expect(0, nMessages[DPAMM_DELETE]);
Expand Down Expand Up @@ -459,13 +463,13 @@ static void test_DPA_Merge(void)
"Expected 3, got %d\n", nMessages[DPAMM_INSERT]);

rc = CheckDPA(dpa, 0x123456, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);
rc = CheckDPA(dpa2, 0x123456, &dw);
ok(rc ||
broken(!rc), /* win98 */
"dw=0x%x\n", dw);
"dw=0x%lx\n", dw);
rc = CheckDPA(dpa3, 0x123456, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);

pDPA_Destroy(dpa);
pDPA_Destroy(dpa2);
Expand All @@ -488,13 +492,13 @@ static void test_DPA_EnumCallback(void)
}

rc = CheckDPA(dpa, 0x123456, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);

nEnum = 0;
/* test callback sets first 3 items to 7 */
pDPA_EnumCallback(dpa, CB_EnumFirstThree, dpa);
rc = CheckDPA(dpa, 0x777456, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);
ok(nEnum == 3, "nEnum=%d\n", nEnum);

pDPA_Destroy(dpa);
Expand Down Expand Up @@ -531,7 +535,7 @@ static void test_DPA_LoadStream(void)
HDPA dpa;

hRes = CoInitialize(NULL);
ok(hRes == S_OK, "Failed to initialize COM, hr %#x.\n", hRes);
ok(hRes == S_OK, "Failed to initialize COM, hr %#lx.\n", hRes);

dwMode = STGM_DIRECT|STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE;
hRes = StgCreateDocfile(NULL, dwMode|STGM_DELETEONRELEASE, 0, &pStg);
Expand Down Expand Up @@ -618,10 +622,10 @@ static void test_DPA_LoadStream(void)
expect(E_FAIL, hRes);

ret = IStream_Release(pStm);
ok(!ret, "ret=%d\n", ret);
ok(!ret, "ret=%ld\n", ret);

ret = IStorage_Release(pStg);
ok(!ret, "ret=%d\n", ret);
ok(!ret, "ret=%ld\n", ret);

CoUninitialize();
}
Expand All @@ -639,7 +643,7 @@ static void test_DPA_SaveStream(void)
LARGE_INTEGER liZero;

hRes = CoInitialize(NULL);
ok(hRes == S_OK, "Failed to initialize COM, hr %#x.\n", hRes);
ok(hRes == S_OK, "Failed to initialize COM, hr %#lx.\n", hRes);

dwMode = STGM_DIRECT|STGM_CREATE|STGM_READWRITE|STGM_SHARE_EXCLUSIVE;
hRes = StgCreateDocfile(NULL, dwMode|STGM_DELETEONRELEASE, 0, &pStg);
Expand All @@ -653,7 +657,7 @@ static void test_DPA_SaveStream(void)
/* simple parameter check */
hRes = pDPA_SaveStream(dpa, NULL, pStm, NULL);
ok(hRes == E_INVALIDARG ||
broken(hRes == S_OK) /* XP and below */, "Wrong result, %d\n", hRes);
broken(hRes == S_OK) /* XP and below */, "Wrong result, %ld\n", hRes);
if (0) {
/* crashes on XP */
hRes = pDPA_SaveStream(NULL, CB_Save, pStm, NULL);
Expand Down Expand Up @@ -684,7 +688,7 @@ if (0) {
hRes = pDPA_LoadStream(&dpa, CB_Load, pStm, (void*)0xdeadbeef);
expect(S_OK, hRes);
rc = CheckDPA(dpa, 0x123456, &dw);
ok(rc, "dw=0x%x\n", dw);
ok(rc, "dw=0x%lx\n", dw);
pDPA_Destroy(dpa);

ret = IStream_Release(pStm);
Expand Down
203 changes: 103 additions & 100 deletions dlls/comctl32/tests/edit.c

Large diffs are not rendered by default.

78 changes: 41 additions & 37 deletions dlls/comctl32/tests/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ static HWND hWndHeader;

#define compare(val, exp, fmt) ok((val) == (exp), #val " value: " fmt ", expected: " fmt "\n", (val), (exp))

#define expect(expected, got) ok(expected == got, "expected %d, got %d\n", expected,got)
#define expect(expected,got) expect_(__LINE__, expected, got)
static inline void expect_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
}

#define NUM_MSG_SEQUENCES 2
#define PARENT_SEQ_INDEX 0
Expand Down Expand Up @@ -393,13 +397,13 @@ static WCHAR pszUniTestW[] = {'T','S','T',0};

#define TEST_GET_ITEM(i,c)\
{ res = getItem(hWndHeader, i, buffer);\
ok(res != 0, "Getting item[%d] using valid index failed unexpectedly (%d)\n", i, res);\
ok(res != 0, "Getting item[%d] using valid index failed unexpectedly (%ld)\n", i, res);\
ok(strcmp(str_items[c], buffer) == 0, "Getting item[%d] returned \"%s\" expecting \"%s\"\n", i, buffer, str_items[c]);\
}

#define TEST_GET_ITEMCOUNT(i)\
{ res = getItemCount(hWndHeader);\
ok(res == i, "Got Item Count as %d\n", res);\
ok(res == i, "Got Item Count as %ld\n", res);\
}

static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Expand Down Expand Up @@ -730,25 +734,25 @@ static void test_header_control (void)
{
TEST_GET_ITEMCOUNT(3-i);
res = addItem(hWndHeader, 0, str_items[i]);
ok(res == 0, "Adding simple item failed (%d)\n", res);
ok(res == 0, "Adding simple item failed (%ld)\n", res);
}

TEST_GET_ITEMCOUNT(4);
res = addItem(hWndHeader, 99, str_items[i+1]);
ok(res != -1, "Adding Out of Range item should fail with -1 got (%d)\n", res);
ok(res != -1, "Adding Out of Range item should fail with -1 got (%ld)\n", res);
TEST_GET_ITEMCOUNT(5);
res = addItem(hWndHeader, 5, str_items[i+1]);
ok(res != -1, "Adding Out of Range item should fail with -1 got (%d)\n", res);
ok(res != -1, "Adding Out of Range item should fail with -1 got (%ld)\n", res);
TEST_GET_ITEMCOUNT(6);

for (i = 0; i < 4; i++) { TEST_GET_ITEM(i,i); TEST_GET_ITEMCOUNT(6); }

res=getItem(hWndHeader, 99, buffer);
ok(res == 0, "Getting Out of Range item should fail with 0 (%d), got %s\n", res,buffer);
ok(res == 0, "Getting Out of Range item should fail with 0 (%ld), got %s\n", res,buffer);
res=getItem(hWndHeader, 5, buffer);
ok(res == 1, "Getting Out of Range item should fail with 1 (%d), got %s\n", res,buffer);
ok(res == 1, "Getting Out of Range item should fail with 1 (%ld), got %s\n", res,buffer);
res=getItem(hWndHeader, -2, buffer);
ok(res == 0, "Getting Out of Range item should fail with 0 (%d), got %s\n", res,buffer);
ok(res == 0, "Getting Out of Range item should fail with 0 (%ld), got %s\n", res,buffer);

if (winetest_interactive)
{
Expand All @@ -758,17 +762,17 @@ static void test_header_control (void)

TEST_GET_ITEMCOUNT(6);
res=setItem(hWndHeader, 99, str_items[5], FALSE);
ok(res == 0, "Setting Out of Range item should fail with 0 (%d)\n", res);
ok(res == 0, "Setting Out of Range item should fail with 0 (%ld)\n", res);
res=setItem(hWndHeader, 5, str_items[5], TRUE);
ok(res == 1, "Setting Out of Range item should fail with 1 (%d)\n", res);
ok(res == 1, "Setting Out of Range item should fail with 1 (%ld)\n", res);
res=setItem(hWndHeader, -2, str_items[5], FALSE);
ok(res == 0, "Setting Out of Range item should fail with 0 (%d)\n", res);
ok(res == 0, "Setting Out of Range item should fail with 0 (%ld)\n", res);
TEST_GET_ITEMCOUNT(6);

for (i = 0; i < 4; i++)
{
res = setItem(hWndHeader, i, str_items[4], TRUE);
ok(res != 0, "Setting %d item failed (%d)\n", i+1, res);
ok(res != 0, "Setting %d item failed (%ld)\n", i+1, res);
TEST_GET_ITEM(i, 4);
TEST_GET_ITEMCOUNT(6);
}
Expand Down Expand Up @@ -796,22 +800,22 @@ static void test_header_control (void)
TEST_GET_ITEMCOUNT(6);

res = delItem(hWndHeader, 5);
ok(res == 1, "Deleting Out of Range item should fail with 1 (%d)\n", res);
ok(res == 1, "Deleting Out of Range item should fail with 1 (%ld)\n", res);
res = delItem(hWndHeader, -2);
ok(res == 0, "Deleting Out of Range item should fail with 0 (%d)\n", res);
ok(res == 0, "Deleting Out of Range item should fail with 0 (%ld)\n", res);
TEST_GET_ITEMCOUNT(5);

res = delItem(hWndHeader, 3);
ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
ok(res != 0, "Deleting using out of range index failed (%ld)\n", res);
TEST_GET_ITEMCOUNT(4);
res = delItem(hWndHeader, 0);
ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
ok(res != 0, "Deleting using out of range index failed (%ld)\n", res);
TEST_GET_ITEMCOUNT(3);
res = delItem(hWndHeader, 0);
ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
ok(res != 0, "Deleting using out of range index failed (%ld)\n", res);
TEST_GET_ITEMCOUNT(2);
res = delItem(hWndHeader, 0);
ok(res != 0, "Deleting using out of range index failed (%d)\n", res);
ok(res != 0, "Deleting using out of range index failed (%ld)\n", res);
TEST_GET_ITEMCOUNT(1);

DestroyWindow(hWndHeader);
Expand Down Expand Up @@ -1366,13 +1370,13 @@ static void test_hds_nosizing(HWND hParent)
}

#define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom) \
ok(nm->dwDrawStage == draw_stage, "Invalid dwDrawStage %d vs %d\n", draw_stage, nm->dwDrawStage); \
ok(nm->dwDrawStage == draw_stage, "Invalid dwDrawStage %d vs %ld\n", draw_stage, nm->dwDrawStage); \
if (item_spec != -1) \
ok(nm->dwItemSpec == item_spec, "Invalid dwItemSpec %d vs %ld\n", item_spec, nm->dwItemSpec); \
ok(nm->lItemlParam == lparam, "Invalid lItemlParam %d vs %ld\n", lparam, nm->lItemlParam); \
ok(nm->dwItemSpec == item_spec, "Invalid dwItemSpec %d vs %Id\n", item_spec, nm->dwItemSpec); \
ok(nm->lItemlParam == lparam, "Invalid lItemlParam %d vs %Id\n", lparam, nm->lItemlParam); \
ok((nm->rc.top == _top && nm->rc.bottom == _bottom && nm->rc.left == _left && nm->rc.right == _right) || \
broken(draw_stage != CDDS_ITEMPREPAINT), /* comctl32 < 5.80 */ \
"Invalid rect (%d,%d)-(%d,%d) vs %s\n", _left, _top, _right, _bottom, \
"Invalid rect (%d,%d)-(%d,%ld) vs %s\n", _left, _top, _right, _bottom, \
wine_dbgstr_rect(&nm->rc));

static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm)
Expand All @@ -1390,7 +1394,7 @@ static LRESULT customdraw_1(int n, NMCUSTOMDRAW *nm)
return 0;
}

ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%ld)\n", n, nm->dwDrawStage);
return -1;
}

Expand All @@ -1417,7 +1421,7 @@ static LRESULT customdraw_2(int n, NMCUSTOMDRAW *nm)
return 0;
}

ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%ld)\n", n, nm->dwDrawStage);
return 0;
}

Expand Down Expand Up @@ -1447,7 +1451,7 @@ static LRESULT customdraw_3(int n, NMCUSTOMDRAW *nm)
return 0;
}

ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%ld)\n", n, nm->dwDrawStage);
return 0;
}

Expand Down Expand Up @@ -1475,7 +1479,7 @@ static LRESULT customdraw_4(int n, NMCUSTOMDRAW *nm)
return 0;
}

ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%d)\n", n, nm->dwDrawStage);
ok(FALSE, "Too many custom draw messages (n=%d, nm->dwDrawStage=%ld)\n", n, nm->dwDrawStage);
return 0;
}

Expand All @@ -1498,7 +1502,7 @@ static void test_customdraw(void)
hWndHeader = create_header_control();
GetClientRect(hWndHeader, &rect);
ok(rect.right - rect.left == 670 && rect.bottom - rect.top == g_customheight,
"Tests will fail as header size is %dx%d instead of 670x%d\n",
"Tests will fail as header size is %ldx%ld instead of 670x%ld\n",
rect.right - rect.left, rect.bottom - rect.top, g_customheight);

for (i = 0; i < 3; i++)
Expand Down Expand Up @@ -1650,10 +1654,10 @@ static LRESULT CALLBACK HeaderTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LP
compare(di->hwndItem, g_DrawItem.hwndItem, "%p");
compare(di->itemID, g_DrawItem.itemID, "%d");
compare(di->itemState, g_DrawItem.itemState, "%d");
compare(di->rcItem.left, g_DrawItem.rcItem.left, "%d");
compare(di->rcItem.top, g_DrawItem.rcItem.top, "%d");
compare(di->rcItem.right, g_DrawItem.rcItem.right, "%d");
compare(di->rcItem.bottom, g_DrawItem.rcItem.bottom, "%d");
compare(di->rcItem.left, g_DrawItem.rcItem.left, "%ld");
compare(di->rcItem.top, g_DrawItem.rcItem.top, "%ld");
compare(di->rcItem.right, g_DrawItem.rcItem.right, "%ld");
compare(di->rcItem.bottom, g_DrawItem.rcItem.bottom, "%ld");
break;

case WM_DESTROY:
Expand Down Expand Up @@ -1703,7 +1707,7 @@ static BOOL init(void)
GetTextMetricsA(hdc, &tm);
/* 2 dot extra space are needed for the border */
g_customheight = tm.tmHeight + 2;
trace("customdraw height: %d (dpi: %d)\n", g_customheight, GetDeviceCaps(hdc, LOGPIXELSY));
trace("customdraw height: %ld (dpi: %d)\n", g_customheight, GetDeviceCaps(hdc, LOGPIXELSY));
SelectObject(hdc, hOldFont);
ReleaseDC(0, hdc);

Expand Down Expand Up @@ -1732,22 +1736,22 @@ static void check_orderarray(HWND hwnd, DWORD start, DWORD set, DWORD expected,
order[i-1] = start>>(4*(count-i)) & 0xf;

ret = SendMessageA(hwnd, HDM_SETORDERARRAY, count, (LPARAM)order);
ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %d\n", ret);
ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %ld\n", ret);

/* new order */
for(i = 1; i<=count; i++)
order[i-1] = set>>(4*(count-i)) & 0xf;
ret = SendMessageA(hwnd, HDM_SETORDERARRAY, count, (LPARAM)order);
ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %d\n", ret);
ok_(__FILE__, line)(ret, "Expected HDM_SETORDERARRAY to succeed, got %ld\n", ret);

/* check actual order */
ret = SendMessageA(hwnd, HDM_GETORDERARRAY, count, (LPARAM)order);
ok_(__FILE__, line)(ret, "Expected HDM_GETORDERARRAY to succeed, got %d\n", ret);
ok_(__FILE__, line)(ret, "Expected HDM_GETORDERARRAY to succeed, got %ld\n", ret);
for(i = 1; i<=count; i++)
array |= order[i-1]<<(4*(count-i));

todo_wine_if(todo)
ok_(__FILE__, line)(array == expected, "Expected %x, got %x\n", expected, array);
ok_(__FILE__, line)(array == expected, "Expected %lx, got %lx\n", expected, array);
}

static void test_hdm_orderarray(void)
Expand Down
128 changes: 64 additions & 64 deletions dlls/comctl32/tests/imagelist.c

Large diffs are not rendered by default.

226 changes: 113 additions & 113 deletions dlls/comctl32/tests/listbox.c

Large diffs are not rendered by default.

150 changes: 80 additions & 70 deletions dlls/comctl32/tests/listview.c

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions dlls/comctl32/tests/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static void test_Alloc(void)
size = pGetSize(p);
ok(size == 1 ||
broken(size == min), /* win9x */
"Expected 1, got %d\n", size);
"Expected 1, got %ld\n", size);

/* reallocate the block */
p = pReAlloc(p, 2);
Expand All @@ -229,7 +229,7 @@ static void test_Alloc(void)
size = pGetSize(p);
ok(size == 2 ||
broken(size == min), /* win9x */
"Expected 2, got %d\n", size);
"Expected 2, got %ld\n", size);

/* free the block */
res = pFree(p);
Expand Down Expand Up @@ -279,7 +279,7 @@ static void test_LoadIconWithScaleDown(void)
GetTempFileNameW(tmp_path, L"ICO", 0, icon_path);
handle = CreateFileW(icon_path, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL);
ok(handle != INVALID_HANDLE_VALUE, "CreateFileW failed with error %u\n", GetLastError());
ok(handle != INVALID_HANDLE_VALUE, "CreateFileW failed with error %lu\n", GetLastError());
res = WriteFile(handle, testicon_data, sizeof(testicon_data), &written, NULL);
ok(res && written == sizeof(testicon_data), "Failed to write icon file\n");
CloseHandle(handle);
Expand All @@ -296,63 +296,63 @@ static void test_LoadIconWithScaleDown(void)
/* invalid arguments */
icon = (HICON)0x1234;
hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, 0x100, &icon);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %lx\n", hr);
ok(icon == NULL, "Expected NULL, got %p\n", icon);

icon = (HICON)0x1234;
hr = pLoadIconMetric(NULL, NULL, LIM_LARGE, &icon);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %lx\n", hr);
ok(icon == NULL, "Expected NULL, got %p\n", icon);

icon = (HICON)0x1234;
hr = pLoadIconWithScaleDown(NULL, NULL, 32, 32, &icon);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %x\n", hr);
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %lx\n", hr);
ok(icon == NULL, "Expected NULL, got %p\n", icon);

/* non-existing filename */
hr = pLoadIconMetric(NULL, L"nonexisting.ico", LIM_LARGE, &icon);
ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* Win7 */,
"Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr);
"Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %lx\n", hr);

hr = pLoadIconWithScaleDown(NULL, L"nonexisting.ico", 32, 32, &icon);
todo_wine
ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND),
"Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr);
"Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %lx\n", hr);

/* non-existing resource name */
hr = pLoadIconMetric(hinst, L"Nonexisting", LIM_LARGE, &icon);
ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND),
"Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr);
"Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %lx\n", hr);

hr = pLoadIconWithScaleDown(hinst, L"Noneexisting", 32, 32, &icon);
ok(hr == HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND),
"Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %x\n", hr);
"Expected HRESULT_FROM_WIN32(ERROR_RESOURCE_TYPE_NOT_FOUND), got %lx\n", hr);

/* load icon using predefined identifier */
hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, LIM_SMALL, &icon);
ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
ok(hr == S_OK, "Expected S_OK, got %lx\n", hr);
res = GetIconInfo(icon, &info);
ok(res, "Failed to get icon info, error %u\n", GetLastError());
ok(res, "Failed to get icon info, error %lu\n", GetLastError());
bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
ok(bytes > 0, "Failed to get bitmap info for icon\n");
ok(bmp.bmWidth == GetSystemMetrics(SM_CXSMICON), "Wrong icon width %d\n", bmp.bmWidth);
ok(bmp.bmHeight == GetSystemMetrics(SM_CYSMICON), "Wrong icon height %d\n", bmp.bmHeight);
DestroyIcon(icon);

hr = pLoadIconMetric(NULL, (LPWSTR)IDI_APPLICATION, LIM_LARGE, &icon);
ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
ok(hr == S_OK, "Expected S_OK, got %lx\n", hr);
res = GetIconInfo(icon, &info);
ok(res, "Failed to get icon info, error %u\n", GetLastError());
ok(res, "Failed to get icon info, error %lu\n", GetLastError());
bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
ok(bytes > 0, "Failed to get bitmap info for icon\n");
ok(bmp.bmWidth == GetSystemMetrics(SM_CXICON), "Wrong icon width %d\n", bmp.bmWidth);
ok(bmp.bmHeight == GetSystemMetrics(SM_CYICON), "Wrong icon height %d\n", bmp.bmHeight);
DestroyIcon(icon);

hr = pLoadIconWithScaleDown(NULL, (LPWSTR)IDI_APPLICATION, 42, 42, &icon);
ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
ok(hr == S_OK, "Expected S_OK, got %lx\n", hr);
res = GetIconInfo(icon, &info);
ok(res, "Failed to get icon info, error %u\n", GetLastError());
ok(res, "Failed to get icon info, error %lu\n", GetLastError());
bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
ok(bytes > 0, "Failed to get bitmap info for icon\n");
ok(bmp.bmWidth == 42, "Wrong icon width %d\n", bmp.bmWidth);
Expand All @@ -361,19 +361,19 @@ static void test_LoadIconWithScaleDown(void)

/* load icon from file */
hr = pLoadIconMetric(NULL, icon_path, LIM_SMALL, &icon);
ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
ok(hr == S_OK, "Expected S_OK, got %lx\n", hr);
res = GetIconInfo(icon, &info);
ok(res, "Failed to get icon info, error %u\n", GetLastError());
ok(res, "Failed to get icon info, error %lu\n", GetLastError());
bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
ok(bytes > 0, "Failed to get bitmap info for icon\n");
ok(bmp.bmWidth == GetSystemMetrics(SM_CXSMICON), "Wrong icon width %d\n", bmp.bmWidth);
ok(bmp.bmHeight == GetSystemMetrics(SM_CYSMICON), "Wrong icon height %d\n", bmp.bmHeight);
DestroyIcon(icon);

hr = pLoadIconWithScaleDown(NULL, icon_path, 42, 42, &icon);
ok(hr == S_OK, "Expected S_OK, got %x\n", hr);
ok(hr == S_OK, "Expected S_OK, got %lx\n", hr);
res = GetIconInfo(icon, &info);
ok(res, "Failed to get icon info, error %u\n", GetLastError());
ok(res, "Failed to get icon info, error %lu\n", GetLastError());
bytes = GetObjectA(info.hbmColor, sizeof(bmp), &bmp);
ok(bytes > 0, "Failed to get bitmap info for icon\n");
ok(bmp.bmWidth == 42, "Wrong icon width %d\n", bmp.bmWidth);
Expand Down Expand Up @@ -522,7 +522,7 @@ static HWND create_control(const char *class, DWORD style, HWND parent, DWORD_PT
if (parent)
style |= WS_CHILD;
hwnd = CreateWindowExA(0, class, "test", style, 0, 0, 50, 20, parent, 0, 0, NULL);
ok(!!hwnd, "Failed to create %s style %#x parent %p\n", class, style, parent);
ok(!!hwnd, "Failed to create %s style %#lx parent %p\n", class, style, parent);
pSetWindowSubclass(hwnd, test_wm_themechanged_proc, 0, data);
return hwnd;
}
Expand Down Expand Up @@ -637,13 +637,13 @@ static void test_WM_SYSCOLORCHANGE(void)

parent = CreateWindowExA(0, WC_STATICA, "parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100,
200, 200, 0, 0, 0, NULL);
ok(!!parent, "CreateWindowExA failed, error %d\n", GetLastError());
ok(!!parent, "CreateWindowExA failed, error %ld\n", GetLastError());

temp.tmplate.style = WS_CHILD | WS_VISIBLE;
temp.tmplate.cx = 50;
temp.tmplate.cy = 50;
dialog = CreateDialogIndirectParamA(NULL, &temp.tmplate, parent, wm_syscolorchange_dlg_proc, 0);
ok(!!dialog, "CreateDialogIndirectParamA failed, error %d\n", GetLastError());
ok(!!dialog, "CreateDialogIndirectParamA failed, error %ld\n", GetLastError());
flush_events();
flush_sequences(sequences, NUM_MSG_SEQUENCES);

Expand Down Expand Up @@ -917,15 +917,15 @@ static void test_themed_background(void)

parent = CreateWindowA(cls.lpszClassName, "parent", WS_POPUP | WS_VISIBLE, 100, 100, 100, 100,
0, 0, 0, 0);
ok(parent != NULL, "CreateWindowA failed, error %u.\n", GetLastError());
ok(parent != NULL, "CreateWindowA failed, error %lu.\n", GetLastError());

for (i = 0; i < ARRAY_SIZE(tests); ++i)
{
winetest_push_context("%s %#x", tests[i].class_name, tests[i].style);
winetest_push_context("%s %#lx", tests[i].class_name, tests[i].style);

child = CreateWindowA(tests[i].class_name, " ", WS_CHILD | WS_VISIBLE | tests[i].style,
0, 0, 50, 50, parent, 0, 0, 0);
ok(child != NULL, "CreateWindowA failed, error %u.\n", GetLastError());
ok(child != NULL, "CreateWindowA failed, error %lu.\n", GetLastError());
flush_events();
flush_sequences(sequences, NUM_MSG_SEQUENCES);

Expand Down Expand Up @@ -953,17 +953,17 @@ static void test_themed_background(void)
color = GetPixel(hdc, 40, 40);
/* BS_PUSHBOX is unimplemented on Wine */
todo_wine_if(i == 11)
ok(color == 0x808080, "Expected color %#x, got %#x.\n", 0x808080, color);
ok(color == 0x808080, "Expected color %#x, got %#lx.\n", 0x808080, color);
}
else if (tests[i].seq == groupbox_seq)
{
/* DrawThemeParentBackground() is used to fill content background */
color = GetPixel(hdc, 40, 40);
ok(color == 0xff, "Expected color %#x, got %#x.\n", 0xff, color);
ok(color == 0xff, "Expected color %#x, got %#lx.\n", 0xff, color);

/* WM_CTLCOLORSTATIC is used to fill text background */
color = GetPixel(hdc, 10, 10);
ok(color == 0x808080, "Expected color %#x, got %#x.\n", 0x808080, color);
ok(color == 0x808080, "Expected color %#x, got %#lx.\n", 0x808080, color);
}

ReleaseDC(child, hdc);
Expand Down
49 changes: 29 additions & 20 deletions dlls/comctl32/tests/monthcal.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,18 @@
#include <windows.h>
#include "msg.h"

#define expect(expected, got) ok(expected == got, "Expected %d, got %d\n", expected, got);
#define expect_hex(expected, got) ok(expected == got, "Expected %x, got %x\n", expected, got);
#define expect_d(expected, got) ok(abs((expected) - (got)) <= 2, "Expected %d, got %d\n", expected, got);
#define expect(expected,got) expect_(__LINE__, expected, got)
static inline void expect_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
}

#define expect_hex(expected,got) expect_hex_(__LINE__, expected, got)
static inline void expect_hex_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %lx, got %lx\n", expected, got);
}
#define expect_d(expected, got) ok(abs((expected) - (got)) <= 2, "Expected %ld, got %ld\n", expected, got);

#define NUM_MSG_SEQUENCES 2
#define PARENT_SEQ_INDEX 0
Expand Down Expand Up @@ -276,7 +285,7 @@ static void test_monthcal(void)
limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st);
ok(limits == 0 ||
broken(limits == GDTR_MIN), /* comctl32 <= 4.70 */
"No limits should be set (%d)\n", limits);
"No limits should be set (%ld)\n", limits);
if (limits == GDTR_MIN)
{
win_skip("comctl32 <= 4.70 is broken\n");
Expand Down Expand Up @@ -309,7 +318,7 @@ static void test_monthcal(void)
expect(0, st[1].wMilliseconds);

limits = SendMessageA(hwnd, MCM_GETRANGE, 0, 0);
ok(limits == 0, "got %u\n", limits);
ok(limits == 0, "got %lu\n", limits);

GetSystemTime(&st[0]);
st[1] = st[0];
Expand Down Expand Up @@ -459,7 +468,7 @@ static void test_monthcal(void)

/* 0 limit flags */
limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1);
ok(limits == GDTR_MIN, "got 0x%08x\n", limits);
ok(limits == GDTR_MIN, "got 0x%08lx\n", limits);

GetSystemTime(st);
st[1] = st[0];
Expand All @@ -468,7 +477,7 @@ static void test_monthcal(void)
ok(r, "got %d\n", r);

limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st);
ok(limits == 0, "got 0x%08x\n", limits);
ok(limits == 0, "got 0x%08lx\n", limits);
ok(st[0].wYear == 0 && st[1].wYear == 0, "got %u, %u\n", st[0].wYear, st[1].wYear);

/* flags are 0, set min limit */
Expand All @@ -480,15 +489,15 @@ static void test_monthcal(void)
ok(r, "got %d\n", r);

limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1);
ok(limits == GDTR_MIN, "got 0x%08x\n", limits);
ok(limits == GDTR_MIN, "got 0x%08lx\n", limits);
ok(st1[1].wYear == 0, "got %u\n", st1[1].wYear);

/* now set max limit, check flags */
r = SendMessageA(hwnd, MCM_SETRANGE, GDTR_MAX, (LPARAM)st);
ok(r, "got %d\n", r);

limits = SendMessageA(hwnd, MCM_GETRANGE, 0, (LPARAM)st1);
ok(limits == GDTR_MAX, "got 0x%08x\n", limits);
ok(limits == GDTR_MAX, "got 0x%08lx\n", limits);
ok(st1[0].wYear == 0, "got %u\n", st1[0].wYear);

DestroyWindow(hwnd);
Expand Down Expand Up @@ -643,7 +652,7 @@ static LRESULT WINAPI monthcal_subclass_proc(HWND hwnd, UINT message, WPARAM wPa
message == WM_STYLECHANGED) && lParam)
{
STYLESTRUCT *style = (STYLESTRUCT*)lParam;
trace("\told style: 0x%08x, new style: 0x%08x\n", style->styleOld, style->styleNew);
trace("\told style: 0x%08lx, new style: 0x%08lx\n", style->styleOld, style->styleNew);
}

defwndproc_counter++;
Expand Down Expand Up @@ -918,7 +927,7 @@ static void test_firstDay(void)
SetLastError(0xdeadbeef);
ret = GetLocaleInfoA(lcid, LOCALE_ICALENDARTYPE, caltype, 3);
if (ret == 0) {
skip("Must know local calendar type (%x)\n", GetLastError());
skip("Must know local calendar type (%lx)\n", GetLastError());
return;
} else if (atoi(caltype) != CAL_GREGORIAN) {
skip("MonthCalendar Control only supports Gregorian calendar (type: %s)\n", caltype);
Expand Down Expand Up @@ -1227,7 +1236,7 @@ if (0)
break;

todo_wine_if(title_hits[title_index].todo)
ok(title_hits[title_index].ht == res, "Expected %x, got %x, pos %d\n",
ok(title_hits[title_index].ht == res, "Expected %x, got %x, pos %ld\n",
title_hits[title_index].ht, res, x);
}
old_res = res;
Expand Down Expand Up @@ -1832,7 +1841,7 @@ static void test_hittest_v6(void)
expect(0, mchit.rc.left);
expect(0, mchit.rc.top);
expect_d(r.right, mchit.rc.right);
ok(mchit.rc.bottom > 0, "got %d\n", mchit.rc.bottom);
ok(mchit.rc.bottom > 0, "got %ld\n", mchit.rc.bottom);

/* between two calendars */
MoveWindow(hwnd, 0, 0, r.right * 5/2, r.bottom, FALSE);
Expand Down Expand Up @@ -1898,7 +1907,7 @@ static void test_MCM_SIZERECTTOMIN(void)
}

ret = SendMessageA(hwnd, MCM_SIZERECTTOMIN, 0, 0);
ok(ret == 0, "got %d\n", ret);
ok(ret == 0, "got %ld\n", ret);

SetRectEmpty(&r);
ret = SendMessageA(hwnd, MCM_SIZERECTTOMIN, 0, (LPARAM)&r);
Expand All @@ -1908,18 +1917,18 @@ static void test_MCM_SIZERECTTOMIN(void)
DestroyWindow(hwnd);
return;
}
ok(ret == 1, "got %d\n", ret);
ok(r.left == 0 && r.right > 0, "got %d, %d\n", r.left, r.right);
ok(ret == 1, "got %ld\n", ret);
ok(r.left == 0 && r.right > 0, "got %ld, %ld\n", r.left, r.right);

r = r2;
ret = SendMessageA(hwnd, MCM_SIZERECTTOMIN, 0, (LPARAM)&r);
ok(ret == 1, "got %d\n", ret);
ok(ret == 1, "got %ld\n", ret);

r2.right = (r2.right - r2.left) * 3;
r2.bottom = (r2.bottom - r2.top) * 3;
r2.left = r2.top = 0;
ret = SendMessageA(hwnd, MCM_SIZERECTTOMIN, 0, (LPARAM)&r2);
ok(ret == 1, "got %d\n", ret);
ok(ret == 1, "got %ld\n", ret);

DestroyWindow(hwnd);
}
Expand Down Expand Up @@ -1975,7 +1984,7 @@ static void test_daystate(void)
/* try to switch on */
SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) | MCS_DAYSTATE);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok((style & MCS_DAYSTATE) == 0, "got 0x%08x\n", style);
ok((style & MCS_DAYSTATE) == 0, "got 0x%08lx\n", style);

DestroyWindow(hwnd);

Expand All @@ -1997,7 +2006,7 @@ static void test_daystate(void)
/* try to switch off */
SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) & ~MCS_DAYSTATE);
style = GetWindowLongA(hwnd, GWL_STYLE);
ok((style & MCS_DAYSTATE) == MCS_DAYSTATE, "got 0x%08x\n", style);
ok((style & MCS_DAYSTATE) == MCS_DAYSTATE, "got 0x%08lx\n", style);

DestroyWindow(hwnd);
}
Expand Down
28 changes: 14 additions & 14 deletions dlls/comctl32/tests/mru.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static void check_reg_entries(const char *mrulist, const char**items)
buff[0] = '\0';
ret = RegQueryValueExA(hKey, "MRUList", NULL, &type, (LPBYTE)buff, &size);

ok(!ret && buff[0], "Checking MRU: got %d from RegQueryValueExW\n", ret);
ok(!ret && buff[0], "Checking MRU: got %ld from RegQueryValueExW\n", ret);
if(ret || !buff[0]) return;

ok(strcmp(buff, mrulist) == 0, "Checking MRU: Expected list %s, got %s\n",
Expand All @@ -217,7 +217,7 @@ static void check_reg_entries(const char *mrulist, const char**items)
buff[0] = '\0';
ret = RegQueryValueExA(hKey, name, NULL, &type, (LPBYTE)buff, &size);
ok(!ret && buff[0],
"Checking MRU item %d ('%c'): got %d from RegQueryValueExW\n",
"Checking MRU item %d ('%c'): got %ld from RegQueryValueExW\n",
i, mrulist[i], ret);
if(ret || !buff[0]) return;
ok(!strcmp(buff, items[mrulist[i]-'a']),
Expand Down Expand Up @@ -262,7 +262,7 @@ static void test_MRUListA(void)
SetLastError(0);
hMRU = pCreateMRUListA(&infoA);
ok (!hMRU && !GetLastError(),
"CreateMRUListA(too small) expected NULL,0 got %p,%d\n",
"CreateMRUListA(too small) expected NULL,0 got %p,%ld\n",
hMRU, GetLastError());

/* size too big */
Expand All @@ -276,7 +276,7 @@ static void test_MRUListA(void)
SetLastError(0);
hMRU = pCreateMRUListA(&infoA);
ok (!hMRU && !GetLastError(),
"CreateMRUListA(too big) expected NULL,0 got %p,%d\n",
"CreateMRUListA(too big) expected NULL,0 got %p,%ld\n",
hMRU, GetLastError());

/* NULL hKey */
Expand All @@ -290,7 +290,7 @@ static void test_MRUListA(void)
SetLastError(0);
hMRU = pCreateMRUListA(&infoA);
ok (!hMRU && !GetLastError(),
"CreateMRUListA(NULL key) expected NULL,0 got %p,%d\n",
"CreateMRUListA(NULL key) expected NULL,0 got %p,%ld\n",
hMRU, GetLastError());

/* NULL subkey name */
Expand All @@ -304,7 +304,7 @@ static void test_MRUListA(void)
SetLastError(0);
hMRU = pCreateMRUListA(&infoA);
ok (!hMRU && !GetLastError(),
"CreateMRUListA(NULL name) expected NULL,0 got %p,%d\n",
"CreateMRUListA(NULL name) expected NULL,0 got %p,%ld\n",
hMRU, GetLastError());

/* Create a string MRU */
Expand All @@ -321,7 +321,7 @@ static void test_MRUListA(void)

hMRU = pCreateMRUListA(&infoA);
ok(hMRU && !GetLastError(),
"CreateMRUListA(string) expected non-NULL,0 got %p,%d\n",
"CreateMRUListA(string) expected non-NULL,0 got %p,%ld\n",
hMRU, GetLastError());

if (hMRU)
Expand All @@ -336,35 +336,35 @@ static void test_MRUListA(void)
SetLastError(0);
iRet = pAddMRUStringA(NULL, checks[0]);
ok(iRet == -1 && !GetLastError(),
"AddMRUStringA(NULL list) expected -1,0 got %d,%d\n",
"AddMRUStringA(NULL list) expected -1,0 got %d,%ld\n",
iRet, GetLastError());

/* Add (NULL string) */
SetLastError(0);
iRet = pAddMRUStringA(hMRU, NULL);
todo_wine ok(iRet == 0 && !GetLastError(),
"AddMRUStringA(NULL str) expected 0,0 got %d,%d\n",
"AddMRUStringA(NULL str) expected 0,0 got %d,%ld\n",
iRet, GetLastError());

/* Add 3 strings. Check the registry is correct after each add */
SetLastError(0);
iRet = pAddMRUStringA(hMRU, checks[0]);
ok(iRet == 0 && !GetLastError(),
"AddMRUStringA(1) expected 0,0 got %d,%d\n",
"AddMRUStringA(1) expected 0,0 got %d,%ld\n",
iRet, GetLastError());
check_reg_entries("a", checks);

SetLastError(0);
iRet = pAddMRUStringA(hMRU, checks[1]);
ok(iRet == 1 && !GetLastError(),
"AddMRUStringA(2) expected 1,0 got %d,%d\n",
"AddMRUStringA(2) expected 1,0 got %d,%ld\n",
iRet, GetLastError());
check_reg_entries("ba", checks);

SetLastError(0);
iRet = pAddMRUStringA(hMRU, checks[2]);
ok(iRet == 2 && !GetLastError(),
"AddMRUStringA(2) expected 2,0 got %d,%d\n",
"AddMRUStringA(2) expected 2,0 got %d,%ld\n",
iRet, GetLastError());
check_reg_entries("cba", checks);

Expand All @@ -374,15 +374,15 @@ static void test_MRUListA(void)
SetLastError(0);
iRet = pAddMRUStringA(hMRU, checks[1]);
ok(iRet == 1 && !GetLastError(),
"AddMRUStringA(re-add 1) expected 1,0 got %d,%d\n",
"AddMRUStringA(re-add 1) expected 1,0 got %d,%ld\n",
iRet, GetLastError());
check_reg_entries("bca", checks);

/* Add a new string - replaces the oldest string + moves to the front */
SetLastError(0);
iRet = pAddMRUStringA(hMRU, checks[3]);
ok(iRet == 0 && !GetLastError(),
"AddMRUStringA(add new) expected 0,0 got %d,%d\n",
"AddMRUStringA(add new) expected 0,0 got %d,%ld\n",
iRet, GetLastError());
checks[0] = checks[3];
check_reg_entries("abc", checks);
Expand Down
16 changes: 8 additions & 8 deletions dlls/comctl32/tests/msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static void dump_sequence( struct msg_sequence **seq, int sequence_index,
trace_(file, line)("Failed sequence %s:\n", context );
while (expected->message && actual->message)
{
trace_(file, line)( " %u: expected: %04x - actual: %04x wp %08lx lp %08lx\n",
trace_(file, line)( " %u: expected: %04x - actual: %04x wp %08Ix lp %08Ix\n",
count, expected->message, actual->message, actual->wParam, actual->lParam );

if (expected->message == actual->message)
Expand Down Expand Up @@ -155,7 +155,7 @@ static void dump_sequence( struct msg_sequence **seq, int sequence_index,

while (actual->message)
{
trace_(file, line)( " %u: expected: nothing - actual: %04x wp %08lx lp %08lx\n",
trace_(file, line)( " %u: expected: nothing - actual: %04x wp %08Ix lp %08Ix\n",
count, actual->message, actual->wParam, actual->lParam );
actual++;
count++;
Expand Down Expand Up @@ -190,14 +190,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
failcount++;
dump++;
ok_(file, line) (FALSE,
"%s: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
"%s: in msg 0x%04x expecting wParam 0x%Ix got 0x%Ix\n",
context, expected->message, expected->wParam, actual->wParam);
}
}
else
{
ok_(file, line) (expected->wParam == actual->wParam,
"%s: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
"%s: in msg 0x%04x expecting wParam 0x%Ix got 0x%Ix\n",
context, expected->message, expected->wParam, actual->wParam);
if (expected->wParam != actual->wParam) dump++;
}
Expand All @@ -212,14 +212,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
failcount++;
dump++;
ok_(file, line) (FALSE,
"%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
"%s: in msg 0x%04x expecting lParam 0x%Ix got 0x%Ix\n",
context, expected->message, expected->lParam, actual->lParam);
}
}
else
{
ok_(file, line) (expected->lParam == actual->lParam,
"%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
"%s: in msg 0x%04x expecting lParam 0x%Ix got 0x%Ix\n",
context, expected->message, expected->lParam, actual->lParam);
if (expected->lParam != actual->lParam) dump++;
}
Expand All @@ -234,14 +234,14 @@ static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
failcount++;
dump++;
ok_(file, line) (FALSE,
"%s: in msg 0x%04x expecting cd stage 0x%08x got 0x%08x\n",
"%s: in msg 0x%04x expecting cd stage 0x%08lx got 0x%08lx\n",
context, expected->message, expected->stage, actual->stage);
}
}
else
{
ok_(file, line) (expected->stage == actual->stage,
"%s: in msg 0x%04x expecting cd stage 0x%08x got 0x%08x\n",
"%s: in msg 0x%04x expecting cd stage 0x%08lx got 0x%08lx\n",
context, expected->message, expected->stage, actual->stage);
if (expected->stage != actual->stage) dump++;
}
Expand Down
32 changes: 16 additions & 16 deletions dlls/comctl32/tests/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
DWORD style = GetWindowLongA(nmpgcs->hdr.hwndFrom, GWL_STYLE);

if (style & PGS_HORZ)
ok(nmpgcs->dwFlag == PGF_CALCWIDTH, "Unexpected flags %#x.\n", nmpgcs->dwFlag);
ok(nmpgcs->dwFlag == PGF_CALCWIDTH, "Unexpected flags %#lx.\n", nmpgcs->dwFlag);
else
ok(nmpgcs->dwFlag == PGF_CALCHEIGHT, "Unexpected flags %#x.\n", nmpgcs->dwFlag);
ok(nmpgcs->dwFlag == PGF_CALCHEIGHT, "Unexpected flags %#lx.\n", nmpgcs->dwFlag);
break;
}
default:
Expand Down Expand Up @@ -449,29 +449,29 @@ static void test_pager(void)
ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "set child", FALSE);
GetWindowRect( pager, &rect );
ok( rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
"pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top );
"pager resized %ldx%ld\n", rect.right - rect.left, rect.bottom - rect.top );

flush_sequences(sequences, NUM_MSG_SEQUENCES);
SendMessageA(pager, PGM_SETCHILD, 0, (LPARAM)child2_wnd);
ok_sequence(sequences, PAGER_SEQ_INDEX, switch_child_seq, "switch to invisible child", FALSE);
GetWindowRect(pager, &rect);
ok(rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
"pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top);
"pager resized %ldx%ld\n", rect.right - rect.left, rect.bottom - rect.top);
ok(!IsWindowVisible(child2_wnd), "Child window 2 is visible\n");

flush_sequences(sequences, NUM_MSG_SEQUENCES);
SendMessageA(pager, PGM_SETCHILD, 0, (LPARAM)child1_wnd);
ok_sequence(sequences, PAGER_SEQ_INDEX, set_child_seq, "switch to visible child", FALSE);
GetWindowRect(pager, &rect);
ok(rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
"pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top);
"pager resized %ldx%ld\n", rect.right - rect.left, rect.bottom - rect.top);

flush_sequences( sequences, NUM_MSG_SEQUENCES );
SendMessageA( pager, PGM_SETPOS, 0, 10 );
ok_sequence(sequences, PAGER_SEQ_INDEX, set_pos_seq, "set pos", TRUE);
GetWindowRect( pager, &rect );
ok( rect.right - rect.left == 100 && rect.bottom - rect.top == 100,
"pager resized %dx%d\n", rect.right - rect.left, rect.bottom - rect.top );
"pager resized %ldx%ld\n", rect.right - rect.left, rect.bottom - rect.top );

flush_sequences( sequences, NUM_MSG_SEQUENCES );
SendMessageA( pager, PGM_SETPOS, 0, 10 );
Expand Down Expand Up @@ -546,7 +546,7 @@ static void test_wm_notifyformat(void)
INT i;

bret = register_notifyformat_class();
ok(bret, "Register test class failed, error 0x%08x\n", GetLastError());
ok(bret, "Register test class failed, error 0x%08lx\n", GetLastError());

for (i = 0; i < ARRAY_SIZE(formats); i++)
{
Expand All @@ -562,26 +562,26 @@ static void test_wm_notifyformat(void)
/* Test parent */
notify_query_received = FALSE;
ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)parent, NF_REQUERY);
ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
ok(ret == notify_format, "Expect %d, got %Id\n", notify_format, ret);
ok(notify_query_received, "Didn't receive notify\n");

/* Send NF_QUERY directly to parent */
notify_query_received = FALSE;
ret = SendMessageW(parent, WM_NOTIFYFORMAT, (WPARAM)pager, NF_QUERY);
ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
ok(ret == notify_format, "Expect %d, got %Id\n", notify_format, ret);
ok(notify_query_received, "Didn't receive notify\n");

/* Pager send notifications to its parent regardless of wParam */
notify_query_received = FALSE;
ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)parent_wnd, NF_REQUERY);
ok(ret == notify_format, "Expect %d, got %ld\n", notify_format, ret);
ok(ret == notify_format, "Expect %d, got %Id\n", notify_format, ret);
ok(notify_query_received, "Didn't receive notify\n");

/* Pager always wants Unicode notifications from children */
ret = SendMessageW(child, WM_NOTIFYFORMAT, (WPARAM)pager, NF_REQUERY);
ok(ret == NFR_UNICODE, "Expect %d, got %ld\n", NFR_UNICODE, ret);
ok(ret == NFR_UNICODE, "Expect %d, got %Id\n", NFR_UNICODE, ret);
ret = SendMessageW(pager, WM_NOTIFYFORMAT, (WPARAM)child, NF_QUERY);
ok(ret == NFR_UNICODE, "Expect %d, got %ld\n", NFR_UNICODE, ret);
ok(ret == NFR_UNICODE, "Expect %d, got %Id\n", NFR_UNICODE, ret);

DestroyWindow(parent);
}
Expand Down Expand Up @@ -688,9 +688,9 @@ static LRESULT WINAPI test_notify_proc(HWND hwnd, UINT message, WPARAM wParam, L
if (!notify_test_info.unicode) break;
ok(!notify_test_info.received, "Extra notification received\n");

ok(wParam == notify_test_info.id_from, "Expect %ld, got %ld\n", notify_test_info.id_from, wParam);
ok(wParam == notify_test_info.id_from, "Expect %Id, got %Id\n", notify_test_info.id_from, wParam);
ok(hdr->code == notify_test_info.ansi, "Expect 0x%08x, got 0x%08x\n", notify_test_info.ansi, hdr->code);
ok(hdr->idFrom == notify_test_info.id_from, "Expect %ld, got %ld\n", notify_test_info.id_from, wParam);
ok(hdr->idFrom == notify_test_info.id_from, "Expect %Id, got %Id\n", notify_test_info.id_from, wParam);
ok(hdr->hwndFrom == notify_test_info.hwnd_from, "Expect %p, got %p\n", notify_test_info.hwnd_from, hdr->hwndFrom);

if (hdr->code != notify_test_info.ansi)
Expand Down Expand Up @@ -1210,7 +1210,7 @@ static void test_wm_notify(void)
DONT_CONVERT_SEND | DONT_CONVERT_RECEIVE},
{&nmtbr, sizeof(nmtbr), NULL, 0, (WCHAR **)&nmtbr.tbButton.iString, NULL, TBN_RESTORE, TBN_RESTORE,
DONT_CONVERT_SEND | DONT_CONVERT_RECEIVE},
{&nmtbdi, sizeof(nmtbdi), &nmtbdi.dwMask, TBNF_TEXT, &nmtbdi.pszText, &nmtbdi.cchText, TBN_GETDISPINFOW,
{&nmtbdi, sizeof(nmtbdi), (UINT*)&nmtbdi.dwMask, TBNF_TEXT, &nmtbdi.pszText, &nmtbdi.cchText, TBN_GETDISPINFOW,
TBN_GETDISPINFOW, DONT_CONVERT_SEND | DONT_CONVERT_RECEIVE},
{&nmtb, sizeof(nmtb), NULL, 0, &nmtb.pszText, &nmtb.cchText, TBN_GETBUTTONINFOW, TBN_GETBUTTONINFOA,
SEND_EMPTY_IF_NULL | CONVERT_SEND | CONVERT_RECEIVE},
Expand Down Expand Up @@ -1264,7 +1264,7 @@ static void test_wm_notify(void)
INT i;

bret = register_test_notify_class();
ok(bret, "Register test class failed, error 0x%08x\n", GetLastError());
ok(bret, "Register test class failed, error 0x%08lx\n", GetLastError());

parent = CreateWindowA(class, "parent", WS_OVERLAPPED, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), 0);
ok(parent != NULL, "CreateWindow failed\n");
Expand Down
Loading