Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
June 2018
- 68 participants
- 1149 messages
[PATCH] msi/tests: Use the available ARRAY_SIZE() macro
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/msi/tests/action.c | 64 ++++++++---------
dlls/msi/tests/automation.c | 70 +++++++++---------
dlls/msi/tests/db.c | 12 ++--
dlls/msi/tests/install.c | 169 ++++++++++++++++++++++----------------------
dlls/msi/tests/msi.c | 30 ++++----
dlls/msi/tests/package.c | 2 +-
dlls/msi/tests/patch.c | 8 +--
dlls/msi/tests/record.c | 4 +-
8 files changed, 178 insertions(+), 181 deletions(-)
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c
index 2e464c4ecb..cb8514d42d 100644
--- a/dlls/msi/tests/action.c
+++ b/dlls/msi/tests/action.c
@@ -2650,7 +2650,7 @@ static void test_register_product(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
+ create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables));
MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
@@ -2917,7 +2917,7 @@ static void test_publish_product(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
+ create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables));
if (is_wow64)
access |= KEY_WOW64_64KEY;
@@ -3150,7 +3150,7 @@ static void test_publish_features(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
+ create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables));
if (is_wow64)
access |= KEY_WOW64_64KEY;
@@ -3336,7 +3336,7 @@ static void test_register_user(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
+ create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables));
if (is_wow64)
access |= KEY_WOW64_64KEY;
@@ -3430,7 +3430,7 @@ static void test_process_components(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database(msifile, ppc_tables, sizeof(ppc_tables) / sizeof(msi_table));
+ create_database(msifile, ppc_tables, ARRAY_SIZE(ppc_tables));
if (is_wow64)
access |= KEY_WOW64_64KEY;
@@ -3578,7 +3578,7 @@ static void test_publish(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
+ create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4152,7 +4152,7 @@ static void test_publish_sourcelist(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database(msifile, pp_tables, sizeof(pp_tables) / sizeof(msi_table));
+ create_database(msifile, pp_tables, ARRAY_SIZE(pp_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4352,7 +4352,7 @@ static void test_remove_files(void)
create_file("msitest\\helium", 500);
create_file("msitest\\lithium", 500);
- create_database(msifile, rem_tables, sizeof(rem_tables) / sizeof(msi_table));
+ create_database(msifile, rem_tables, ARRAY_SIZE(rem_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4509,7 +4509,7 @@ static void test_move_files(void)
create_file("bur", 100);
create_file("bird", 100);
- create_database(msifile, mov_tables, sizeof(mov_tables) / sizeof(msi_table));
+ create_database(msifile, mov_tables, ARRAY_SIZE(mov_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4630,7 +4630,7 @@ static void test_duplicate_files(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database(msifile, df_tables, sizeof(df_tables) / sizeof(msi_table));
+ create_database(msifile, df_tables, ARRAY_SIZE(df_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4673,7 +4673,7 @@ static void test_write_registry_values(void)
CreateDirectoryA("msitest", NULL);
- create_database(msifile, wrv_tables, sizeof(wrv_tables) / sizeof(msi_table));
+ create_database(msifile, wrv_tables, ARRAY_SIZE(wrv_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4839,7 +4839,7 @@ static void test_envvar(void)
return;
}
- create_database(msifile, env_tables, sizeof(env_tables) / sizeof(msi_table));
+ create_database(msifile, env_tables, ARRAY_SIZE(env_tables));
res = RegCreateKeyExA(HKEY_CURRENT_USER, "Environment", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &env, NULL);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
@@ -4948,7 +4948,7 @@ static void test_create_remove_folder(void)
CreateDirectoryA("msitest\\second", NULL);
create_file("msitest\\first\\one.txt", 1000);
create_file("msitest\\second\\two.txt", 1000);
- create_database(msifile, cf_tables, sizeof(cf_tables) / sizeof(msi_table));
+ create_database(msifile, cf_tables, ARRAY_SIZE(cf_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5028,7 +5028,7 @@ static void test_start_stop_services(void)
CloseServiceHandle(scm);
create_test_files();
- create_database(msifile, sss_tables, sizeof(sss_tables) / sizeof(msi_table));
+ create_database(msifile, sss_tables, ARRAY_SIZE(sss_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5128,7 +5128,7 @@ static void test_delete_services(void)
if (!service) return;
create_test_files();
- create_database(msifile, sds_tables, sizeof(sds_tables) / sizeof(msi_table));
+ create_database(msifile, sds_tables, ARRAY_SIZE(sds_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5190,7 +5190,7 @@ static void test_install_services(void)
}
create_test_files();
- create_database(msifile, sis_tables, sizeof(sis_tables) / sizeof(msi_table));
+ create_database(msifile, sis_tables, ARRAY_SIZE(sis_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5267,7 +5267,7 @@ static void test_self_registration(void)
create_test_files();
extract_resource("selfreg.dll", "TESTDLL", "msitest\\selfreg.dll");
- create_database(msifile, sr_tables, sizeof(sr_tables) / sizeof(msi_table));
+ create_database(msifile, sr_tables, ARRAY_SIZE(sr_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5315,7 +5315,7 @@ static void test_register_font(void)
create_test_files();
create_file("msitest\\font.ttf", 1000);
- create_database(msifile, font_tables, sizeof(font_tables) / sizeof(msi_table));
+ create_database(msifile, font_tables, ARRAY_SIZE(font_tables));
if (is_wow64)
access |= KEY_WOW64_64KEY;
@@ -5365,7 +5365,7 @@ static void test_validate_product_id(void)
}
create_test_files();
- create_database(msifile, vp_tables, sizeof(vp_tables) / sizeof(msi_table));
+ create_database(msifile, vp_tables, ARRAY_SIZE(vp_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5424,7 +5424,7 @@ static void test_install_remove_odbc(void)
create_file("msitest\\ODBCtranslator.dll", 1000);
create_file("msitest\\ODBCtranslator2.dll", 1000);
create_file("msitest\\ODBCsetup.dll", 1000);
- create_database(msifile, odbc_tables, sizeof(odbc_tables) / sizeof(msi_table));
+ create_database(msifile, odbc_tables, ARRAY_SIZE(odbc_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5510,7 +5510,7 @@ static void test_register_typelib(void)
create_test_files();
extract_resource("typelib.tlb", "TYPELIB", "msitest\\typelib.dll");
- create_database(msifile, tl_tables, sizeof(tl_tables) / sizeof(msi_table));
+ create_database(msifile, tl_tables, ARRAY_SIZE(tl_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5553,7 +5553,7 @@ static void test_create_remove_shortcut(void)
create_test_files();
create_file("msitest\\target.txt", 1000);
- create_database(msifile, crs_tables, sizeof(crs_tables) / sizeof(msi_table));
+ create_database(msifile, crs_tables, ARRAY_SIZE(crs_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5602,7 +5602,7 @@ static void test_publish_components(void)
create_test_files();
create_file("msitest\\english.txt", 1000);
- create_database(msifile, pub_tables, sizeof(pub_tables) / sizeof(msi_table));
+ create_database(msifile, pub_tables, ARRAY_SIZE(pub_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5688,7 +5688,7 @@ static void test_remove_duplicate_files(void)
create_file("msitest\\original.txt", 1000);
create_file("msitest\\original2.txt", 1000);
create_file("msitest\\original3.txt", 1000);
- create_database(msifile, rd_tables, sizeof(rd_tables) / sizeof(msi_table));
+ create_database(msifile, rd_tables, ARRAY_SIZE(rd_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5736,7 +5736,7 @@ static void test_find_related_products(void)
create_test_files();
create_file("msitest\\product.txt", 1000);
- create_database(msifile, frp_tables, sizeof(frp_tables) / sizeof(msi_table));
+ create_database(msifile, frp_tables, ARRAY_SIZE(frp_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5780,7 +5780,7 @@ static void test_ini_values(void)
create_test_files();
create_file("msitest\\inifile.txt", 1000);
- create_database(msifile, ini_tables, sizeof(ini_tables) / sizeof(msi_table));
+ create_database(msifile, ini_tables, ARRAY_SIZE(ini_tables));
lstrcpyA(inifile, PROG_FILES_DIR);
lstrcatA(inifile, "\\msitest");
@@ -5841,7 +5841,7 @@ static void test_register_class_info(void)
create_test_files();
create_file("msitest\\class.txt", 1000);
- create_database(msifile, rci_tables, sizeof(rci_tables) / sizeof(msi_table));
+ create_database(msifile, rci_tables, ARRAY_SIZE(rci_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5906,7 +5906,7 @@ static void test_register_extension_info(void)
create_test_files();
create_file("msitest\\extension.txt", 1000);
- create_database(msifile, rei_tables, sizeof(rei_tables) / sizeof(msi_table));
+ create_database(msifile, rei_tables, ARRAY_SIZE(rei_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5958,7 +5958,7 @@ static void test_register_progid_info(void)
create_test_files();
create_file("msitest\\progid.txt", 1000);
- create_database(msifile, rpi_tables, sizeof(rpi_tables) / sizeof(msi_table));
+ create_database(msifile, rpi_tables, ARRAY_SIZE(rpi_tables));
res = RegCreateKeyExA(HKEY_CLASSES_ROOT, "Winetest.Orphaned", 0, NULL, 0,
KEY_ALL_ACCESS, NULL, &hkey, NULL);
@@ -6084,7 +6084,7 @@ static void test_register_mime_info(void)
create_test_files();
create_file("msitest\\mime.txt", 1000);
- create_database(msifile, rmi_tables, sizeof(rmi_tables) / sizeof(msi_table));
+ create_database(msifile, rmi_tables, ARRAY_SIZE(rmi_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -6182,7 +6182,7 @@ static void test_publish_assemblies(void)
create_file_data("msitest\\manifest_local.txt", manifest_local, 0);
create_file("msitest\\application_win32.txt", 1000);
create_file("msitest\\application_dotnet.txt", 1000);
- create_database(msifile, pa_tables, sizeof(pa_tables) / sizeof(msi_table));
+ create_database(msifile, pa_tables, ARRAY_SIZE(pa_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -6340,7 +6340,7 @@ static void test_remove_existing_products(void)
create_test_files();
create_file("msitest\\rep.txt", 1000);
- create_database(msifile, rep_tables, sizeof(rep_tables) / sizeof(msi_table));
+ create_database(msifile, rep_tables, ARRAY_SIZE(rep_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c
index e4d2faad5c..2554df7ee6 100644
--- a/dlls/msi/tests/automation.c
+++ b/dlls/msi/tests/automation.c
@@ -355,9 +355,7 @@ static BOOL create_package(LPWSTR path)
DWORD len;
/* Prepare package */
- create_database(msifile, tables,
- sizeof(tables) / sizeof(msi_table), summary_info,
- sizeof(summary_info) / sizeof(msi_summary_info));
+ create_database(msifile, tables, ARRAY_SIZE(tables), summary_info, ARRAY_SIZE(summary_info));
len = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED,
CURR_DIR, -1, path, MAX_PATH);
@@ -903,7 +901,7 @@ static HRESULT Installer_CreateRecord(int count, IDispatch **pRecord)
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -918,7 +916,7 @@ static HRESULT Installer_CreateRecord(int count, IDispatch **pRecord)
static HRESULT Installer_RegistryValue(HKEY hkey, LPCWSTR szKey, VARIANT vValue, VARIANT *pVarResult, VARTYPE vtExpect)
{
VARIANTARG vararg[3];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
VariantInit(&vararg[2]);
V_VT(&vararg[2]) = VT_I4;
@@ -983,7 +981,7 @@ static HRESULT Installer_OpenPackage(LPCWSTR szPackagePath, int options, IDispat
{
VARIANT varresult;
VARIANTARG vararg[2];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[1]);
@@ -1002,7 +1000,7 @@ static HRESULT Installer_OpenDatabase(LPCWSTR szDatabasePath, int openmode, IDis
{
VARIANT varresult;
VARIANTARG vararg[2];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[1]);
@@ -1021,7 +1019,7 @@ static HRESULT Installer_InstallProduct(LPCWSTR szPackagePath, LPCWSTR szPropert
{
VARIANT varresult;
VARIANTARG vararg[2];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
VariantInit(&vararg[1]);
V_VT(&vararg[1]) = VT_BSTR;
@@ -1037,7 +1035,7 @@ static HRESULT Installer_ProductState(LPCWSTR szProduct, int *pInstallState)
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1054,7 +1052,7 @@ static HRESULT Installer_ProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute, LPW
{
VARIANT varresult;
VARIANTARG vararg[2];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[1]);
@@ -1085,7 +1083,7 @@ static HRESULT Installer_RelatedProducts(LPCWSTR szProduct, IDispatch **pStringL
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1127,7 +1125,7 @@ static HRESULT Installer_SummaryInformation(BSTR PackagePath, int UpdateCount, I
{
VARIANT varresult;
VARIANTARG vararg[2];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[1]);
@@ -1157,7 +1155,7 @@ static HRESULT Session_PropertyGet(IDispatch *pSession, LPCWSTR szName, LPWSTR s
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1175,7 +1173,7 @@ static HRESULT Session_PropertyPut(IDispatch *pSession, LPCWSTR szName, LPCWSTR
VARIANT varresult;
VARIANTARG vararg[2];
DISPID dispid = DISPID_PROPERTYPUT;
- DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
+ DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1};
VariantInit(&vararg[1]);
V_VT(&vararg[1]) = VT_BSTR;
@@ -1203,7 +1201,7 @@ static HRESULT Session_ModeGet(IDispatch *pSession, int iFlag, VARIANT_BOOL *mod
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1221,7 +1219,7 @@ static HRESULT Session_ModePut(IDispatch *pSession, int iFlag, VARIANT_BOOL mode
VARIANT varresult;
VARIANTARG vararg[2];
DISPID dispid = DISPID_PROPERTYPUT;
- DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
+ DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1};
VariantInit(&vararg[1]);
V_VT(&vararg[1]) = VT_I4;
@@ -1248,7 +1246,7 @@ static HRESULT Session_DoAction(IDispatch *pSession, LPCWSTR szAction, int *iRet
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1265,7 +1263,7 @@ static HRESULT Session_EvaluateCondition(IDispatch *pSession, LPCWSTR szConditio
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1282,7 +1280,7 @@ static HRESULT Session_Message(IDispatch *pSession, LONG kind, IDispatch *record
{
VARIANT varresult;
VARIANTARG vararg[2];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&varresult);
@@ -1303,7 +1301,7 @@ static HRESULT Session_SetInstallLevel(IDispatch *pSession, LONG iInstallLevel)
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
VariantInit(&vararg[0]);
V_VT(&vararg[0]) = VT_I4;
@@ -1316,7 +1314,7 @@ static HRESULT Session_FeatureCurrentState(IDispatch *pSession, LPCWSTR szName,
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1333,7 +1331,7 @@ static HRESULT Session_FeatureRequestStateGet(IDispatch *pSession, LPCWSTR szNam
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1351,7 +1349,7 @@ static HRESULT Session_FeatureRequestStatePut(IDispatch *pSession, LPCWSTR szNam
VARIANT varresult;
VARIANTARG vararg[2];
DISPID dispid = DISPID_PROPERTYPUT;
- DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
+ DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1};
VariantInit(&vararg[1]);
V_VT(&vararg[1]) = VT_BSTR;
@@ -1367,7 +1365,7 @@ static HRESULT Database_OpenView(IDispatch *pDatabase, LPCWSTR szSql, IDispatch
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1383,7 +1381,7 @@ static HRESULT Database_SummaryInformation(IDispatch *pDatabase, int iUpdateCoun
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1399,7 +1397,7 @@ static HRESULT View_Execute(IDispatch *pView, IDispatch *pRecord)
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
VariantInit(&vararg[0]);
V_VT(&vararg[0]) = VT_DISPATCH;
@@ -1421,7 +1419,7 @@ static HRESULT View_Modify(IDispatch *pView, int iMode, IDispatch *pRecord)
{
VARIANT varresult;
VARIANTARG vararg[2];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
VariantInit(&vararg[1]);
V_VT(&vararg[1]) = VT_I4;
@@ -1456,7 +1454,7 @@ static HRESULT Record_StringDataGet(IDispatch *pRecord, int iField, LPWSTR szStr
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1474,7 +1472,7 @@ static HRESULT Record_StringDataPut(IDispatch *pRecord, int iField, LPCWSTR szSt
VARIANT varresult;
VARIANTARG vararg[2];
DISPID dispid = DISPID_PROPERTYPUT;
- DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
+ DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1};
VariantInit(&vararg[1]);
V_VT(&vararg[1]) = VT_I4;
@@ -1490,7 +1488,7 @@ static HRESULT Record_IntegerDataGet(IDispatch *pRecord, int iField, int *pValue
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1508,7 +1506,7 @@ static HRESULT Record_IntegerDataPut(IDispatch *pRecord, int iField, int iValue)
VARIANT varresult;
VARIANTARG vararg[2];
DISPID dispid = DISPID_PROPERTYPUT;
- DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
+ DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1};
VariantInit(&vararg[1]);
V_VT(&vararg[1]) = VT_I4;
@@ -1533,7 +1531,7 @@ static HRESULT StringList_Item(IDispatch *pStringList, int iIndex, LPWSTR szStri
{
VARIANT varresult;
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
HRESULT hr;
VariantInit(&vararg[0]);
@@ -1559,7 +1557,7 @@ static HRESULT StringList_Count(IDispatch *pStringList, int *pCount)
static HRESULT SummaryInfo_PropertyGet(IDispatch *pSummaryInfo, int pid, VARIANT *pVarResult, VARTYPE vtExpect)
{
VARIANTARG vararg[1];
- DISPPARAMS dispparams = {vararg, NULL, sizeof(vararg)/sizeof(VARIANTARG), 0};
+ DISPPARAMS dispparams = {vararg, NULL, ARRAY_SIZE(vararg), 0};
VariantInit(&vararg[0]);
V_VT(&vararg[0]) = VT_I4;
@@ -1572,7 +1570,7 @@ static HRESULT SummaryInfo_PropertyPut(IDispatch *pSummaryInfo, int pid, VARIANT
VARIANT varresult;
VARIANTARG vararg[2];
DISPID dispid = DISPID_PROPERTYPUT;
- DISPPARAMS dispparams = {vararg, &dispid, sizeof(vararg)/sizeof(VARIANTARG), 1};
+ DISPPARAMS dispparams = {vararg, &dispid, ARRAY_SIZE(vararg), 1};
VariantInit(&vararg[1]);
V_VT(&vararg[1]) = VT_I4;
@@ -1850,7 +1848,7 @@ static void test_Database(IDispatch *pDatabase, BOOL readonly)
ok(pSummaryInfo != NULL, "Database_SummaryInformation should not have returned NULL record\n");
if (pSummaryInfo)
{
- test_SummaryInfo(pSummaryInfo, summary_info, sizeof(summary_info)/sizeof(msi_summary_info), readonly);
+ test_SummaryInfo(pSummaryInfo, summary_info, ARRAY_SIZE(summary_info), readonly);
IDispatch_Release(pSummaryInfo);
}
}
@@ -2697,7 +2695,7 @@ static void test_Installer(void)
ok(hr == S_OK, "Installer_SummaryInformation failed, hresult 0x%08x\n", hr);
if (hr == S_OK)
{
- test_SummaryInfo(pSumInfo, summary_info, sizeof(summary_info)/sizeof(msi_summary_info), TRUE);
+ test_SummaryInfo(pSumInfo, summary_info, ARRAY_SIZE(summary_info), TRUE);
IDispatch_Release(pSumInfo);
}
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index ff54a95ab1..2b927b78f2 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -5221,12 +5221,12 @@ static void test_collation(void)
r = MsiViewFetch(hview, &hrec);
ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n");
- sz = sizeof(bufferW) / sizeof(bufferW[0]);
+ sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 1, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!memcmp(bufferW, letter_a_ring, sizeof(letter_a_ring)),
"Expected %s, got %s\n", wine_dbgstr_w(letter_a_ring), wine_dbgstr_w(bufferW));
- sz = sizeof(bufferW) / sizeof(bufferW[0]);
+ sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 2, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpW(bufferW, letter_C), "Expected C, got %s\n", wine_dbgstr_w(bufferW));
@@ -5234,12 +5234,12 @@ static void test_collation(void)
r = MsiViewFetch(hview, &hrec);
ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n");
- sz = sizeof(bufferW) / sizeof(bufferW[0]);
+ sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 1, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!memcmp(bufferW, letter_a_with_ring, sizeof(letter_a_with_ring)),
"Expected %s, got %s\n", wine_dbgstr_w(letter_a_with_ring), wine_dbgstr_w(bufferW));
- sz = sizeof(bufferW) / sizeof(bufferW[0]);
+ sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 2, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpW(bufferW, letter_D), "Expected D, got %s\n", wine_dbgstr_w(bufferW));
@@ -5257,12 +5257,12 @@ static void test_collation(void)
r = MsiViewFetch(hview, &hrec);
ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n");
- sz = sizeof(bufferW) / sizeof(bufferW[0]);
+ sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 1, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!memcmp(bufferW, letter_a_with_ring, sizeof(letter_a_with_ring)),
"Expected %s, got %s\n", wine_dbgstr_w(letter_a_with_ring), wine_dbgstr_w(bufferW));
- sz = sizeof(bufferW) / sizeof(bufferW[0]);
+ sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 2, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpW(bufferW, letter_D), "Expected D, got %s\n", wine_dbgstr_w(bufferW));
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 951f0e7222..f21e32789f 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -2706,7 +2706,7 @@ static void test_MsiInstallProduct(void)
"Expected ERROR_PATH_NOT_FOUND, got %d\n", r);
create_test_files();
- create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
+ create_database(msifile, tables, ARRAY_SIZE(tables));
/* install, don't publish */
r = MsiInstallProductA(msifile, NULL);
@@ -2757,7 +2757,7 @@ static void test_MsiInstallProduct(void)
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
- create_database(msifile, up_tables, sizeof(up_tables) / sizeof(msi_table));
+ create_database(msifile, up_tables, ARRAY_SIZE(up_tables));
/* not published, RemovePreviousVersions set */
r = MsiInstallProductA(msifile, NULL);
@@ -2769,7 +2769,7 @@ static void test_MsiInstallProduct(void)
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
- create_database(msifile, up2_tables, sizeof(up2_tables) / sizeof(msi_table));
+ create_database(msifile, up2_tables, ARRAY_SIZE(up2_tables));
/* not published, version number bumped */
r = MsiInstallProductA(msifile, NULL);
@@ -2781,7 +2781,7 @@ static void test_MsiInstallProduct(void)
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
- create_database(msifile, up3_tables, sizeof(up3_tables) / sizeof(msi_table));
+ create_database(msifile, up3_tables, ARRAY_SIZE(up3_tables));
/* not published, RemovePreviousVersions set and version number bumped */
r = MsiInstallProductA(msifile, NULL);
@@ -2793,7 +2793,7 @@ static void test_MsiInstallProduct(void)
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
RegDeleteKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest");
- create_database(msifile, up4_tables, sizeof(up4_tables) / sizeof(msi_table));
+ create_database(msifile, up4_tables, ARRAY_SIZE(up4_tables));
/* install, publish product */
r = MsiInstallProductA(msifile, "PUBLISH_PRODUCT=1");
@@ -2804,7 +2804,7 @@ static void test_MsiInstallProduct(void)
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
- create_database(msifile, up4_tables, sizeof(up4_tables) / sizeof(msi_table));
+ create_database(msifile, up4_tables, ARRAY_SIZE(up4_tables));
/* published, reinstall */
r = MsiInstallProductA(msifile, NULL);
@@ -2815,7 +2815,7 @@ static void test_MsiInstallProduct(void)
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
- create_database(msifile, up5_tables, sizeof(up5_tables) / sizeof(msi_table));
+ create_database(msifile, up5_tables, ARRAY_SIZE(up5_tables));
/* published product, RemovePreviousVersions set */
r = MsiInstallProductA(msifile, NULL);
@@ -2826,7 +2826,7 @@ static void test_MsiInstallProduct(void)
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
- create_database(msifile, up6_tables, sizeof(up6_tables) / sizeof(msi_table));
+ create_database(msifile, up6_tables, ARRAY_SIZE(up6_tables));
/* published product, version number bumped */
r = MsiInstallProductA(msifile, NULL);
@@ -2837,7 +2837,7 @@ static void test_MsiInstallProduct(void)
res = RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Wine\\msitest", &hkey);
ok(res == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", res);
- create_database(msifile, up7_tables, sizeof(up7_tables) / sizeof(msi_table));
+ create_database(msifile, up7_tables, ARRAY_SIZE(up7_tables));
/* published product, RemovePreviousVersions set and version number bumped */
r = MsiInstallProductA(msifile, NULL);
@@ -2863,7 +2863,7 @@ static void test_MsiSetComponentState(void)
char path[MAX_PATH];
UINT r;
- create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
+ create_database(msifile, tables, ARRAY_SIZE(tables));
CoInitialize(NULL);
@@ -2913,7 +2913,7 @@ static void test_packagecoltypes(void)
LPCSTR query;
UINT r, count;
- create_database(msifile, tables, sizeof(tables) / sizeof(msi_table));
+ create_database(msifile, tables, ARRAY_SIZE(tables));
CoInitialize(NULL);
@@ -3032,7 +3032,7 @@ static void test_continuouscabs(void)
}
create_cc_test_files();
- create_database(msifile, cc_tables, sizeof(cc_tables) / sizeof(msi_table));
+ create_database(msifile, cc_tables, ARRAY_SIZE(cc_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3055,7 +3055,7 @@ static void test_continuouscabs(void)
DeleteFileA(msifile);
create_cc_test_files();
- create_database(msifile, cc2_tables, sizeof(cc2_tables) / sizeof(msi_table));
+ create_database(msifile, cc2_tables, ARRAY_SIZE(cc2_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3081,7 +3081,7 @@ static void test_continuouscabs(void)
/* Filename from cab is right and the one from msi is wrong */
create_cc_test_files();
- create_database(msifile, cc3_tables, sizeof(cc3_tables) / sizeof(msi_table));
+ create_database(msifile, cc3_tables, ARRAY_SIZE(cc3_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3105,7 +3105,7 @@ static void test_continuouscabs(void)
/* Filename from msi is right and the one from cab is wrong */
create_cc_test_files();
ok(MoveFileA("test2.cab", "test2_.cab"), "Cannot rename test2.cab to test2_.cab\n");
- create_database(msifile, cc3_tables, sizeof(cc3_tables) / sizeof(msi_table));
+ create_database(msifile, cc3_tables, ARRAY_SIZE(cc3_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3137,7 +3137,7 @@ static void test_caborder(void)
create_file("augustus", 50000);
create_file("caesar", 500);
- create_database(msifile, cc_tables, sizeof(cc_tables) / sizeof(msi_table));
+ create_database(msifile, cc_tables, ARRAY_SIZE(cc_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3177,7 +3177,7 @@ static void test_caborder(void)
DeleteFileA(msifile);
create_cc_test_files();
- create_database(msifile, co_tables, sizeof(co_tables) / sizeof(msi_table));
+ create_database(msifile, co_tables, ARRAY_SIZE(co_tables));
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_FAILURE, "Expected ERROR_INSTALL_FAILURE, got %u\n", r);
@@ -3193,7 +3193,7 @@ static void test_caborder(void)
DeleteFileA(msifile);
create_cc_test_files();
- create_database(msifile, co2_tables, sizeof(co2_tables) / sizeof(msi_table));
+ create_database(msifile, co2_tables, ARRAY_SIZE(co2_tables));
r = MsiInstallProductA(msifile, NULL);
ok(!delete_pf("msitest\\caesar", TRUE), "File is installed\n");
@@ -3229,7 +3229,7 @@ static void test_mixedmedia(void)
create_file("msitest\\augustus", 500);
create_file("caesar", 500);
- create_database(msifile, mm_tables, sizeof(mm_tables) / sizeof(msi_table));
+ create_database(msifile, mm_tables, ARRAY_SIZE(mm_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3262,7 +3262,7 @@ static void test_samesequence(void)
UINT r;
create_cc_test_files();
- create_database(msifile, ss_tables, sizeof(ss_tables) / sizeof(msi_table));
+ create_database(msifile, ss_tables, ARRAY_SIZE(ss_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3291,7 +3291,7 @@ static void test_uiLevelFlags(void)
UINT r;
create_cc_test_files();
- create_database(msifile, ui_tables, sizeof(ui_tables) / sizeof(msi_table));
+ create_database(msifile, ui_tables, ARRAY_SIZE(ui_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE | INSTALLUILEVEL_SOURCERESONLY, NULL);
@@ -3346,7 +3346,7 @@ static void test_readonlyfile(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database(msifile, rof_tables, sizeof(rof_tables) / sizeof(msi_table));
+ create_database(msifile, rof_tables, ARRAY_SIZE(rof_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3398,7 +3398,7 @@ static void test_readonlyfile_cab(void)
create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
DeleteFileA("maximus");
- create_database(msifile, rofc_tables, sizeof(rofc_tables) / sizeof(msi_table));
+ create_database(msifile, rofc_tables, ARRAY_SIZE(rofc_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3452,7 +3452,7 @@ static void test_setdirproperty(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database(msifile, sdp_tables, sizeof(sdp_tables) / sizeof(msi_table));
+ create_database(msifile, sdp_tables, ARRAY_SIZE(sdp_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3493,7 +3493,7 @@ static void test_cabisextracted(void)
create_cab_file("test2.cab", MEDIA_SIZE, "augustus\0");
create_cab_file("test3.cab", MEDIA_SIZE, "caesar\0");
- create_database(msifile, cie_tables, sizeof(cie_tables) / sizeof(msi_table));
+ create_database(msifile, cie_tables, ARRAY_SIZE(cie_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3727,7 +3727,7 @@ static void test_transformprop(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\augustus", 500);
- create_database(msifile, tp_tables, sizeof(tp_tables) / sizeof(msi_table));
+ create_database(msifile, tp_tables, ARRAY_SIZE(tp_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3775,7 +3775,7 @@ static void test_currentworkingdir(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\augustus", 500);
- create_database(msifile, cwd_tables, sizeof(cwd_tables) / sizeof(msi_table));
+ create_database(msifile, cwd_tables, ARRAY_SIZE(cwd_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3859,7 +3859,7 @@ static void test_admin(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\augustus", 500);
- create_database(msifile, adm_tables, sizeof(adm_tables) / sizeof(msi_table));
+ create_database(msifile, adm_tables, ARRAY_SIZE(adm_tables));
set_admin_summary_info(msifileW);
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -3937,7 +3937,7 @@ static void test_adminprops(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\augustus", 500);
- create_database(msifile, amp_tables, sizeof(amp_tables) / sizeof(msi_table));
+ create_database(msifile, amp_tables, ARRAY_SIZE(amp_tables));
set_admin_summary_info(msifileW);
set_admin_property_stream(msifile);
@@ -3990,7 +3990,7 @@ static void test_missingcab(void)
create_file("maximus", 500);
create_file("tiberius", 500);
- create_database(msifile, mc_tables, sizeof(mc_tables) / sizeof(msi_table));
+ create_database(msifile, mc_tables, ARRAY_SIZE(mc_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4058,7 +4058,7 @@ static void test_sourcefolder(void)
CreateDirectoryA("msitest", NULL);
create_file("augustus", 500);
- create_database(msifile, sf_tables, sizeof(sf_tables) / sizeof(msi_table));
+ create_database(msifile, sf_tables, ARRAY_SIZE(sf_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4097,7 +4097,7 @@ static void test_customaction1(void)
UINT r;
create_test_files();
- create_database(msifile, ca1_tables, sizeof(ca1_tables) / sizeof(msi_table));
+ create_database(msifile, ca1_tables, ARRAY_SIZE(ca1_tables));
/* create a test table */
MsiOpenDatabaseW(msifileW, MSIDBOPEN_TRANSACT, &hdb);
@@ -4153,7 +4153,7 @@ static void test_customaction51(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\augustus", 500);
- create_database(msifile, ca51_tables, sizeof(ca51_tables) / sizeof(msi_table));
+ create_database(msifile, ca51_tables, ARRAY_SIZE(ca51_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4197,7 +4197,7 @@ static void test_installstate(void)
create_file("msitest\\lambda", 500);
create_file("msitest\\mu", 500);
- create_database(msifile, is_tables, sizeof(is_tables) / sizeof(msi_table));
+ create_database(msifile, is_tables, ARRAY_SIZE(is_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4588,11 +4588,11 @@ static void test_sourcepath(void)
return;
}
- create_database(msifile, sp_tables, sizeof(sp_tables) / sizeof(msi_table));
+ create_database(msifile, sp_tables, ARRAY_SIZE(sp_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
- for (i = 0; i < sizeof(spmap) / sizeof(spmap[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(spmap); i++)
{
if (spmap[i].sost)
{
@@ -4675,7 +4675,7 @@ static void test_missingcomponent(void)
create_file("msitest\\lithium", 500);
create_file("beryllium", 500);
- create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table));
+ create_database(msifile, mcp_tables, ARRAY_SIZE(mcp_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4728,7 +4728,7 @@ static void test_sourcedirprop(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\augustus", 500);
- create_database(msifile, ca51_tables, sizeof(ca51_tables) / sizeof(msi_table));
+ create_database(msifile, ca51_tables, ARRAY_SIZE(ca51_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4788,8 +4788,7 @@ static void test_adminimage(void)
create_file("msitest\\cabout\\new\\five.txt", 100);
create_file("msitest\\filename", 100);
- create_database_wordcount(msifile, ai_tables,
- sizeof(ai_tables) / sizeof(msi_table),
+ create_database_wordcount(msifile, ai_tables, ARRAY_SIZE(ai_tables),
100, msidbSumInfoSourceTypeAdminImage, ";1033",
"{004757CA-5092-49C2-AD20-28E1CE0DF5F2}");
@@ -4833,7 +4832,7 @@ static void test_propcase(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\augustus", 500);
- create_database(msifile, pc_tables, sizeof(pc_tables) / sizeof(msi_table));
+ create_database(msifile, pc_tables, ARRAY_SIZE(pc_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4909,7 +4908,7 @@ static void test_int_widths( void )
r = MsiOpenDatabaseW(msidb, MSIDBOPEN_CREATE, &db);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
- for (i = 0; i < sizeof(tests)/sizeof(tests[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(tests); i++)
{
DWORD count;
HANDLE handle = CreateFileW(msitable, GENERIC_WRITE, 0, NULL,
@@ -4942,7 +4941,7 @@ static void test_shortcut(void)
}
create_test_files();
- create_database(msifile, sc_tables, sizeof(sc_tables) / sizeof(msi_table));
+ create_database(msifile, sc_tables, ARRAY_SIZE(sc_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -4989,7 +4988,7 @@ static void test_preselected(void)
}
create_test_files();
- create_database(msifile, ps_tables, sizeof(ps_tables) / sizeof(msi_table));
+ create_database(msifile, ps_tables, ARRAY_SIZE(ps_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5045,7 +5044,7 @@ static void test_installed_prop(void)
}
create_test_files();
- create_database(msifile, ip_tables, sizeof(ip_tables) / sizeof(msi_table));
+ create_database(msifile, ip_tables, ARRAY_SIZE(ip_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5084,7 +5083,7 @@ static void test_allusers_prop(void)
}
create_test_files();
- create_database(msifile, aup_tables, sizeof(aup_tables) / sizeof(msi_table));
+ create_database(msifile, aup_tables, ARRAY_SIZE(aup_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5105,7 +5104,7 @@ static void test_allusers_prop(void)
delete_test_files();
create_test_files();
- create_database(msifile, aup2_tables, sizeof(aup2_tables) / sizeof(msi_table));
+ create_database(msifile, aup2_tables, ARRAY_SIZE(aup2_tables));
/* ALLUSERS property set to 1 */
r = MsiInstallProductA(msifile, "FULL=1");
@@ -5119,7 +5118,7 @@ static void test_allusers_prop(void)
delete_test_files();
create_test_files();
- create_database(msifile, aup3_tables, sizeof(aup3_tables) / sizeof(msi_table));
+ create_database(msifile, aup3_tables, ARRAY_SIZE(aup3_tables));
/* ALLUSERS property set to 2 */
r = MsiInstallProductA(msifile, "FULL=1");
@@ -5133,7 +5132,7 @@ static void test_allusers_prop(void)
delete_test_files();
create_test_files();
- create_database(msifile, aup4_tables, sizeof(aup4_tables) / sizeof(msi_table));
+ create_database(msifile, aup4_tables, ARRAY_SIZE(aup4_tables));
/* ALLUSERS property set to 2, conditioned on ALLUSERS = 1 */
r = MsiInstallProductA(msifile, "FULL=1");
@@ -5248,7 +5247,7 @@ static void test_file_in_use(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database(msifile, fiu_tables, sizeof(fiu_tables) / sizeof(msi_table));
+ create_database(msifile, fiu_tables, ARRAY_SIZE(fiu_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5310,7 +5309,7 @@ static void test_file_in_use_cab(void)
create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
DeleteFileA("maximus");
- create_database(msifile, fiuc_tables, sizeof(fiuc_tables) / sizeof(msi_table));
+ create_database(msifile, fiuc_tables, ARRAY_SIZE(fiuc_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5368,7 +5367,7 @@ static void test_feature_override(void)
create_file("msitest\\override.txt", 1000);
create_file("msitest\\preselected.txt", 1000);
create_file("msitest\\notpreselected.txt", 1000);
- create_database(msifile, fo_tables, sizeof(fo_tables) / sizeof(msi_table));
+ create_database(msifile, fo_tables, ARRAY_SIZE(fo_tables));
if (is_wow64)
access |= KEY_WOW64_64KEY;
@@ -5448,7 +5447,7 @@ static void test_icon_table(void)
return;
}
- create_database(msifile, icon_base_tables, sizeof(icon_base_tables) / sizeof(msi_table));
+ create_database(msifile, icon_base_tables, ARRAY_SIZE(icon_base_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5528,7 +5527,7 @@ static void test_package_validation(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;1033");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;1033");
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5543,19 +5542,19 @@ static void test_package_validation(void)
ok(delete_pf("msitest", FALSE), "directory does not exist\n");
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel,9999;9999");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "Intel,9999;9999");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r);
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel,1033;9999");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "Intel,1033;9999");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r);
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel,9999;1033");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "Intel,9999;1033");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5563,25 +5562,25 @@ static void test_package_validation(void)
ok(delete_pf("msitest", FALSE), "directory does not exist\n");
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel64,9999;1033");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "Intel64,9999;1033");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel32,1033;1033");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "Intel32,1033;1033");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "Intel32,9999;1033");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "Intel32,9999;1033");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;9999");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;9999");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_LANGUAGE_UNSUPPORTED, "Expected ERROR_INSTALL_LANGUAGE_UNSUPPORTED, got %u\n", r);
@@ -5591,14 +5590,14 @@ static void test_package_validation(void)
if (GetSystemDefaultLangID() == MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US ))
{
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;9");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;9");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
ok(delete_pf("msitest", FALSE), "directory does not exist\n");
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;1024");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;1024");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
@@ -5606,7 +5605,7 @@ static void test_package_validation(void)
}
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel32;0");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel32;0");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
@@ -5616,7 +5615,7 @@ static void test_package_validation(void)
if (is_64bit && !is_wow64)
{
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;0");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5624,7 +5623,7 @@ static void test_package_validation(void)
ok(delete_pf("msitest", FALSE), "directory does not exist\n");
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "x64;0");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_PACKAGE_INVALID, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r);
@@ -5632,7 +5631,7 @@ static void test_package_validation(void)
ok(!delete_pf("msitest", FALSE), "directory exists\n");
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "x64;0");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5642,7 +5641,7 @@ static void test_package_validation(void)
else if (is_wow64)
{
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;0");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5650,7 +5649,7 @@ static void test_package_validation(void)
ok(delete_pf("msitest", FALSE), "directory does not exist\n");
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "x64;0");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_PACKAGE_INVALID, "Expected ERROR_INSTALL_PACKAGE_INVALID, got %u\n", r);
@@ -5658,7 +5657,7 @@ static void test_package_validation(void)
ok(!delete_pf("msitest", FALSE), "directory exists\n");
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "x64;0");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5668,7 +5667,7 @@ static void test_package_validation(void)
else
{
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Intel;0");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Intel;0");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5676,7 +5675,7 @@ static void test_package_validation(void)
ok(delete_pf("msitest", FALSE), "directory does not exist\n");
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "Alpha,Beta,Intel;0");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "Alpha,Beta,Intel;0");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5684,7 +5683,7 @@ static void test_package_validation(void)
ok(delete_pf("msitest", FALSE), "directory does not exist\n");
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 100, "x64;0");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 100, "x64;0");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
@@ -5692,7 +5691,7 @@ static void test_package_validation(void)
ok(!delete_pf("msitest", FALSE), "directory exists\n");
DeleteFileA(msifile);
- create_database_template(msifile, pv_tables, sizeof(pv_tables)/sizeof(msi_table), 200, "x64;0");
+ create_database_template(msifile, pv_tables, ARRAY_SIZE(pv_tables), 200, "x64;0");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_INSTALL_PLATFORM_UNSUPPORTED, "Expected ERROR_INSTALL_PLATFORM_UNSUPPORTED, got %u\n", r);
@@ -5719,7 +5718,7 @@ static void test_upgrade_code(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\upgradecode.txt", 1000);
- create_database(msifile, uc_tables, sizeof(uc_tables) / sizeof(msi_table));
+ create_database(msifile, uc_tables, ARRAY_SIZE(uc_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5758,7 +5757,7 @@ static void test_mixed_package(void)
return;
}
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
- create_database_template(msifile, mixed_tables, sizeof(mixed_tables)/sizeof(msi_table), 200, "x64;1033");
+ create_database_template(msifile, mixed_tables, ARRAY_SIZE(mixed_tables), 200, "x64;1033");
r = MsiInstallProductA(msifile, NULL);
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
@@ -5826,7 +5825,7 @@ static void test_mixed_package(void)
ok(res == ERROR_FILE_NOT_FOUND, "64-bit CLSID key not removed\n");
DeleteFileA( msifile );
- create_database_template(msifile, mixed_tables, sizeof(mixed_tables)/sizeof(msi_table), 200, "Intel;1033");
+ create_database_template(msifile, mixed_tables, ARRAY_SIZE(mixed_tables), 200, "Intel;1033");
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@@ -5903,7 +5902,7 @@ static void test_volume_props(void)
}
CreateDirectoryA("msitest", NULL);
create_file("msitest\\volumeprop.txt", 1000);
- create_database(msifile, vp_tables, sizeof(vp_tables)/sizeof(msi_table));
+ create_database(msifile, vp_tables, ARRAY_SIZE(vp_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5929,9 +5928,9 @@ static void test_shared_component(void)
}
CreateDirectoryA("msitest", NULL);
create_file("msitest\\sharedcomponent.txt", 1000);
- create_database_wordcount(msifile, shc_tables, sizeof(shc_tables)/sizeof(shc_tables[0]),
+ create_database_wordcount(msifile, shc_tables, ARRAY_SIZE(shc_tables),
100, 0, ";", "{A8826420-FD72-4E61-9E15-C1944CF4CBE1}");
- create_database_wordcount(msifile2, shc2_tables, sizeof(shc2_tables)/sizeof(shc2_tables[0]),
+ create_database_wordcount(msifile2, shc2_tables, ARRAY_SIZE(shc2_tables),
100, 0, ";", "{A8B50B30-0E8A-4ACD-B3CF-1A5DC58B2739}");
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -5979,7 +5978,7 @@ static void test_remove_upgrade_code(void)
if (is_wow64) access |= KEY_WOW64_64KEY;
create_test_files();
- create_database( msifile, icon_base_tables, sizeof(icon_base_tables)/sizeof(icon_base_tables[0]) );
+ create_database( msifile, icon_base_tables, ARRAY_SIZE( icon_base_tables ));
MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL );
@@ -6024,7 +6023,7 @@ static void test_feature_tree(void)
}
create_file( "msitest\\featuretree.txt", 1000 );
- create_database( msifile, ft_tables, sizeof(ft_tables)/sizeof(ft_tables[0]) );
+ create_database( msifile, ft_tables, ARRAY_SIZE( ft_tables ));
MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL );
@@ -6063,7 +6062,7 @@ static void test_deferred_action(void)
GetTempFileNameA(path, "da", 0, file);
sprintf(buffer, "TESTPATH=\"%s\"", file);
- create_database(msifile, da_tables, sizeof(da_tables) / sizeof(da_tables[0]));
+ create_database(msifile, da_tables, ARRAY_SIZE(da_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -6102,7 +6101,7 @@ static void test_wow64(void)
}
create_test_files();
- create_database_template(msifile, x64_tables, sizeof(x64_tables)/sizeof(msi_table), 200, "x64;0");
+ create_database_template(msifile, x64_tables, ARRAY_SIZE(x64_tables), 200, "x64;0");
r = MsiInstallProductA(msifile, NULL);
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
{
@@ -6155,7 +6154,7 @@ static void test_source_resolution(void)
}
create_test_files();
- create_database(msifile, sr_tables, sizeof(sr_tables) / sizeof(msi_table));
+ create_database(msifile, sr_tables, ARRAY_SIZE(sr_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c
index 62afa6e747..f4afef15db 100644
--- a/dlls/msi/tests/msi.c
+++ b/dlls/msi/tests/msi.c
@@ -1094,7 +1094,7 @@ static void test_MsiGetFileHash(void)
r = pMsiGetFileHashA(name, 0, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- for (i = 0; i < sizeof(hash_data) / sizeof(hash_data[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(hash_data); i++)
{
int ret;
@@ -3313,7 +3313,7 @@ static void test_MsiProvideComponent(void)
create_test_files();
create_file("msitest\\sourcedir.txt", 1000);
- create_database(msifile, sd_tables, sizeof(sd_tables) / sizeof(msi_table));
+ create_database(msifile, sd_tables, ARRAY_SIZE(sd_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -13446,7 +13446,7 @@ static void test_MsiConfigureProductEx(void)
create_file_data("msitest\\helium", "helium", 500);
create_file_data("msitest\\lithium", "lithium", 500);
- create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table));
+ create_database(msifile, mcp_tables, ARRAY_SIZE(mcp_tables));
if (is_wow64)
access |= KEY_WOW64_64KEY;
@@ -13574,7 +13574,7 @@ static void test_MsiConfigureProductEx(void)
ok(!delete_pf("msitest\\lithium", TRUE), "File not removed\n");
ok(!delete_pf("msitest", FALSE), "Directory not removed\n");
- create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table));
+ create_database(msifile, mcp_tables, ARRAY_SIZE(mcp_tables));
/* install the product, machine */
r = MsiInstallProductA(msifile, "ALLUSERS=1 INSTALLLEVEL=10 PROPVAR=42");
@@ -13615,7 +13615,7 @@ static void test_MsiConfigureProductEx(void)
ok(pf_exists("msitest"), "File not installed\n");
RegCloseKey(props);
- create_database(msifile, mcp_tables, sizeof(mcp_tables) / sizeof(msi_table));
+ create_database(msifile, mcp_tables, ARRAY_SIZE(mcp_tables));
/* LastUsedSource can be used as a last resort */
r = MsiConfigureProductExA("{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}",
@@ -13723,7 +13723,7 @@ static void test_MsiSetFeatureAttributes(void)
skip("process is limited\n");
return;
}
- create_database( msifile, tables, sizeof(tables) / sizeof(tables[0]) );
+ create_database( msifile, tables, ARRAY_SIZE( tables ));
strcpy( path, CURR_DIR );
strcat( path, "\\" );
@@ -13805,7 +13805,7 @@ static void test_MsiGetFeatureInfo(void)
skip("process is limited\n");
return;
}
- create_database( msifile, tables, sizeof(tables) / sizeof(tables[0]) );
+ create_database( msifile, tables, ARRAY_SIZE( tables ));
strcpy( path, CURR_DIR );
strcat( path, "\\" );
@@ -13989,9 +13989,9 @@ static void test_lastusedsource(void)
create_cab_file("test1.cab", MEDIA_SIZE, "maximus\0");
DeleteFileA("maximus");
- create_database("msifile0.msi", lus0_tables, sizeof(lus0_tables) / sizeof(msi_table));
- create_database("msifile1.msi", lus1_tables, sizeof(lus1_tables) / sizeof(msi_table));
- create_database("msifile2.msi", lus2_tables, sizeof(lus2_tables) / sizeof(msi_table));
+ create_database("msifile0.msi", lus0_tables, ARRAY_SIZE(lus0_tables));
+ create_database("msifile1.msi", lus1_tables, ARRAY_SIZE(lus1_tables));
+ create_database("msifile2.msi", lus2_tables, ARRAY_SIZE(lus2_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
@@ -14111,7 +14111,7 @@ static void test_setpropertyfolder(void)
CreateDirectoryA("msitest", NULL);
create_file("msitest\\maximus", 500);
- create_database(msifile, spf_tables, sizeof(spf_tables) / sizeof(msi_table));
+ create_database(msifile, spf_tables, ARRAY_SIZE(spf_tables));
MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
@@ -14154,7 +14154,7 @@ static void test_sourcedir_props(void)
create_test_files();
create_file("msitest\\sourcedir.txt", 1000);
- create_database(msifile, sd_tables, sizeof(sd_tables) / sizeof(msi_table));
+ create_database(msifile, sd_tables, ARRAY_SIZE(sd_tables));
MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
@@ -14221,11 +14221,11 @@ static void test_concurrentinstall(void)
create_file("msitest\\maximus", 500);
create_file("msitest\\msitest\\augustus", 500);
- create_database(msifile, ci_tables, sizeof(ci_tables) / sizeof(msi_table));
+ create_database(msifile, ci_tables, ARRAY_SIZE(ci_tables));
lstrcpyA(path, CURR_DIR);
lstrcatA(path, "\\msitest\\concurrent.msi");
- create_database(path, ci2_tables, sizeof(ci2_tables) / sizeof(msi_table));
+ create_database(path, ci2_tables, ARRAY_SIZE(ci2_tables));
MsiSetInternalUI(INSTALLUILEVEL_FULL, NULL);
@@ -14269,7 +14269,7 @@ static void test_command_line_parsing(void)
}
create_test_files();
- create_database(msifile, cl_tables, sizeof(cl_tables)/sizeof(msi_table));
+ create_database(msifile, cl_tables, ARRAY_SIZE(cl_tables));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index 09d2e0b61b..88bd60a8f2 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -187,7 +187,7 @@ static LSTATUS package_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey, REGSAM acce
dwMaxSubkeyLen++;
dwMaxValueLen++;
dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
- if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
+ if (dwMaxLen > ARRAY_SIZE(szNameBuf))
{
/* Name too big: alloc a buffer for it */
if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
diff --git a/dlls/msi/tests/patch.c b/dlls/msi/tests/patch.c
index a09084002e..b577982443 100644
--- a/dlls/msi/tests/patch.c
+++ b/dlls/msi/tests/patch.c
@@ -731,7 +731,7 @@ static void test_simple_patch( void )
CreateDirectoryA( "msitest", NULL );
create_file( "msitest\\patch.txt", 1000 );
- create_database( msifile, tables, sizeof(tables) / sizeof(struct msi_table) );
+ create_database( msifile, tables, ARRAY_SIZE(tables) );
create_patch( mspfile );
MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL );
@@ -929,7 +929,7 @@ static void test_MsiOpenDatabase( void )
MsiCloseHandle( hdb );
DeleteFileA( mspfile );
- create_database( msifile, tables, sizeof(tables) / sizeof(struct msi_table) );
+ create_database( msifile, tables, ARRAY_SIZE(tables) );
create_patch( mspfile );
r = MsiOpenDatabaseW( msifileW, MSIDBOPEN_READONLY + MSIDBOPEN_PATCHFILE, &hdb );
@@ -1072,7 +1072,7 @@ static void test_system_tables( void )
CreateDirectoryA( "msitest", NULL );
create_file( "msitest\\patch.txt", 1000 );
- create_database( msifile, tables, sizeof(tables) / sizeof(struct msi_table) );
+ create_database( msifile, tables, ARRAY_SIZE(tables) );
create_patch( mspfile );
MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL );
@@ -1261,7 +1261,7 @@ static void test_patch_registration( void )
CreateDirectoryA( "msitest", NULL );
create_file( "msitest\\patch.txt", 1000 );
- create_database( msifile, tables, sizeof(tables) / sizeof(struct msi_table) );
+ create_database( msifile, tables, ARRAY_SIZE(tables) );
create_patch( mspfile );
MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL );
diff --git a/dlls/msi/tests/record.c b/dlls/msi/tests/record.c
index 777f1f78ed..d0ad15b8fe 100644
--- a/dlls/msi/tests/record.c
+++ b/dlls/msi/tests/record.c
@@ -138,7 +138,7 @@ static void test_msirecord(void)
ok(buf[0] == 0, "MsiRecordGetStringA returned the wrong string\n");
ok(sz == 0, "MsiRecordGetStringA returned the wrong length\n");
bufW[0] = 0;
- sz = sizeof bufW / sizeof bufW[0];
+ sz = ARRAY_SIZE(bufW);
r = MsiRecordGetStringW(h, 0, bufW, &sz);
ok(r == ERROR_SUCCESS, "Failed to get string at 0\n");
ok(bufW[0] == 0, "MsiRecordGetStringW returned the wrong string\n");
@@ -156,7 +156,7 @@ static void test_msirecord(void)
ok(buf[0] == 0, "MsiRecordGetStringA returned the wrong string\n");
ok(sz == 0, "MsiRecordGetStringA returned the wrong length\n");
bufW[0] = 0;
- sz = sizeof bufW / sizeof bufW[0];
+ sz = ARRAY_SIZE(bufW);
r = MsiRecordGetStringW(h, 0, bufW, &sz);
ok(r == ERROR_SUCCESS, "Failed to get string at 0\n");
ok(bufW[0] == 0, "MsiRecordGetStringW returned the wrong string\n");
--
2.14.4
June 15, 2018
Re: [PATCH] d3dx9/tests: Add initial tests for ID3DXFont::DrawText().
by Matteo Bruni
2018-06-15 13:16 GMT+02:00 Alexandre Julliard <julliard(a)winehq.org>:
> Matteo Bruni <mbruni(a)codeweavers.com> writes:
>
>> From: Kieran Duggan <kieranduggan15(a)gmail.com>
>>
>> Signed-off-by: Kieran Duggan <kieranduggan15(a)gmail.com>
>> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
>> ---
>> dlls/d3dx9_36/tests/core.c | 81 +++++++++++++++++++++++++++++++++++-----------
>> 1 file changed, 62 insertions(+), 19 deletions(-)
>
> The tests fail:
>
> ../../../tools/runtest -q -P wine -T ../../.. -M d3dx9_36.dll -p d3dx9_36_test.exe.so core && touch core.ok
> core.c:612: Test failed: Got unexpected height 1.
> core.c:614: Test failed: Got unexpected height 1.
> core.c:616: Test failed: Got unexpected height 1.
> core.c:619: Test failed: Got unexpected height 1.
> core.c:624: Test failed: Got unexpected height 1.
> core.c:627: Test failed: Got unexpected rect right 0.
> core.c:628: Test failed: Got unexpected rect bottom 0.
> core.c:612: Test failed: Got unexpected height 1.
> core.c:614: Test failed: Got unexpected height 1.
> core.c:616: Test failed: Got unexpected height 1.
> core.c:619: Test failed: Got unexpected height 1.
> core.c:624: Test failed: Got unexpected height 1.
> core.c:627: Test failed: Got unexpected rect right 0.
> core.c:628: Test failed: Got unexpected rect bottom 0.
> core.c:612: Test failed: Got unexpected height 1.
> core.c:614: Test failed: Got unexpected height 1.
> core.c:616: Test failed: Got unexpected height 1.
> core.c:619: Test failed: Got unexpected height 1.
> core.c:624: Test failed: Got unexpected height 1.
> core.c:627: Test failed: Got unexpected rect right 0.
> core.c:628: Test failed: Got unexpected rect bottom 0.
> core.c:612: Test failed: Got unexpected height 1.
> core.c:614: Test failed: Got unexpected height 1.
> core.c:616: Test failed: Got unexpected height 1.
> core.c:619: Test failed: Got unexpected height 1.
> core.c:624: Test failed: Got unexpected height 1.
> core.c:627: Test failed: Got unexpected rect right 0.
> core.c:628: Test failed: Got unexpected rect bottom 0.
> core.c:612: Test failed: Got unexpected height 1.
> core.c:614: Test failed: Got unexpected height 1.
> core.c:616: Test failed: Got unexpected height 1.
> core.c:619: Test failed: Got unexpected height 1.
> core.c:624: Test failed: Got unexpected height 1.
> core.c:627: Test failed: Got unexpected rect right 0.
> core.c:628: Test failed: Got unexpected rect bottom 0.
> Makefile:234: recipe for target 'core.ok' failed
> make[1]: *** [core.ok] Error 35
You're right, I forgot to put the todo_wine in after testing on Windows -_-
I'll fixup and resend.
June 15, 2018
Re: [PATCH v2] msvcp120: Add test for Concurrent_vector_copy.
by Piotr Caban
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com>
June 15, 2018
[PATCH v2] msvcp120: Add test for Concurrent_vector_copy.
by Hua Meng
Signed-off-by: Hua meng <161220092(a)smail.nju.edu.cn>
---
dlls/msvcp120/tests/msvcp120.c | 50 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c
index 1247222..c34bd65 100644
--- a/dlls/msvcp120/tests/msvcp120.c
+++ b/dlls/msvcp120/tests/msvcp120.c
@@ -26,6 +26,7 @@
DWORD expect_idx;
static int vector_alloc_count;
+static int vector_elem_count;
#define DEFINE_EXPECT(func) \
BOOL expect_ ## func, called_ ## func
@@ -38,6 +39,7 @@ struct expect_struct {
DEFINE_EXPECT(queue_char__Assign_and_destroy_item);
DEFINE_EXPECT(concurrent_vector_int_alloc);
DEFINE_EXPECT(concurrent_vector_int_destroy);
+ DEFINE_EXPECT(concurrent_vector_int_copy);
};
#define SET_EXPECT(func) \
@@ -110,6 +112,8 @@ static void * (WINAPI *call_thiscall_func1)( void *func, void *this );
static void * (WINAPI *call_thiscall_func2)( void *func, void *this, const void *a );
static void * (WINAPI *call_thiscall_func3)( void *func, void *this, const void *a,
const void *b );
+static void * (WINAPI *call_thiscall_func4)( void *func, void *this, const void *a,
+ const void *b, const void *c );
static void init_thiscall_thunk(void)
{
@@ -123,18 +127,22 @@ static void init_thiscall_thunk(void)
call_thiscall_func1 = (void *)thunk;
call_thiscall_func2 = (void *)thunk;
call_thiscall_func3 = (void *)thunk;
+ call_thiscall_func4 = (void *)thunk;
}
#define call_func1(func,_this) call_thiscall_func1(func,_this)
#define call_func2(func,_this,a) call_thiscall_func2(func,_this,(const void*)(a))
#define call_func3(func,_this,a,b) call_thiscall_func3(func,_this,(const void*)(a),\
(const void*)(b))
+#define call_func4(func,_this,a,b,c) call_thiscall_func4(func,_this,(const void*)(a),\
+ (const void*)(b),(const void*)(c))
#else
#define init_thiscall_thunk()
#define call_func1(func,_this) func(_this)
#define call_func2(func,_this,a) func(_this,a)
#define call_func3(func,_this,a,b) func(_this,a,b)
+#define call_func4(func,_this,a,b,c) func(_this,a,b,c)
#endif /* __i386__ */
static inline float __port_infinity(void)
@@ -382,6 +390,8 @@ static void* (__thiscall *p_vector_base_v4__Internal_push_back)(
vector_base_v4*, size_t, size_t*);
static size_t (__thiscall *p_vector_base_v4__Internal_clear)(
vector_base_v4*, void (__cdecl*)(void*, size_t));
+static void (__thiscall *p_vector_base_v4__Internal_copy)(
+ vector_base_v4*, vector_base_v4*, size_t, void (__cdecl*)(void*, const void*, size_t));
static HMODULE msvcp;
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y)
@@ -524,6 +534,8 @@ static BOOL init(void)
"?_Internal_push_back(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IEAAPEAX_KAEA_K(a)Z");
SET(p_vector_base_v4__Internal_clear,
"?_Internal_clear(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IEAA_KP6AXPEAX_K(a)Z@Z");
+ SET(p_vector_base_v4__Internal_copy,
+ "?_Internal_copy(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IEAAXAEBV123(a)_KP6AXPEAXPEBX1@Z(a)Z");
} else {
SET(p_tr2_sys__File_size,
"?_File_size(a)sys@tr2(a)std@@YA_KPBD(a)Z");
@@ -635,6 +647,8 @@ static BOOL init(void)
"?_Internal_push_back(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAEPAXIAAI(a)Z");
SET(p_vector_base_v4__Internal_clear,
"?_Internal_clear(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAEIP6AXPAXI(a)Z@Z");
+ SET(p_vector_base_v4__Internal_copy,
+ "?_Internal_copy(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAEXABV123(a)IP6AXPAXPBXI@Z(a)Z");
#else
SET(p__Thrd_current,
"_Thrd_current");
@@ -674,6 +688,8 @@ static BOOL init(void)
"?_Internal_push_back(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAAPAXIAAI(a)Z");
SET(p_vector_base_v4__Internal_clear,
"?_Internal_clear(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAAIP6AXPAXI(a)Z@Z");
+ SET(p_vector_base_v4__Internal_copy,
+ "?_Internal_copy(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAAXABV123(a)IP6AXPAXPBXI@Z(a)Z");
#endif
}
SET(p__Thrd_equal,
@@ -2459,6 +2475,8 @@ static void* __cdecl concurrent_vector_int_alloc(vector_base_v4 *this, size_t n)
static void __cdecl concurrent_vector_int_destroy(void *ptr, size_t n)
{
CHECK_EXPECT2(concurrent_vector_int_destroy);
+ ok(vector_elem_count >= n, "invalid destroy\n");
+ vector_elem_count -= n;
memset(ptr, 0xff, sizeof(int)*n);
}
@@ -2484,6 +2502,13 @@ static void concurrent_vector_int_dtor(vector_base_v4 *this)
call_func1(p_vector_base_v4_dtor, this);
}
+static void __cdecl concurrent_vector_int_copy(void *dst, const void *src, size_t n)
+{
+ CHECK_EXPECT2(concurrent_vector_int_copy);
+ vector_elem_count += n;
+ memcpy(dst, src, n*sizeof(int));
+}
+
static void test_queue_base_v4(void)
{
queue_base_v4 queue;
@@ -2677,7 +2702,7 @@ static void test_queue_base_v4(void)
static void test_vector_base_v4(void)
{
- vector_base_v4 vector;
+ vector_base_v4 vector, v2;
size_t idx, size;
int *data;
@@ -2695,6 +2720,7 @@ static void test_vector_base_v4(void)
CHECK_CALLED(concurrent_vector_int_alloc);
ok(data != NULL, "_Internal_push_back returned NULL\n");
ok(idx == 0, "idx got %ld expected %d\n", (long)idx, 0);
+ vector_elem_count++;
*data = 1;
ok(data == vector.storage[0], "vector.storage[0] got %p expected %p\n",
vector.storage[0], data);
@@ -2709,6 +2735,7 @@ static void test_vector_base_v4(void)
data = call_func3(p_vector_base_v4__Internal_push_back, &vector, sizeof(int), &idx);
ok(data != NULL, "_Internal_push_back returned NULL\n");
ok(idx == 1, "idx got %ld expected 1\n", (long)idx);
+ vector_elem_count++;
*data = 2;
ok(vector.first_block == 1, "vector.first_block got %ld expected 1\n",
(long)vector.first_block);
@@ -2723,6 +2750,7 @@ static void test_vector_base_v4(void)
CHECK_CALLED(concurrent_vector_int_alloc);
ok(data != NULL, "_Internal_push_back returned NULL\n");
ok(idx == 2, "idx got %ld expected 2\n", (long)idx);
+ vector_elem_count++;
*data = 3;
ok(vector.first_block == 1, "vector.first_block got %ld expected 1\n",
(long)vector.first_block);
@@ -2735,6 +2763,7 @@ static void test_vector_base_v4(void)
data = call_func3(p_vector_base_v4__Internal_push_back, &vector, sizeof(int), &idx);
ok(data != NULL, "_Internal_push_back returned NULL\n");
ok(idx == 3, "idx got %ld expected 3\n", (long)idx);
+ vector_elem_count++;
*data = 4;
size = (size_t)call_func1(p_vector_base_v4__Internal_capacity, &vector);
ok(size == 4, "size of vector got %ld expected 4\n", (long)size);
@@ -2744,10 +2773,28 @@ static void test_vector_base_v4(void)
CHECK_CALLED(concurrent_vector_int_alloc);
ok(data != NULL, "_Internal_push_back returned NULL\n");
ok(idx == 4, "idx got %ld expected 2\n", (long)idx);
+ vector_elem_count++;
*data = 5;
size = (size_t)call_func1(p_vector_base_v4__Internal_capacity, &vector);
ok(size == 8, "size of vector got %ld expected 8\n", (long)size);
+ concurrent_vector_int_ctor(&v2);
+ SET_EXPECT(concurrent_vector_int_alloc);
+ SET_EXPECT(concurrent_vector_int_copy);
+ call_func4(p_vector_base_v4__Internal_copy, &v2, &vector,
+ sizeof(int), concurrent_vector_int_copy);
+ CHECK_CALLED(concurrent_vector_int_alloc);
+ CHECK_CALLED(concurrent_vector_int_copy);
+ ok(v2.first_block == 3, "v2.first_block got %ld expected 3\n",
+ (long)v2.first_block);
+ ok(v2.early_size == 5, "v2.early_size got %ld expected 5\n",
+ (long)v2.early_size);
+
+ SET_EXPECT(concurrent_vector_int_destroy);
+ size = (size_t)call_func2(p_vector_base_v4__Internal_clear,
+ &v2, concurrent_vector_int_destroy);
+ concurrent_vector_int_dtor(&v2);
+
SET_EXPECT(concurrent_vector_int_destroy);
size = (size_t)call_func2(p_vector_base_v4__Internal_clear,
&vector, concurrent_vector_int_destroy);
@@ -2759,6 +2806,7 @@ static void test_vector_base_v4(void)
(long)vector.early_size);
concurrent_vector_int_dtor(&vector);
+ ok(!vector_elem_count, "vector_elem_count = %d, expected 0\n", vector_elem_count);
ok(!vector_alloc_count, "vector_alloc_count = %d, expected 0\n", vector_alloc_count);
}
--
2.11.0
June 15, 2018
Re: [PATCH] gdiplus: Check return value of SelectClipPath in brush_fill_path().
by Vincent Povirk
It looks like we also encountered this case in get_path_hrgn. Maybe we
shouldn't call brush_fill_pixels if the path is empty? If we're going
to ignore errors, I think we should at least check GetLastError() to
make sure it's one we expect.
On Fri, Jun 15, 2018 at 4:04 AM, Zhiyi Zhang <zzhang(a)codeweavers.com> wrote:
> For Crossover bug 16126.
>
> When GraphicPath is empty, filling path with gdi32 will
> result in a DC with empty path. When SelectClipPath() is
> called with such a DC, it will fail because it requires
> a closed path in DC. Thus further operation should be canceled.
>
> Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
> ---
> dlls/gdiplus/graphics.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
> index 76aabe74bf..2a95d686fa 100644
> --- a/dlls/gdiplus/graphics.c
> +++ b/dlls/gdiplus/graphics.c
> @@ -1052,6 +1052,7 @@ static BOOL brush_can_fill_path(GpBrush *brush, BOOL is_fill)
>
> static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
> {
> + BOOL success;
> switch (brush->bt)
> {
> case BrushTypeSolidColor:
> @@ -1064,8 +1065,8 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
> RECT rc;
> /* partially transparent fill */
>
> - SelectClipPath(graphics->hdc, RGN_AND);
> - if (GetClipBox(graphics->hdc, &rc) != NULLREGION)
> + success = SelectClipPath(graphics->hdc, RGN_AND);
> + if (success && GetClipBox(graphics->hdc, &rc) != NULLREGION)
> {
> HDC hdc = CreateCompatibleDC(NULL);
>
> --
> 2.17.1
>
>
>
June 15, 2018
Re: [PATCH] msvcp120: Add test for concurrent_vector_copy.
by Piotr Caban
Hi Hua,
On 06/15/18 15:47, Hua Meng wrote:
> +static void (__thiscall *p_vector_base_v4__Internal_copy)(
> + vector_base_v4*, void (__cdecl*)(void*, size_t));
This doesn't match _Internal_copy header. It also breaks 64-bit compilation:
dlls/msvcp120/tests/msvcp120.c:2784:16: error: too many arguments to
function 'p_vector_base_v4__Internal_copy'
Thanks,
Piotr
June 15, 2018
Re: [PATCH] msvcp120: Add test for concurrent_vector_copy.
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39157
Your paranoid android.
=== build (build) ===
Rebuild of 64-bit crossbuild failed
June 15, 2018
[PATCH] msvcp120: Add test for concurrent_vector_copy.
by Hua Meng
Signed-off-by: Hua meng <161220092(a)smail.nju.edu.cn>
---
dlls/msvcp120/tests/msvcp120.c | 50 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c
index 1247222..fee012d 100644
--- a/dlls/msvcp120/tests/msvcp120.c
+++ b/dlls/msvcp120/tests/msvcp120.c
@@ -26,6 +26,7 @@
DWORD expect_idx;
static int vector_alloc_count;
+static int vector_elem_count;
#define DEFINE_EXPECT(func) \
BOOL expect_ ## func, called_ ## func
@@ -38,6 +39,7 @@ struct expect_struct {
DEFINE_EXPECT(queue_char__Assign_and_destroy_item);
DEFINE_EXPECT(concurrent_vector_int_alloc);
DEFINE_EXPECT(concurrent_vector_int_destroy);
+ DEFINE_EXPECT(concurrent_vector_int_copy);
};
#define SET_EXPECT(func) \
@@ -110,6 +112,8 @@ static void * (WINAPI *call_thiscall_func1)( void *func, void *this );
static void * (WINAPI *call_thiscall_func2)( void *func, void *this, const void *a );
static void * (WINAPI *call_thiscall_func3)( void *func, void *this, const void *a,
const void *b );
+static void * (WINAPI *call_thiscall_func4)( void *func, void *this, const void *a,
+ const void *b, const void *c );
static void init_thiscall_thunk(void)
{
@@ -123,18 +127,22 @@ static void init_thiscall_thunk(void)
call_thiscall_func1 = (void *)thunk;
call_thiscall_func2 = (void *)thunk;
call_thiscall_func3 = (void *)thunk;
+ call_thiscall_func4 = (void *)thunk;
}
#define call_func1(func,_this) call_thiscall_func1(func,_this)
#define call_func2(func,_this,a) call_thiscall_func2(func,_this,(const void*)(a))
#define call_func3(func,_this,a,b) call_thiscall_func3(func,_this,(const void*)(a),\
(const void*)(b))
+#define call_func4(func,_this,a,b,c) call_thiscall_func4(func,_this,(const void*)(a),\
+ (const void*)(b),(const void*)(c))
#else
#define init_thiscall_thunk()
#define call_func1(func,_this) func(_this)
#define call_func2(func,_this,a) func(_this,a)
#define call_func3(func,_this,a,b) func(_this,a,b)
+#define call_func4(func,_this,a,b,c) func(_this,a,b,c)
#endif /* __i386__ */
static inline float __port_infinity(void)
@@ -382,6 +390,8 @@ static void* (__thiscall *p_vector_base_v4__Internal_push_back)(
vector_base_v4*, size_t, size_t*);
static size_t (__thiscall *p_vector_base_v4__Internal_clear)(
vector_base_v4*, void (__cdecl*)(void*, size_t));
+static void (__thiscall *p_vector_base_v4__Internal_copy)(
+ vector_base_v4*, void (__cdecl*)(void*, size_t));
static HMODULE msvcp;
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y)
@@ -524,6 +534,8 @@ static BOOL init(void)
"?_Internal_push_back(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IEAAPEAX_KAEA_K(a)Z");
SET(p_vector_base_v4__Internal_clear,
"?_Internal_clear(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IEAA_KP6AXPEAX_K(a)Z@Z");
+ SET(p_vector_base_v4__Internal_copy,
+ "?_Internal_copy(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IEAAXAEBV123(a)_KP6AXPEAXPEBX1@Z(a)Z");
} else {
SET(p_tr2_sys__File_size,
"?_File_size(a)sys@tr2(a)std@@YA_KPBD(a)Z");
@@ -635,6 +647,8 @@ static BOOL init(void)
"?_Internal_push_back(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAEPAXIAAI(a)Z");
SET(p_vector_base_v4__Internal_clear,
"?_Internal_clear(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAEIP6AXPAXI(a)Z@Z");
+ SET(p_vector_base_v4__Internal_copy,
+ "?_Internal_copy(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAEXABV123(a)IP6AXPAXPBXI@Z(a)Z");
#else
SET(p__Thrd_current,
"_Thrd_current");
@@ -674,6 +688,8 @@ static BOOL init(void)
"?_Internal_push_back(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAAPAXIAAI(a)Z");
SET(p_vector_base_v4__Internal_clear,
"?_Internal_clear(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAAIP6AXPAXI(a)Z@Z");
+ SET(p_vector_base_v4__Internal_copy,
+ "?_Internal_copy(a)_Concurrent_vector_base_v4@details(a)Concurrency@@IAAXABV123(a)IP6AXPAXPBXI@Z(a)Z");
#endif
}
SET(p__Thrd_equal,
@@ -2459,6 +2475,8 @@ static void* __cdecl concurrent_vector_int_alloc(vector_base_v4 *this, size_t n)
static void __cdecl concurrent_vector_int_destroy(void *ptr, size_t n)
{
CHECK_EXPECT2(concurrent_vector_int_destroy);
+ ok(vector_elem_count >= n, "invalid destroy\n");
+ vector_elem_count -= n;
memset(ptr, 0xff, sizeof(int)*n);
}
@@ -2484,6 +2502,13 @@ static void concurrent_vector_int_dtor(vector_base_v4 *this)
call_func1(p_vector_base_v4_dtor, this);
}
+static void __cdecl concurrent_vector_int_copy(void *dst, const void *src, size_t n)
+{
+ CHECK_EXPECT2(concurrent_vector_int_copy);
+ vector_elem_count += n;
+ memcpy(dst, src, n*sizeof(int));
+}
+
static void test_queue_base_v4(void)
{
queue_base_v4 queue;
@@ -2677,7 +2702,7 @@ static void test_queue_base_v4(void)
static void test_vector_base_v4(void)
{
- vector_base_v4 vector;
+ vector_base_v4 vector, v2;
size_t idx, size;
int *data;
@@ -2695,6 +2720,7 @@ static void test_vector_base_v4(void)
CHECK_CALLED(concurrent_vector_int_alloc);
ok(data != NULL, "_Internal_push_back returned NULL\n");
ok(idx == 0, "idx got %ld expected %d\n", (long)idx, 0);
+ vector_elem_count++;
*data = 1;
ok(data == vector.storage[0], "vector.storage[0] got %p expected %p\n",
vector.storage[0], data);
@@ -2709,6 +2735,7 @@ static void test_vector_base_v4(void)
data = call_func3(p_vector_base_v4__Internal_push_back, &vector, sizeof(int), &idx);
ok(data != NULL, "_Internal_push_back returned NULL\n");
ok(idx == 1, "idx got %ld expected 1\n", (long)idx);
+ vector_elem_count++;
*data = 2;
ok(vector.first_block == 1, "vector.first_block got %ld expected 1\n",
(long)vector.first_block);
@@ -2723,6 +2750,7 @@ static void test_vector_base_v4(void)
CHECK_CALLED(concurrent_vector_int_alloc);
ok(data != NULL, "_Internal_push_back returned NULL\n");
ok(idx == 2, "idx got %ld expected 2\n", (long)idx);
+ vector_elem_count++;
*data = 3;
ok(vector.first_block == 1, "vector.first_block got %ld expected 1\n",
(long)vector.first_block);
@@ -2735,6 +2763,7 @@ static void test_vector_base_v4(void)
data = call_func3(p_vector_base_v4__Internal_push_back, &vector, sizeof(int), &idx);
ok(data != NULL, "_Internal_push_back returned NULL\n");
ok(idx == 3, "idx got %ld expected 3\n", (long)idx);
+ vector_elem_count++;
*data = 4;
size = (size_t)call_func1(p_vector_base_v4__Internal_capacity, &vector);
ok(size == 4, "size of vector got %ld expected 4\n", (long)size);
@@ -2744,10 +2773,28 @@ static void test_vector_base_v4(void)
CHECK_CALLED(concurrent_vector_int_alloc);
ok(data != NULL, "_Internal_push_back returned NULL\n");
ok(idx == 4, "idx got %ld expected 2\n", (long)idx);
+ vector_elem_count++;
*data = 5;
size = (size_t)call_func1(p_vector_base_v4__Internal_capacity, &vector);
ok(size == 8, "size of vector got %ld expected 8\n", (long)size);
+ concurrent_vector_int_ctor(&v2);
+ SET_EXPECT(concurrent_vector_int_alloc);
+ SET_EXPECT(concurrent_vector_int_copy);
+ call_func4(p_vector_base_v4__Internal_copy, &v2, &vector,
+ sizeof(int), concurrent_vector_int_copy);
+ CHECK_CALLED(concurrent_vector_int_alloc);
+ CHECK_CALLED(concurrent_vector_int_copy);
+ ok(v2.first_block == 3, "v2.first_block got %ld expected 3\n",
+ (long)v2.first_block);
+ ok(v2.early_size == 5, "v2.early_size got %ld expected 5\n",
+ (long)v2.early_size);
+
+ SET_EXPECT(concurrent_vector_int_destroy);
+ size = (size_t)call_func2(p_vector_base_v4__Internal_clear,
+ &v2, concurrent_vector_int_destroy);
+ concurrent_vector_int_dtor(&v2);
+
SET_EXPECT(concurrent_vector_int_destroy);
size = (size_t)call_func2(p_vector_base_v4__Internal_clear,
&vector, concurrent_vector_int_destroy);
@@ -2759,6 +2806,7 @@ static void test_vector_base_v4(void)
(long)vector.early_size);
concurrent_vector_int_dtor(&vector);
+ ok(!vector_elem_count, "vector_elem_count = %d, expected 0\n", vector_elem_count);
ok(!vector_alloc_count, "vector_alloc_count = %d, expected 0\n", vector_alloc_count);
}
--
2.11.0
June 15, 2018
Re: [PATCH v3] comctl32/taskdialog: Add support for progress bar.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
June 15, 2018
[PATCH] testbot/web: Escape the filenames on the activity page.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/web/Activity.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testbot/web/Activity.pl b/testbot/web/Activity.pl
index 8b1fd6dc5..512401751 100644
--- a/testbot/web/Activity.pl
+++ b/testbot/web/Activity.pl
@@ -215,7 +215,7 @@ EOF
}
else
{
- $Label .= " ". $VMStatus->{step}->FileName;
+ $Label .= " ". $self->escapeHTML($VMStatus->{step}->FileName);
if ($VMStatus->{task}->CmdLineArg =~ /^\w+$/ and
$Label =~ s/_(?:cross)?test(64)?\.exe$//)
{
--
2.17.1
June 15, 2018
Re: [PATCH] d3dx9/tests: Add initial tests for ID3DXFont::DrawText().
by Alexandre Julliard
Matteo Bruni <mbruni(a)codeweavers.com> writes:
> From: Kieran Duggan <kieranduggan15(a)gmail.com>
>
> Signed-off-by: Kieran Duggan <kieranduggan15(a)gmail.com>
> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
> ---
> dlls/d3dx9_36/tests/core.c | 81 +++++++++++++++++++++++++++++++++++-----------
> 1 file changed, 62 insertions(+), 19 deletions(-)
The tests fail:
../../../tools/runtest -q -P wine -T ../../.. -M d3dx9_36.dll -p d3dx9_36_test.exe.so core && touch core.ok
core.c:612: Test failed: Got unexpected height 1.
core.c:614: Test failed: Got unexpected height 1.
core.c:616: Test failed: Got unexpected height 1.
core.c:619: Test failed: Got unexpected height 1.
core.c:624: Test failed: Got unexpected height 1.
core.c:627: Test failed: Got unexpected rect right 0.
core.c:628: Test failed: Got unexpected rect bottom 0.
core.c:612: Test failed: Got unexpected height 1.
core.c:614: Test failed: Got unexpected height 1.
core.c:616: Test failed: Got unexpected height 1.
core.c:619: Test failed: Got unexpected height 1.
core.c:624: Test failed: Got unexpected height 1.
core.c:627: Test failed: Got unexpected rect right 0.
core.c:628: Test failed: Got unexpected rect bottom 0.
core.c:612: Test failed: Got unexpected height 1.
core.c:614: Test failed: Got unexpected height 1.
core.c:616: Test failed: Got unexpected height 1.
core.c:619: Test failed: Got unexpected height 1.
core.c:624: Test failed: Got unexpected height 1.
core.c:627: Test failed: Got unexpected rect right 0.
core.c:628: Test failed: Got unexpected rect bottom 0.
core.c:612: Test failed: Got unexpected height 1.
core.c:614: Test failed: Got unexpected height 1.
core.c:616: Test failed: Got unexpected height 1.
core.c:619: Test failed: Got unexpected height 1.
core.c:624: Test failed: Got unexpected height 1.
core.c:627: Test failed: Got unexpected rect right 0.
core.c:628: Test failed: Got unexpected rect bottom 0.
core.c:612: Test failed: Got unexpected height 1.
core.c:614: Test failed: Got unexpected height 1.
core.c:616: Test failed: Got unexpected height 1.
core.c:619: Test failed: Got unexpected height 1.
core.c:624: Test failed: Got unexpected height 1.
core.c:627: Test failed: Got unexpected rect right 0.
core.c:628: Test failed: Got unexpected rect bottom 0.
Makefile:234: recipe for target 'core.ok' failed
make[1]: *** [core.ok] Error 35
--
Alexandre Julliard
julliard(a)winehq.org
June 15, 2018
[PATCH] po: Update Russian translation.
by Nikolay Sivov
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
po/ru.po | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/po/ru.po b/po/ru.po
index b973cae0f5..3fb6927e7b 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -5,14 +5,14 @@ msgstr ""
"Project-Id-Version: Wine\n"
"Report-Msgid-Bugs-To: https://bugs.winehq.org\n"
"POT-Creation-Date: N/A\n"
-"PO-Revision-Date: 2018-05-10 08:12+0300\n"
+"PO-Revision-Date: 2018-06-15 13:16+0300\n"
"Last-Translator: Nikolay Sivov <nsivov(a)codeweavers.com>\n"
"Language-Team: Russian\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 2.0.7\n"
+"X-Generator: Poedit 2.0.8\n"
#: appwiz.rc:58
msgid "Install/Uninstall"
@@ -3697,19 +3697,19 @@ msgstr "Ожидается объект типа «Array»"
msgid ""
"'writable' attribute on the property descriptor cannot be set to 'true' on "
"this object"
-msgstr ""
+msgstr "Невозможно установить атрибут «writable» в «true» для этого объекта"
#: jscript.rc:70
msgid "Cannot redefine non-configurable property '|'"
-msgstr ""
+msgstr "Невозможно переопределить ненастраиваемое свойство «|»"
#: jscript.rc:71
msgid "Cannot modify non-writable property '|'"
-msgstr ""
+msgstr "Невозможно изменить свойство «|»"
#: jscript.rc:72
msgid "Property cannot have both accessors and a value"
-msgstr ""
+msgstr "Свойство не может одновременно иметь методы для доступа и значение"
#: ../../include/wine/wine_common_ver.rc:129
msgid "Wine kernel DLL"
@@ -12801,10 +12801,8 @@ msgid "Confirm Value Delete"
msgstr "Подтверждение удаления значения"
#: regedit.rc:210
-#, fuzzy
-#| msgid "Are you sure you want to delete the registry value '%1'?"
msgid "Are you sure you want to delete the selected registry value?"
-msgstr "Вы точно хотите удалить параметр реестра «%1»?"
+msgstr "Вы точно хотите удалить выбранный параметр реестра?"
#: regedit.rc:216
msgid "Search complete. The string '%1' was not found."
--
2.17.1
June 15, 2018
[PATCH] testbot/WineRunTask: Rename a TakeScreenshot() parameter.
by Francois Gouget
It had the same name as a global variable which made the code a bit
confusing.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/WineRunTask.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 8f5cb268c..90008f035 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -71,14 +71,14 @@ sub Error(@)
sub TakeScreenshot($$)
{
- my ($VM, $FullScreenshotFileName) = @_;
+ my ($VM, $FileName) = @_;
my $Domain = $VM->GetDomain();
my ($ErrMessage, $ImageSize, $ImageBytes) = $Domain->CaptureScreenImage();
if (!defined $ErrMessage)
{
my $OldUMask = umask(002);
- if (open(my $Screenshot, ">", $FullScreenshotFileName))
+ if (open(my $Screenshot, ">", $FileName))
{
print $Screenshot $ImageBytes;
close($Screenshot);
--
2.17.1
June 15, 2018
[PATCH] testbot/web: Remove the live screenshot code.
by Francois Gouget
When 'live snapshots' are supported again it will likely
be in a different form so remove the cruft.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/web/JobDetails.pl | 24 +-----------------------
1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/testbot/web/JobDetails.pl b/testbot/web/JobDetails.pl
index 3e638f717..70d8b5983 100644
--- a/testbot/web/JobDetails.pl
+++ b/testbot/web/JobDetails.pl
@@ -257,30 +257,8 @@ sub GenerateBody($)
my $Screenshot = $self->GetParam($ScreenshotParamName);
$Screenshot = "" if ($Screenshot ne "1");
-
print "<div class='TaskMoreInfoLinks'>\n";
- # FIXME: Disable live screenshots for now
- if (0 && $StepTask->Status eq "running" &&
- ($StepTask->Type eq "single" || $StepTask->Type eq "suite"))
- {
- if ($Screenshot)
- {
- my $URI = "/Screenshot.pl?VMName=" . uri_escape($VM->Name);
- print "<div class='Screenshot'><img src='" .
- $self->CGI->escapeHTML($URI) . "' alt='Screenshot' /></div>\n";
- }
- else
- {
- my $URI = $ENV{"SCRIPT_NAME"} . "?Key=" . uri_escape($self->{JobId}) .
- "&$ScreenshotParamName=1";
- $URI .= "#k" . uri_escape($Key);
- print "<div class='TaskMoreInfoLink'><a href='" .
- $self->CGI->escapeHTML($URI) .
- "'>Show live screenshot</a></div>";
- print "\n";
- }
- }
- elsif (-r "$TaskDir/screenshot.png")
+ if (-r "$TaskDir/screenshot.png")
{
if ($Screenshot)
{
--
2.17.1
June 15, 2018
[PATCH] testbot/bin: Remove some global variables.
by Francois Gouget
The variable names are longer than the values they replace and
make the code less readable due to the extra indirection.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/WineRunBuild.pl | 15 ++++++---------
testbot/bin/WineRunReconfig.pl | 15 ++++++---------
testbot/bin/WineRunTask.pl | 26 +++++++++++---------------
3 files changed, 23 insertions(+), 33 deletions(-)
diff --git a/testbot/bin/WineRunBuild.pl b/testbot/bin/WineRunBuild.pl
index 96d9321b8..eab33bc08 100755
--- a/testbot/bin/WineRunBuild.pl
+++ b/testbot/bin/WineRunBuild.pl
@@ -162,15 +162,12 @@ if (!defined $Task)
Error "Step $StepNo task $TaskNo of job $JobId does not exist\n";
exit 1;
}
-
my $OldUMask = umask(002);
my $TaskDir = $Task->CreateDir();
umask($OldUMask);
-my $FullLogFileName = "$TaskDir/log";
-my $FullErrFileName = "$TaskDir/err";
-
my $VM = $Task->VM;
+
my $Start = Time();
LogMsg "Task $JobId/$StepNo/$TaskNo started\n";
@@ -185,14 +182,14 @@ sub LogTaskError($)
Debug("$Name0:error: ", $ErrMessage);
my $OldUMask = umask(002);
- if (open(my $ErrFile, ">>", $FullErrFileName))
+ if (open(my $ErrFile, ">>", "$TaskDir/err"))
{
print $ErrFile $ErrMessage;
close($ErrFile);
}
else
{
- Error "Unable to open '$FullErrFileName' for writing: $!\n";
+ Error "Unable to open 'err' for writing: $!\n";
}
umask($OldUMask);
}
@@ -391,10 +388,10 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
}
}
-Debug(Elapsed($Start), " Retrieving the build log to '$FullLogFileName'\n");
-if ($TA->GetFile("Build.log", $FullLogFileName))
+Debug(Elapsed($Start), " Retrieving 'Build.log'\n");
+if ($TA->GetFile("Build.log", "$TaskDir/log"))
{
- if (open(my $LogFile, "<", $FullLogFileName))
+ if (open(my $LogFile, "<", "$TaskDir/log"))
{
# Collect and analyze the 'Build:' status line(s)
$ErrMessage ||= "";
diff --git a/testbot/bin/WineRunReconfig.pl b/testbot/bin/WineRunReconfig.pl
index 4fb34a07d..e7b447e92 100755
--- a/testbot/bin/WineRunReconfig.pl
+++ b/testbot/bin/WineRunReconfig.pl
@@ -161,14 +161,11 @@ if (!defined $Task)
Error "Step $StepNo task $TaskNo of job $JobId does not exist\n";
exit 1;
}
-
my $OldUMask = umask(002);
my $TaskDir = $Task->CreateDir();
umask($OldUMask);
-
my $VM = $Task->VM;
-my $FullLogFileName = "$TaskDir/log";
-my $FullErrFileName = "$TaskDir/err";
+
my $Start = Time();
LogMsg "Task $JobId/$StepNo/$TaskNo started\n";
@@ -184,14 +181,14 @@ sub LogTaskError($)
Debug("$Name0:error: ", $ErrMessage);
my $OldUMask = umask(002);
- if (open(my $ErrFile, ">>", $FullErrFileName))
+ if (open(my $ErrFile, ">>", "$TaskDir/err"))
{
print $ErrFile $ErrMessage;
close($ErrFile);
}
else
{
- Error "Unable to open '$FullErrFileName' for writing: $!\n";
+ Error "Unable to open 'err' for writing: $!\n";
}
umask($OldUMask);
}
@@ -373,10 +370,10 @@ if (!defined $TA->Wait($Pid, $Task->Timeout, 60))
}
}
-Debug(Elapsed($Start), " Retrieving the reconfig log to '$FullLogFileName'\n");
-if ($TA->GetFile("Reconfig.log", $FullLogFileName))
+Debug(Elapsed($Start), " Retrieving 'Reconfig.log'\n");
+if ($TA->GetFile("Reconfig.log", "$TaskDir/log"))
{
- if (open(my $LogFile, "<", $FullLogFileName))
+ if (open(my $LogFile, "<", "$TaskDir/log"))
{
# Collect and analyze the 'Reconfig:' status line(s).
my $LogErrors;
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 90008f035..15f8752fb 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -191,17 +191,13 @@ if (!defined $Task)
Error "Step $StepNo task $TaskNo of job $JobId does not exist\n";
exit 1;
}
-
my $OldUMask = umask(002);
my $TaskDir = $Task->CreateDir();
umask($OldUMask);
-my $FullLogFileName = "$TaskDir/log";
-my $FullErrFileName = "$TaskDir/err";
-my $FullScreenshotFileName = "$TaskDir/screenshot.png";
-
my $VM = $Task->VM;
my $RptFileName = $VM->Name . ".rpt";
+
my $Start = Time();
LogMsg "Task $JobId/$StepNo/$TaskNo started\n";
@@ -216,14 +212,14 @@ sub LogTaskError($)
Debug("$Name0:error: ", $ErrMessage);
my $OldUMask = umask(002);
- if (open(my $ErrFile, ">>", $FullErrFileName))
+ if (open(my $ErrFile, ">>", "$TaskDir/err"))
{
print $ErrFile $ErrMessage;
close($ErrFile);
}
else
{
- Error "Unable to open '$FullErrFileName' for writing: $!\n";
+ Error "Unable to open 'err' for writing: $!\n";
}
umask($OldUMask);
}
@@ -237,7 +233,7 @@ sub WrapUpAndExit($;$$$)
$Timeout ? "timeout" : "";
Debug(Elapsed($Start), " Taking a screenshot\n");
- TakeScreenshot($VM, $FullScreenshotFileName);
+ TakeScreenshot($VM, "$TaskDir/screenshot.png");
my $Tries = $Task->TestFailures || 0;
if ($Retry)
@@ -299,9 +295,9 @@ sub WrapUpAndExit($;$$$)
my $LatestBaseName = join("", "$DataDir/latest/", $Task->VM->Name, "_",
$Step->FileType eq "exe64" ? "64" : "32");
unlink("$LatestBaseName.log");
- link($FullLogFileName, "$LatestBaseName.log") if (-f $FullLogFileName);
+ link("$TaskDir/log", "$LatestBaseName.log") if (-f "$TaskDir/log");
unlink("$LatestBaseName.err");
- link($FullErrFileName, "$LatestBaseName.err") if (-f $FullErrFileName);
+ link("$TaskDir/err", "$LatestBaseName.err") if (-f "$TaskDir/err");
}
my $Result = $VM->Name .": ". $VM->Status ." Status: $Status Failures: ". (defined $TestFailures ? $TestFailures : "unset");
@@ -516,11 +512,11 @@ if (!defined $TA->Wait($Pid, $Timeout, $Keepalive))
}
my $TimedOut;
-Debug(Elapsed($Start), " Retrieving the report file to '$FullLogFileName'\n");
-if ($TA->GetFile($RptFileName, $FullLogFileName))
+Debug(Elapsed($Start), " Retrieving the report file to 'log'\n");
+if ($TA->GetFile($RptFileName, "$TaskDir/log"))
{
- chmod 0664, $FullLogFileName;
- if (open(my $LogFile, "<", $FullLogFileName))
+ chmod 0664, "$TaskDir/log";
+ if (open(my $LogFile, "<", "$TaskDir/log"))
{
# There is more than one test unit when running the full test suite so keep
# track of the current one. Note that for the TestBot we don't count or
@@ -786,7 +782,7 @@ if ($TA->GetFile($RptFileName, $FullLogFileName))
else
{
$NewStatus = 'boterror';
- Error "Unable to open '$FullLogFileName' for reading: $!\n";
+ Error "Unable to open 'log' for reading: $!\n";
LogTaskError("Unable to open the log file for reading: $!\n");
}
}
--
2.17.1
June 15, 2018
[PATCH] testbot: Simplify passing the Job URL to WineTest.
by Francois Gouget
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/bin/WineRunTask.pl | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/testbot/bin/WineRunTask.pl b/testbot/bin/WineRunTask.pl
index 15f8752fb..3b0ccbc4a 100755
--- a/testbot/bin/WineRunTask.pl
+++ b/testbot/bin/WineRunTask.pl
@@ -448,8 +448,7 @@ elsif ($Step->Type eq "suite")
if (defined($WebHostName))
{
my $StepTask = 100 * $StepNo + $TaskNo;
- $Script .= '-u "http://' . $WebHostName . "/JobDetails.pl?Key=" .
- $JobId . "&scrshot_" . $StepTask . "=1#k" . $StepTask . '" ';
+ $Script .= "-u \"http://$WebHostName/JobDetails.pl?Key=$JobId&scrshot_$StepTask=1#k$StepTask\"";
}
my $Info = $VM->Description ? $VM->Description : "";
if ($VM->Details)
--
2.17.1
June 15, 2018
[PATCH] gdiplus: Check return value of SelectClipPath in brush_fill_path().
by Zhiyi Zhang
For Crossover bug 16126.
When GraphicPath is empty, filling path with gdi32 will
result in a DC with empty path. When SelectClipPath() is
called with such a DC, it will fail because it requires
a closed path in DC. Thus further operation should be canceled.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/gdiplus/graphics.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 76aabe74bf..2a95d686fa 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1052,6 +1052,7 @@ static BOOL brush_can_fill_path(GpBrush *brush, BOOL is_fill)
static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
{
+ BOOL success;
switch (brush->bt)
{
case BrushTypeSolidColor:
@@ -1064,8 +1065,8 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
RECT rc;
/* partially transparent fill */
- SelectClipPath(graphics->hdc, RGN_AND);
- if (GetClipBox(graphics->hdc, &rc) != NULLREGION)
+ success = SelectClipPath(graphics->hdc, RGN_AND);
+ if (success && GetClipBox(graphics->hdc, &rc) != NULLREGION)
{
HDC hdc = CreateCompatibleDC(NULL);
--
2.17.1
June 15, 2018
Re: [PATCH v5 4/8] ntdll: Return BIOS info from NtQuerySystemInformation on Linux
by Huw Davies
On Fri, Jun 15, 2018 at 12:59:10AM -0600, Alex Henrie wrote:
> Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
> ---
> dlls/ntdll/nt.c | 174 ++++++++++++++++++++++++++++++++++++++++
> dlls/ntdll/tests/info.c | 14 ++--
> 2 files changed, 182 insertions(+), 6 deletions(-)
>
> diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
> index dc0ce04f42..658970b051 100644
> --- a/dlls/ntdll/nt.c
> +++ b/dlls/ntdll/nt.c
> @@ -66,6 +66,35 @@
>
> WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
>
> +#include "pshpack1.h"
> +
> +struct smbios_prologue {
> + BYTE calling_method;
> + BYTE major_version;
> + BYTE minor_version;
> + BYTE revision;
> + DWORD length;
> +};
> +
> +struct smbios_bios {
> + BYTE type;
> + BYTE length;
> + WORD handle;
> + BYTE vendor;
> + BYTE version;
> + WORD start;
> + BYTE date;
> + BYTE size;
> + UINT64 characteristics;
> +};
> +
> +#include "poppack.h"
> +
> +/* Firmware table providers */
> +#define ACPI 0x41435049
> +#define FIRM 0x4649524D
> +#define RSMB 0x52534D42
> +
> /*
> * Token
> */
> @@ -1850,6 +1879,129 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **
> }
> #endif
>
> +static inline void copy_smbios_string(char **buffer, char *string, size_t string_size)
> +{
> + if (!string) return;
> + strcpy(*buffer, string);
> + *buffer += string_size;
> +}
> +
> +#ifdef linux
> +
> +static char* get_smbios_string(const char *path, size_t *string_size)
> +{
> + FILE *file = fopen(path, "r");
> + char *ret = NULL;
> + *string_size = 0;
> + if (file)
> + {
> + *string_size = getline(&ret, string_size, file) + 1;
I'm not sure we want to use malloc based functions here.
fgets() using a fixed-size buffer with a sensibly chosen size should
be fine.
> + fclose(file);
> + if (*string_size >= 2 && ret[*string_size - 2] == '\n')
> + {
> + ret[*string_size - 2] = 0;
> + (*string_size)--;
> + }
> + if (*string_size == 1)
> + {
> + free(ret);
> + ret = NULL;
> + *string_size = 0;
> + }
> + }
> + return ret;
> +}
> +
> +static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti,
> + ULONG available_len, ULONG *required_len)
> +{
> + switch (sfti->ProviderSignature)
> + {
> + case RSMB:
> + {
> + char *bios_vendor, *bios_version, *bios_date;
> + size_t bios_vendor_size, bios_version_size, bios_date_size;
> + char *buffer = (char*)sfti->TableBuffer;
> + BYTE string_count;
> + struct smbios_prologue *prologue;
> + struct smbios_bios *bios;
> +
> + bios_vendor = get_smbios_string("/sys/class/dmi/id/bios_vendor", &bios_vendor_size);
> + bios_version = get_smbios_string("/sys/class/dmi/id/bios_version", &bios_version_size);
> + bios_date = get_smbios_string("/sys/class/dmi/id/bios_date", &bios_date_size);
> +
> + *required_len = FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
> +
> + *required_len += sizeof(struct smbios_prologue);
> +
> + *required_len += sizeof(struct smbios_bios);
> + *required_len += max(bios_vendor_size + bios_version_size + bios_date_size + 1, 2);
> +
> + if (available_len < *required_len)
> + {
> + return STATUS_BUFFER_TOO_SMALL;
> + }
> +
> + sfti->TableBufferLength = *required_len - FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
> +
> + prologue = (struct smbios_prologue*)buffer;
> + prologue->calling_method = 0;
> + prologue->major_version = 2;
> + prologue->minor_version = 0;
> + prologue->revision = 0;
> + prologue->length = sfti->TableBufferLength - sizeof(struct smbios_prologue);
> + buffer += sizeof(struct smbios_prologue);
> +
> + string_count = 0;
> + bios = (struct smbios_bios*)buffer;
> + bios->type = 0;
> + bios->length = sizeof(struct smbios_bios);
> + bios->handle = 0;
> + bios->vendor = bios_vendor ? ++string_count : 0;
> + bios->version = bios_version ? ++string_count : 0;
> + bios->start = 0;
> + bios->date = bios_date ? ++string_count : 0;
> + bios->size = 0;
> + bios->characteristics = 0x4; /* not supported */
> + buffer += sizeof(struct smbios_bios);
> +
> + if (string_count)
> + {
> + copy_smbios_string(&buffer, bios_vendor, bios_vendor_size);
> + copy_smbios_string(&buffer, bios_version, bios_version_size);
> + copy_smbios_string(&buffer, bios_date, bios_date_size);
> + memset(buffer, 0, 1);
> + }
> + else
> + {
> + memset(buffer, 0, 2);
> + }
> +
> + free(bios_vendor);
> + free(bios_version);
> + free(bios_date);
> +
> + return STATUS_SUCCESS;
> + }
> + default:
> + {
> + return STATUS_NOT_IMPLEMENTED;
> + FIXME("info_class SYSTEM_FIRMWARE_TABLE_INFORMATION\n");
> + }
> + }
> +}
> +
> +#else
> +
> +static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti,
> + ULONG available_len, ULONG *required_len)
> +{
> + return STATUS_NOT_IMPLEMENTED;
> + FIXME("info_class SYSTEM_FIRMWARE_TABLE_INFORMATION\n");
> +}
> +
> +#endif
> +
> /******************************************************************************
> * NtQuerySystemInformation [NTDLL.@]
> * ZwQuerySystemInformation [NTDLL.@]
> @@ -2359,6 +2511,28 @@ NTSTATUS WINAPI NtQuerySystemInformation(
> else ret = STATUS_INFO_LENGTH_MISMATCH;
> }
> break;
> + case SystemFirmwareTableInformation:
> + {
> + SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = (SYSTEM_FIRMWARE_TABLE_INFORMATION*)SystemInformation;
> + len = FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
> + if (Length < len)
> + {
> + ret = STATUS_INFO_LENGTH_MISMATCH;
> + break;
> + }
> +
> + switch (sfti->Action)
> + {
> + case SystemFirmwareTable_Get:
> + ret = get_firmware_info(sfti, Length, &len);
> + break;
> + default:
> + len = 0;
> + ret = STATUS_NOT_IMPLEMENTED;
> + FIXME("info_class SYSTEM_FIRMWARE_TABLE_INFORMATION\n");
> + }
> + }
> + break;
> default:
> FIXME("(0x%08x,%p,0x%08x,%p) stub\n",
> SystemInformationClass,SystemInformation,Length,ResultLength);
> diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
> index cdb91e1b73..b8feebd474 100644
> --- a/dlls/ntdll/tests/info.c
> +++ b/dlls/ntdll/tests/info.c
> @@ -59,6 +59,12 @@ static DWORD one_before_last_pid = 0;
> #define FIRM 0x4649524D
> #define RSMB 0x52534D42
>
> +#ifdef linux
> +static const int firmware_todo = 0;
> +#else
> +static const int firmware_todo = 1;
> +#endif
> +
> static BOOL InitFunctionPtrs(void)
> {
> /* All needed functions are NT based, so using GetModuleHandle is a good check */
> @@ -840,13 +846,10 @@ static void test_query_firmware(void)
> ok(!!sfti, "Failed to allocate memory\n");
>
> status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 15, &len1);
> -todo_wine
> ok(status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
> -todo_wine
> ok(len1 == 16, "Expected length 16, got %u\n", len1);
>
> status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
> -todo_wine
> ok(status == STATUS_NOT_IMPLEMENTED, "Expected STATUS_NOT_IMPLEMENTED, got %08x\n", status);
> ok(len1 == 0, "Expected length 0, got %u\n", len1);
>
> @@ -854,16 +857,15 @@ todo_wine
> sfti->Action = SystemFirmwareTable_Get;
>
> status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
> -todo_wine
> +todo_wine_if(firmware_todo)
> ok(status == STATUS_BUFFER_TOO_SMALL, "Expected STATUS_BUFFER_TOO_SMALL, got %08x\n", status);
> -todo_wine
> ok(len1 >= 16, "Expected length >= 16, got %u\n", len1);
>
> sfti = HeapReAlloc(GetProcessHeap(), 0, sfti, len1);
> ok(!!sfti, "Failed to allocate memory\n");
>
> status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, len1, &len2);
> -todo_wine
> +todo_wine_if(firmware_todo)
> ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
> ok(len2 == len1, "Expected length %u, got %u\n", len1, len2);
>
> --
> 2.17.1
>
>
>
June 15, 2018
Re: [PATCH v5 3/8] kernel32/tests: Add GetSystemFirmwareTable tests
by Huw Davies
On Fri, Jun 15, 2018 at 12:59:09AM -0600, Alex Henrie wrote:
> Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
> ---
> dlls/kernel32/tests/version.c | 42 +++++++++++++++++++++++++++++++++++
> 1 file changed, 42 insertions(+)
>
> diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c
> index eb78a383d2..6ca45f0b2e 100644
> --- a/dlls/kernel32/tests/version.c
> +++ b/dlls/kernel32/tests/version.c
> @@ -26,11 +26,17 @@
> #include "winternl.h"
>
> static BOOL (WINAPI * pGetProductInfo)(DWORD, DWORD, DWORD, DWORD, DWORD *);
> +static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, void *, ULONG, ULONG *);
> static NTSTATUS (WINAPI * pRtlGetVersion)(RTL_OSVERSIONINFOEXW *);
>
> #define GET_PROC(func) \
> p##func = (void *)GetProcAddress(hmod, #func);
>
> +/* Firmware table providers */
> +#define ACPI 0x41435049
> +#define FIRM 0x4649524D
> +#define RSMB 0x52534D42
> +
> static void init_function_pointers(void)
> {
> HMODULE hmod;
> @@ -41,6 +47,7 @@ static void init_function_pointers(void)
>
> hmod = GetModuleHandleA("ntdll.dll");
>
> + GET_PROC(NtQuerySystemInformation);
> GET_PROC(RtlGetVersion);
> }
>
> @@ -697,6 +704,40 @@ static void test_VerifyVersionInfo(void)
> ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError());
> }
>
> +void test_GetSystemFirmwareTable(void)
> +{
> + ULONG expected_len, i;
> + UINT len;
> + SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = HeapAlloc(GetProcessHeap(), 0, 16);
> + UCHAR *smbios_table = NULL;
> +
> + ok(!!sfti, "Failed to allocate memory\n");
> + sfti->ProviderSignature = RSMB;
> + sfti->Action = SystemFirmwareTable_Get;
You need to initialize TableID.
> + pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &expected_len);
> + sfti = HeapReAlloc(GetProcessHeap(), 0, sfti, expected_len);
> + ok(!!sfti, "Failed to allocate memory\n");
> + pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, expected_len, &expected_len);
> +
> + expected_len -= 16;
> + len = GetSystemFirmwareTable(RSMB, 0, smbios_table, 0);
> +todo_wine
> + ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len);
> +
> + smbios_table = HeapAlloc(GetProcessHeap(), 0, len);
> + len = GetSystemFirmwareTable(RSMB, 0, smbios_table, len);
> +todo_wine
> + ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len);
> + for (i = 0; i < len; i++)
> + {
> + ok(smbios_table[i] == sfti->TableBuffer[i],
> + "Offset %u: Expected %02x, got %02x\n", i, sfti->TableBuffer[i], smbios_table[i]);
> + }
> +
> + HeapFree(GetProcessHeap(), 0, sfti);
> + HeapFree(GetProcessHeap(), 0, smbios_table);
> +}
> +
> START_TEST(version)
> {
> init_function_pointers();
> @@ -704,4 +745,5 @@ START_TEST(version)
> test_GetProductInfo();
> test_GetVersionEx();
> test_VerifyVersionInfo();
> + test_GetSystemFirmwareTable();
> }
> --
> 2.17.1
>
>
>
June 15, 2018
Re: [PATCH v5 2/8] ntdll/tests: Add SystemFirmwareTableInformation tests
by Huw Davies
On Fri, Jun 15, 2018 at 12:59:08AM -0600, Alex Henrie wrote:
> Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
> ---
> dlls/ntdll/tests/info.c | 48 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 48 insertions(+)
>
> diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
> index 6c93c3cd58..cdb91e1b73 100644
> --- a/dlls/ntdll/tests/info.c
> +++ b/dlls/ntdll/tests/info.c
> @@ -54,6 +54,11 @@ static DWORD one_before_last_pid = 0;
> } \
> } while(0)
>
> +/* Firmware table providers */
> +#define ACPI 0x41435049
> +#define FIRM 0x4649524D
> +#define RSMB 0x52534D42
> +
> static BOOL InitFunctionPtrs(void)
> {
> /* All needed functions are NT based, so using GetModuleHandle is a good check */
> @@ -826,6 +831,45 @@ static void test_query_logicalprocex(void)
> }
> }
>
> +static void test_query_firmware(void)
> +{
> + ULONG len1, len2;
> + NTSTATUS status;
> + SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16);
> +
> + ok(!!sfti, "Failed to allocate memory\n");
> +
> + status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 15, &len1);
> +todo_wine
> + ok(status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
> +todo_wine
> + ok(len1 == 16, "Expected length 16, got %u\n", len1);
> +
> + status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
> +todo_wine
> + ok(status == STATUS_NOT_IMPLEMENTED, "Expected STATUS_NOT_IMPLEMENTED, got %08x\n", status);
> + ok(len1 == 0, "Expected length 0, got %u\n", len1);
> +
> + sfti->ProviderSignature = RSMB;
> + sfti->Action = SystemFirmwareTable_Get;
> +
> + status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
> +todo_wine
> + ok(status == STATUS_BUFFER_TOO_SMALL, "Expected STATUS_BUFFER_TOO_SMALL, got %08x\n", status);
> +todo_wine
> + ok(len1 >= 16, "Expected length >= 16, got %u\n", len1);
testing TableBufferLength == len1 - 16 would be useful here.
> +
> + sfti = HeapReAlloc(GetProcessHeap(), 0, sfti, len1);
> + ok(!!sfti, "Failed to allocate memory\n");
> +
> + status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, len1, &len2);
> +todo_wine
> + ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
> + ok(len2 == len1, "Expected length %u, got %u\n", len1, len2);
and here.
> +
> + HeapFree(GetProcessHeap(), 0, sfti);
> +}
> +
> static void test_query_processor_power_info(void)
> {
> NTSTATUS status;
> @@ -2267,6 +2311,10 @@ START_TEST(info)
> trace("Starting test_process_debug_flags()\n");
> test_query_process_debug_flags(argc, argv);
>
> + /* 0x4C SystemFirmwareTableInformation */
> + trace("Starting test_query_firmware()\n");
> + test_query_firmware();
> +
> /* belongs to its own file */
> trace("Starting test_readvirtualmemory()\n");
> test_readvirtualmemory();
> --
> 2.17.1
>
>
>
June 15, 2018
Re: [PATCH] msi: Add package minor/major upgrade tests
by Hans Leidekker
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
June 15, 2018
Re: [PATCH v5 5/8] kernel32: Connect GetSystemFirmwareTable to NtQuerySystemInformation
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39156
Your paranoid android.
=== w2003std (32 bit version) ===
version.c:724: Test failed: Expected length 4294967280, got 449
version.c:728: Test failed: Expected length 4294967280, got 449
version.c:731: Test failed: Offset 0: Expected 3a, got 00
version.c:731: Test failed: Offset 1: Expected 00, got 02
version.c:731: Test failed: Offset 2: Expected 03, got 08
version.c:731: Test failed: Offset 3: Expected 00, got 28
version.c:731: Test failed: Offset 4: Expected 00, got b9
version.c:731: Test failed: Offset 6: Expected 0f, got 00
version.c:731: Test failed: Offset 9: Expected 02, got 18
version.c:731: Test failed: Offset 10: Expected 08, got 00
version.c:731: Test failed: Offset 11: Expected 28, got 00
version.c:731: Test failed: Offset 12: Expected b9, got 01
version.c:731: Test failed: Offset 13: Expected 01, got 02
version.c:731: Test failed: Offset 15: Expected 00, got e8
version.c:731: Test failed: Offset 16: Expected 00, got 03
version.c:731: Test failed: Offset 17: Expected 18, got 00
version.c:731: Test failed: Offset 18: Expected 00, got 08
version.c:731: Test failed: Offset 20: Expected 01, got 00
version.c:731: Test failed: Offset 21: Expected 02, got 00
version.c:731: Test failed: Offset 23: Expected e8, got 00
version.c:731: Test failed: Offset 24: Expected 03, got 00
version.c:731: Test failed: Offset 26: Expected 08, got 00
version.c:731: Test failed: Offset 27: Expected 00, got 04
version.c:731: Test failed: Offset 30: Expected 00, got ff
version.c:731: Test failed: Offset 31: Expected 00, got ff
version.c:731: Test failed: Offset 32: Expected 00, got 53
version.c:731: Test failed: Offset 33: Expected 00, got 65
version.c:731: Test failed: Offset 34: Expected 00, got 61
version.c:731: Test failed: Offset 35: Expected 04, got 42
version.c:731: Test failed: Offset 36: Expected 00, got 49
version.c:731: Test failed: Offset 37: Expected 00, got 4f
version.c:731: Test failed: Offset 38: Expected ff, got 53
version.c:731: Test failed: Offset 39: Expected ff, got 00
version.c:731: Test failed: Offset 40: Expected 53, got 31
version.c:731: Test failed: Offset 41: Expected 65, got 2e
version.c:731: Test failed: Offset 42: Expected 61, got 31
version.c:731: Test failed: Offset 43: Expected 42, got 30
version.c:731: Test failed: Offset 44: Expected 49, got 2e
version.c:731: Test failed: Offset 45: Expected 4f, got 32
version.c:731: Test failed: Offset 46: Expected 53, got 2d
version.c:731: Test failed: Offset 47: Expected 00, got 31
version.c:731: Test failed: Offset 48: Expected 31, got 00
version.c:731: Test failed: Offset 49: Expected 2e, got 30
version.c:731: Test failed: Offset 50: Expected 31, got 34
version.c:731: Test failed: Offset 51: Expected 30, got 2f
version.c:731: Test failed: Offset 52: Expected 2e, got 30
version.c:731: Test failed: Offset 53: Expected 32, got 31
version.c:731: Test failed: Offset 54: Expected 2d, got 2f
version.c:731: Test failed: Offset 55: Expected 31, got 32
version.c:731: Test failed: Offset 56: Expected 00, got 30
version.c:731: Test failed: Offset 57: Expected 30, got 31
version.c:731: Test failed: Offset 59: Expected 2f, got 00
version.c:731: Test failed: Offset 60: Expected 30, got 00
version.c:731: Test failed: Offset 61: Expected 31, got 01
version.c:731: Test failed: Offset 62: Expected 2f, got 1b
version.c:731: Test failed: Offset 63: Expected 32, got 00
version.c:731: Test failed: Offset 64: Expected 30, got 01
version.c:731: Test failed: Offset 65: Expected 31, got 01
version.c:731: Test failed: Offset 66: Expected 34, got 02
version.c:731: Test failed: Offset 67: Expected 00, got 03
version.c:731: Test failed: Offset 69: Expected 01, got b7
version.c:731: Test failed: Offset 70: Expected 1b, got ff
version.c:731: Test failed: Offset 71: Expected 00, got 4f
version.c:731: Test failed: Offset 72: Expected 01, got 2a
version.c:731: Test failed: Offset 73: Expected 01, got c5
version.c:731: Test failed: Offset 74: Expected 02, got 53
version.c:731: Test failed: Offset 75: Expected 03, got 46
version.c:731: Test failed: Offset 76: Expected 00, got 9e
version.c:731: Test failed: Offset 77: Expected b7, got 8f
version.c:731: Test failed: Offset 78: Expected ff, got db
version.c:731: Test failed: Offset 79: Expected 4f, got 72
version.c:731: Test failed: Offset 80: Expected 2a, got e5
version.c:731: Test failed: Offset 81: Expected c5, got aa
version.c:731: Test failed: Offset 82: Expected 53, got 9a
version.c:731: Test failed: Offset 83: Expected 46, got b9
version.c:731: Test failed: Offset 84: Expected 9e, got de
version.c:731: Test failed: Offset 85: Expected 8f, got 06
version.c:731: Test failed: Offset 86: Expected db, got 00
version.c:731: Test failed: Offset 87: Expected 72, got 00
version.c:731: Test failed: Offset 88: Expected e5, got 51
version.c:731: Test failed: Offset 89: Expected aa, got 45
version.c:731: Test failed: Offset 90: Expected 9a, got 4d
version.c:731: Test failed: Offset 91: Expected b9, got 55
version.c:731: Test failed: Offset 92: Expected de, got 00
version.c:731: Test failed: Offset 93: Expected 06, got 53
version.c:731: Test failed: Offset 94: Expected 00, got 74
version.c:731: Test failed: Offset 95: Expected 00, got 61
version.c:731: Test failed: Offset 96: Expected 51, got 6e
version.c:731: Test failed: Offset 97: Expected 45, got 64
version.c:731: Test failed: Offset 98: Expected 4d, got 61
version.c:731: Test failed: Offset 99: Expected 55, got 72
version.c:731: Test failed: Offset 100: Expected 00, got 64
version.c:731: Test failed: Offset 101: Expected 53, got 20
version.c:731: Test failed: Offset 102: Expected 74, got 50
version.c:731: Test failed: Offset 103: Expected 61, got 43
version.c:731: Test failed: Offset 104: Expected 6e, got 20
version.c:731: Test failed: Offset 105: Expected 64, got 28
version.c:731: Test failed: Offset 106: Expected 61, got 69
version.c:731: Test failed: Offset 107: Expected 72, got 34
version.c:731: Test failed: Offset 108: Expected 64, got 34
version.c:731: Test failed: Offset 109: Expected 20, got 30
version.c:731: Test failed: Offset 110: Expected 50, got 46
version.c:731: Test failed: Offset 111: Expected 43, got 58
version.c:731: Test failed: Offset 113: Expected 28, got 2b
version.c:731: Test failed: Offset 114: Expected 69, got 20
version.c:731: Test failed: Offset 115: Expected 34, got 50
version.c:731: Test failed: Offset 116: Expected 34, got 49
version.c:731: Test failed: Offset 117: Expected 30, got 49
version.c:731: Test failed: Offset 118: Expected 46, got 58
version.c:731: Test failed: Offset 119: Expected 58, got 2c
version.c:731: Test failed: Offset 121: Expected 2b, got 31
version.c:731: Test failed: Offset 122: Expected 20, got 39
version.c:731: Test failed: Offset 123: Expected 50, got 39
version.c:731: Test failed: Offset 124: Expected 49, got 36
version.c:731: Test failed: Offset 125: Expected 49, got 29
version.c:731: Test failed: Offset 126: Expected 58, got 00
version.c:731: Test failed: Offset 127: Expected 2c, got 70
version.c:731: Test failed: Offset 128: Expected 20, got 63
version.c:731: Test failed: Offset 129: Expected 31, got 2d
version.c:731: Test failed: Offset 130: Expected 39, got 69
version.c:731: Test failed: Offset 131: Expected 39, got 34
version.c:731: Test failed: Offset 132: Expected 36, got 34
version.c:731: Test failed: Offset 133: Expected 29, got 30
version.c:731: Test failed: Offset 134: Expected 00, got 66
version.c:731: Test failed: Offset 135: Expected 70, got 78
version.c:731: Test failed: Offset 136: Expected 63, got 2d
version.c:731: Test failed: Offset 137: Expected 2d, got 32
version.c:731: Test failed: Offset 138: Expected 69, got 2e
version.c:731: Test failed: Offset 139: Expected 34, got 31
version.c:731: Test failed: Offset 140: Expected 34, got 00
version.c:731: Test failed: Offset 141: Expected 30, got 00
version.c:731: Test failed: Offset 142: Expected 66, got 03
version.c:731: Test failed: Offset 143: Expected 78, got 15
version.c:731: Test failed: Offset 144: Expected 2d, got 00
version.c:731: Test failed: Offset 145: Expected 32, got 03
version.c:731: Test failed: Offset 146: Expected 2e, got 01
version.c:731: Test failed: Offset 147: Expected 31, got 01
version.c:731: Test failed: Offset 148: Expected 00, got 02
version.c:731: Test failed: Offset 150: Expected 03, got 00
version.c:731: Test failed: Offset 151: Expected 15, got 03
version.c:731: Test failed: Offset 152: Expected 00, got 03
version.c:731: Test failed: Offset 154: Expected 01, got 02
version.c:731: Test failed: Offset 155: Expected 01, got 00
version.c:731: Test failed: Offset 156: Expected 02, got 00
version.c:731: Test failed: Offset 159: Expected 03, got 00
version.c:731: Test failed: Offset 160: Expected 03, got 00
version.c:731: Test failed: Offset 161: Expected 03, got 00
version.c:731: Test failed: Offset 162: Expected 02, got 00
version.c:731: Test failed: Offset 163: Expected 00, got 51
version.c:731: Test failed: Offset 164: Expected 00, got 45
version.c:731: Test failed: Offset 165: Expected 00, got 4d
version.c:731: Test failed: Offset 166: Expected 00, got 55
version.c:731: Test failed: Offset 168: Expected 00, got 70
version.c:731: Test failed: Offset 169: Expected 00, got 63
version.c:731: Test failed: Offset 170: Expected 00, got 2d
version.c:731: Test failed: Offset 171: Expected 51, got 69
version.c:731: Test failed: Offset 172: Expected 45, got 34
version.c:731: Test failed: Offset 173: Expected 4d, got 34
version.c:731: Test failed: Offset 174: Expected 55, got 30
version.c:731: Test failed: Offset 175: Expected 00, got 66
version.c:731: Test failed: Offset 176: Expected 70, got 78
version.c:731: Test failed: Offset 177: Expected 63, got 2d
version.c:731: Test failed: Offset 178: Expected 2d, got 32
version.c:731: Test failed: Offset 179: Expected 69, got 2e
version.c:731: Test failed: Offset 180: Expected 34, got 31
version.c:731: Test failed: Offset 181: Expected 34, got 00
version.c:731: Test failed: Offset 182: Expected 30, got 00
version.c:731: Test failed: Offset 183: Expected 66, got 04
version.c:731: Test failed: Offset 184: Expected 78, got 2a
version.c:731: Test failed: Offset 185: Expected 2d, got 00
version.c:731: Test failed: Offset 186: Expected 32, got 04
version.c:731: Test failed: Offset 187: Expected 2e, got 01
version.c:731: Test failed: Offset 188: Expected 31, got 03
version.c:731: Test failed: Offset 189: Expected 00, got 01
version.c:731: Test failed: Offset 190: Expected 00, got 02
version.c:731: Test failed: Offset 191: Expected 04, got 61
version.c:731: Test failed: Offset 192: Expected 2a, got 0f
version.c:731: Test failed: Offset 194: Expected 04, got 00
version.c:731: Test failed: Offset 195: Expected 01, got fd
version.c:731: Test failed: Offset 196: Expected 03, got fb
version.c:731: Test failed: Offset 197: Expected 01, got 8b
version.c:731: Test failed: Offset 198: Expected 02, got 07
version.c:731: Test failed: Offset 199: Expected 61, got 03
version.c:731: Test failed: Offset 200: Expected 0f, got 00
version.c:731: Test failed: Offset 203: Expected fd, got d0
version.c:731: Test failed: Offset 204: Expected fb, got 07
version.c:731: Test failed: Offset 205: Expected 8b, got d0
version.c:731: Test failed: Offset 207: Expected 03, got 41
version.c:731: Test failed: Offset 208: Expected 00, got 01
version.c:731: Test failed: Offset 209: Expected 00, got ff
version.c:731: Test failed: Offset 210: Expected 00, got ff
version.c:731: Test failed: Offset 211: Expected d0, got ff
version.c:731: Test failed: Offset 212: Expected 07, got ff
version.c:731: Test failed: Offset 213: Expected d0, got ff
version.c:731: Test failed: Offset 214: Expected 07, got ff
version.c:731: Test failed: Offset 215: Expected 41, got 00
version.c:731: Test failed: Offset 216: Expected 01, got 00
version.c:731: Test failed: Offset 217: Expected ff, got 00
version.c:731: Test failed: Offset 218: Expected ff, got 01
version.c:731: Test failed: Offset 219: Expected ff, got 01
version.c:731: Test failed: Offset 220: Expected ff, got 01
version.c:731: Test failed: Offset 221: Expected ff, got 02
version.c:731: Test failed: Offset 222: Expected ff, got 00
version.c:731: Test failed: Offset 223: Expected 00, got 01
version.c:731: Test failed: Offset 225: Expected 00, got 43
version.c:731: Test failed: Offset 226: Expected 01, got 50
version.c:731: Test failed: Offset 227: Expected 01, got 55
version.c:731: Test failed: Offset 228: Expected 01, got 20
version.c:731: Test failed: Offset 229: Expected 02, got 30
version.c:731: Test failed: Offset 231: Expected 01, got 51
version.c:731: Test failed: Offset 232: Expected 00, got 45
version.c:731: Test failed: Offset 233: Expected 43, got 4d
version.c:731: Test failed: Offset 234: Expected 50, got 55
version.c:731: Test failed: Offset 235: Expected 55, got 00
version.c:731: Test failed: Offset 236: Expected 20, got 70
version.c:731: Test failed: Offset 237: Expected 30, got 63
version.c:731: Test failed: Offset 238: Expected 00, got 2d
version.c:731: Test failed: Offset 239: Expected 51, got 69
version.c:731: Test failed: Offset 240: Expected 45, got 34
version.c:731: Test failed: Offset 241: Expected 4d, got 34
version.c:731: Test failed: Offset 242: Expected 55, got 30
version.c:731: Test failed: Offset 243: Expected 00, got 66
version.c:731: Test failed: Offset 244: Expected 70, got 78
version.c:731: Test failed: Offset 245: Expected 63, got 2d
version.c:731: Test failed: Offset 246: Expected 2d, got 32
version.c:731: Test failed: Offset 247: Expected 69, got 2e
version.c:731: Test failed: Offset 248: Expected 34, got 31
version.c:731: Test failed: Offset 249: Expected 34, got 00
version.c:731: Test failed: Offset 250: Expected 30, got 00
version.c:731: Test failed: Offset 251: Expected 66, got 04
version.c:731: Test failed: Offset 252: Expected 78, got 2a
version.c:731: Test failed: Offset 253: Expected 2d, got 01
version.c:731: Test failed: Offset 254: Expected 32, got 04
version.c:731: Test failed: Offset 255: Expected 2e, got 01
version.c:731: Test failed: Offset 256: Expected 31, got 03
version.c:731: Test failed: Offset 257: Expected 00, got 01
version.c:731: Test failed: Offset 258: Expected 00, got 02
version.c:731: Test failed: Offset 259: Expected 04, got 61
version.c:731: Test failed: Offset 260: Expected 2a, got 0f
version.c:731: Test failed: Offset 261: Expected 01, got 00
version.c:731: Test failed: Offset 262: Expected 04, got 00
version.c:731: Test failed: Offset 263: Expected 01, got fd
version.c:731: Test failed: Offset 264: Expected 03, got fb
version.c:731: Test failed: Offset 265: Expected 01, got 8b
version.c:731: Test failed: Offset 266: Expected 02, got 07
version.c:731: Test failed: Offset 267: Expected 61, got 03
version.c:731: Test failed: Offset 268: Expected 0f, got 00
version.c:731: Test failed: Offset 271: Expected fd, got d0
version.c:731: Test failed: Offset 272: Expected fb, got 07
version.c:731: Test failed: Offset 273: Expected 8b, got d0
version.c:731: Test failed: Offset 275: Expected 03, got 41
version.c:731: Test failed: Offset 276: Expected 00, got 01
version.c:731: Test failed: Offset 277: Expected 00, got ff
version.c:731: Test failed: Offset 278: Expected 00, got ff
version.c:731: Test failed: Offset 279: Expected d0, got ff
version.c:731: Test failed: Offset 280: Expected 07, got ff
version.c:731: Test failed: Offset 281: Expected d0, got ff
version.c:731: Test failed: Offset 282: Expected 07, got ff
version.c:731: Test failed: Offset 283: Expected 41, got 00
version.c:731: Test failed: Offset 284: Expected 01, got 00
version.c:731: Test failed: Offset 285: Expected ff, got 00
version.c:731: Test failed: Offset 286: Expected ff, got 01
version.c:731: Test failed: Offset 287: Expected ff, got 01
version.c:731: Test failed: Offset 288: Expected ff, got 01
version.c:731: Test failed: Offset 289: Expected ff, got 02
version.c:731: Test failed: Offset 290: Expected ff, got 00
version.c:731: Test failed: Offset 291: Expected 00, got 01
version.c:731: Test failed: Offset 293: Expected 00, got 43
version.c:731: Test failed: Offset 294: Expected 01, got 50
version.c:731: Test failed: Offset 295: Expected 01, got 55
version.c:731: Test failed: Offset 296: Expected 01, got 20
version.c:731: Test failed: Offset 297: Expected 02, got 31
version.c:731: Test failed: Offset 299: Expected 01, got 51
version.c:731: Test failed: Offset 300: Expected 00, got 45
version.c:731: Test failed: Offset 301: Expected 43, got 4d
version.c:731: Test failed: Offset 302: Expected 50, got 55
version.c:731: Test failed: Offset 303: Expected 55, got 00
version.c:731: Test failed: Offset 304: Expected 20, got 70
version.c:731: Test failed: Offset 305: Expected 31, got 63
version.c:731: Test failed: Offset 306: Expected 00, got 2d
version.c:731: Test failed: Offset 307: Expected 51, got 69
version.c:731: Test failed: Offset 308: Expected 45, got 34
version.c:731: Test failed: Offset 309: Expected 4d, got 34
version.c:731: Test failed: Offset 310: Expected 55, got 30
version.c:731: Test failed: Offset 311: Expected 00, got 66
version.c:731: Test failed: Offset 312: Expected 70, got 78
version.c:731: Test failed: Offset 313: Expected 63, got 2d
version.c:731: Test failed: Offset 314: Expected 2d, got 32
version.c:731: Test failed: Offset 315: Expected 69, got 2e
version.c:731: Test failed: Offset 316: Expected 34, got 31
version.c:731: Test failed: Offset 317: Expected 34, got 00
version.c:731: Test failed: Offset 318: Expected 30, got 00
version.c:731: Test failed: Offset 319: Expected 66, got 10
version.c:731: Test failed: Offset 320: Expected 78, got 17
version.c:731: Test failed: Offset 321: Expected 2d, got 00
version.c:731: Test failed: Offset 322: Expected 32, got 10
version.c:731: Test failed: Offset 323: Expected 2e, got 01
version.c:731: Test failed: Offset 324: Expected 31, got 03
version.c:731: Test failed: Offset 325: Expected 00, got 06
version.c:731: Test failed: Offset 327: Expected 10, got 00
version.c:731: Test failed: Offset 328: Expected 17, got 10
version.c:731: Test failed: Offset 330: Expected 10, got fe
version.c:731: Test failed: Offset 331: Expected 01, got ff
version.c:731: Test failed: Offset 332: Expected 03, got 01
version.c:731: Test failed: Offset 333: Expected 06, got 00
version.c:731: Test failed: Offset 336: Expected 10, got 00
version.c:731: Test failed: Offset 338: Expected fe, got 00
version.c:731: Test failed: Offset 339: Expected ff, got 00
version.c:731: Test failed: Offset 340: Expected 01, got 00
version.c:731: Test failed: Offset 344: Expected 00, got 11
version.c:731: Test failed: Offset 345: Expected 00, got 28
version.c:731: Test failed: Offset 347: Expected 00, got 11
version.c:731: Test failed: Offset 349: Expected 00, got 10
version.c:731: Test failed: Offset 350: Expected 00, got fe
version.c:731: Test failed: Offset 351: Expected 00, got ff
version.c:731: Test failed: Offset 352: Expected 11, got ff
version.c:731: Test failed: Offset 353: Expected 28, got ff
version.c:731: Test failed: Offset 354: Expected 00, got ff
version.c:731: Test failed: Offset 355: Expected 11, got ff
version.c:731: Test failed: Offset 357: Expected 10, got 04
version.c:731: Test failed: Offset 358: Expected fe, got 09
version.c:731: Test failed: Offset 359: Expected ff, got 00
version.c:731: Test failed: Offset 360: Expected ff, got 01
version.c:731: Test failed: Offset 361: Expected ff, got 00
version.c:731: Test failed: Offset 362: Expected ff, got 07
version.c:731: Test failed: Offset 363: Expected ff, got 02
version.c:731: Test failed: Offset 365: Expected 04, got 00
version.c:731: Test failed: Offset 366: Expected 09, got 00
version.c:731: Test failed: Offset 367: Expected 00, got 02
version.c:731: Test failed: Offset 368: Expected 01, got 00
version.c:731: Test failed: Offset 370: Expected 07, got 00
version.c:731: Test failed: Offset 371: Expected 02, got 00
version.c:731: Test failed: Offset 375: Expected 02, got 00
version.c:731: Test failed: Offset 384: Expected 00, got 44
version.c:731: Test failed: Offset 385: Expected 00, got 49
version.c:731: Test failed: Offset 386: Expected 00, got 4d
version.c:731: Test failed: Offset 387: Expected 00, got 4d
version.c:731: Test failed: Offset 388: Expected 00, got 20
version.c:731: Test failed: Offset 389: Expected 00, got 30
version.c:731: Test failed: Offset 391: Expected 00, got 51
version.c:731: Test failed: Offset 392: Expected 44, got 45
version.c:731: Test failed: Offset 393: Expected 49, got 4d
version.c:731: Test failed: Offset 394: Expected 4d, got 55
version.c:731: Test failed: Offset 395: Expected 4d, got 00
version.c:731: Test failed: Offset 396: Expected 20, got 00
version.c:731: Test failed: Offset 397: Expected 30, got 13
version.c:731: Test failed: Offset 398: Expected 00, got 1f
version.c:731: Test failed: Offset 399: Expected 51, got 00
version.c:731: Test failed: Offset 400: Expected 45, got 13
version.c:731: Test failed: Offset 401: Expected 4d, got 00
version.c:731: Test failed: Offset 402: Expected 55, got 00
version.c:731: Test failed: Offset 405: Expected 13, got ff
version.c:731: Test failed: Offset 406: Expected 1f, got ff
version.c:731: Test failed: Offset 407: Expected 00, got 0f
version.c:731: Test failed: Offset 408: Expected 13, got 00
version.c:731: Test failed: Offset 410: Expected 00, got 10
version.c:731: Test failed: Offset 411: Expected 00, got 01
version.c:731: Test failed: Offset 413: Expected ff, got 00
version.c:731: Test failed: Offset 414: Expected ff, got 00
version.c:731: Test failed: Offset 415: Expected 0f, got 00
version.c:731: Test failed: Offset 418: Expected 10, got 00
version.c:731: Test failed: Offset 419: Expected 01, got 00
version.c:731: Test failed: Offset 430: Expected 00, got 20
version.c:731: Test failed: Offset 431: Expected 00, got 0b
version.c:731: Test failed: Offset 433: Expected 00, got 20
version.c:731: Test failed: Offset 438: Expected 20, got 00
version.c:731: Test failed: Offset 439: Expected 0b, got 00
version.c:731: Test failed: Offset 441: Expected 20, got 00
version.c:731: Test failed: Offset 443: Expected 00, got 7f
version.c:731: Test failed: Offset 444: Expected 00, got 04
version.c:731: Test failed: Offset 446: Expected 00, got 7f
June 15, 2018
Re: [PATCH v5 4/8] ntdll: Return BIOS info from NtQuerySystemInformation on Linux
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39155
Your paranoid android.
=== wxppro (32 bit info) ===
info.c:849: Test failed: Expected STATUS_INFO_LENGTH_MISMATCH, got c0000003
info.c:850: Test failed: Expected length 16, got 0
info.c:853: Test failed: Expected STATUS_NOT_IMPLEMENTED, got c0000003
info.c:861: Test failed: Expected STATUS_BUFFER_TOO_SMALL, got c0000003
info.c:862: Test failed: Expected length >= 16, got 0
info.c:869: Test failed: Expected STATUS_SUCCESS, got c0000003
=== w2003std (32 bit info) ===
info.c:850: Test failed: Expected length 16, got 0
info.c:853: Test failed: Expected STATUS_NOT_IMPLEMENTED, got c0000004
info.c:861: Test failed: Expected STATUS_BUFFER_TOO_SMALL, got c0000004
info.c:862: Test failed: Expected length >= 16, got 0
info.c:869: Test failed: Expected STATUS_SUCCESS, got c0000004
=== wvistau64 (32 bit info) ===
info.c:1838: Test failed: Expected STATUS_SUCCESS, got c0000022
0890:info: unhandled exception c0000005 at 002C0000
=== wvistau64_zh_CN (32 bit info) ===
info.c:1838: Test failed: Expected STATUS_SUCCESS, got c0000022
0bb8:info: unhandled exception c0000005 at 003E0000
=== wvistau64_fr (32 bit info) ===
info.c:1838: Test failed: Expected STATUS_SUCCESS, got c0000022
06a8:info: unhandled exception c0000005 at 002C0000
=== wvistau64_he (32 bit info) ===
info.c:1838: Test failed: Expected STATUS_SUCCESS, got c0000022
0bd8:info: unhandled exception c0000005 at 003D0000
=== w2008s64 (32 bit info) ===
info.c:1838: Test failed: Expected STATUS_SUCCESS, got c0000022
086c:info: unhandled exception c0000005 at 003D0000
=== w7u (32 bit info) ===
info.c:1838: Test failed: Expected STATUS_SUCCESS, got c0000022
=== w7pro64 (32 bit info) ===
info.c:1838: Test failed: Expected STATUS_SUCCESS, got c0000022
0ab8:info: unhandled exception c0000005 at 00340000
=== w8 (32 bit info) ===
info.c:1838: Test failed: Expected STATUS_SUCCESS, got c0000022
0f30:info: unhandled exception c0000005 at 003E0000
=== w864 (32 bit info) ===
info.c:1838: Test failed: Expected STATUS_SUCCESS, got c0000022
0a18:info: unhandled exception c0000005 at 00350000
=== w1064 (32 bit info) ===
info.c:1838: Test failed: Expected STATUS_SUCCESS, got c0000022
0b54:info: unhandled exception c0000005 at 00390000
June 15, 2018
Re: [PATCH v5 3/8] kernel32/tests: Add GetSystemFirmwareTable tests
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39154
Your paranoid android.
=== w2003std (32 bit version) ===
version.c:725: Test failed: Expected length 4294967280, got 449
version.c:730: Test failed: Expected length 4294967280, got 449
version.c:733: Test failed: Offset 0: Expected 3a, got 00
version.c:733: Test failed: Offset 1: Expected 00, got 02
version.c:733: Test failed: Offset 2: Expected 03, got 08
version.c:733: Test failed: Offset 3: Expected 00, got 28
version.c:733: Test failed: Offset 4: Expected e5, got b9
version.c:733: Test failed: Offset 6: Expected 0f, got 00
version.c:733: Test failed: Offset 9: Expected 02, got 18
version.c:733: Test failed: Offset 10: Expected 08, got 00
version.c:733: Test failed: Offset 11: Expected 28, got 00
version.c:733: Test failed: Offset 12: Expected b9, got 01
version.c:733: Test failed: Offset 13: Expected 01, got 02
version.c:733: Test failed: Offset 15: Expected 00, got e8
version.c:733: Test failed: Offset 16: Expected 00, got 03
version.c:733: Test failed: Offset 17: Expected 18, got 00
version.c:733: Test failed: Offset 18: Expected 00, got 08
version.c:733: Test failed: Offset 20: Expected 01, got 00
version.c:733: Test failed: Offset 21: Expected 02, got 00
version.c:733: Test failed: Offset 23: Expected e8, got 00
version.c:733: Test failed: Offset 24: Expected 03, got 00
version.c:733: Test failed: Offset 26: Expected 08, got 00
version.c:733: Test failed: Offset 27: Expected 00, got 04
version.c:733: Test failed: Offset 30: Expected 00, got ff
version.c:733: Test failed: Offset 31: Expected 00, got ff
version.c:733: Test failed: Offset 32: Expected 00, got 53
version.c:733: Test failed: Offset 33: Expected 00, got 65
version.c:733: Test failed: Offset 34: Expected 00, got 61
version.c:733: Test failed: Offset 35: Expected 04, got 42
version.c:733: Test failed: Offset 36: Expected 00, got 49
version.c:733: Test failed: Offset 37: Expected 00, got 4f
version.c:733: Test failed: Offset 38: Expected ff, got 53
version.c:733: Test failed: Offset 39: Expected ff, got 00
version.c:733: Test failed: Offset 40: Expected 53, got 31
version.c:733: Test failed: Offset 41: Expected 65, got 2e
version.c:733: Test failed: Offset 42: Expected 61, got 31
version.c:733: Test failed: Offset 43: Expected 42, got 30
version.c:733: Test failed: Offset 44: Expected 49, got 2e
version.c:733: Test failed: Offset 45: Expected 4f, got 32
version.c:733: Test failed: Offset 46: Expected 53, got 2d
version.c:733: Test failed: Offset 47: Expected 00, got 31
version.c:733: Test failed: Offset 48: Expected 31, got 00
version.c:733: Test failed: Offset 49: Expected 2e, got 30
version.c:733: Test failed: Offset 50: Expected 31, got 34
version.c:733: Test failed: Offset 51: Expected 30, got 2f
version.c:733: Test failed: Offset 52: Expected 2e, got 30
version.c:733: Test failed: Offset 53: Expected 32, got 31
version.c:733: Test failed: Offset 54: Expected 2d, got 2f
version.c:733: Test failed: Offset 55: Expected 31, got 32
version.c:733: Test failed: Offset 56: Expected 00, got 30
version.c:733: Test failed: Offset 57: Expected 30, got 31
version.c:733: Test failed: Offset 59: Expected 2f, got 00
version.c:733: Test failed: Offset 60: Expected 30, got 00
version.c:733: Test failed: Offset 61: Expected 31, got 01
version.c:733: Test failed: Offset 62: Expected 2f, got 1b
version.c:733: Test failed: Offset 63: Expected 32, got 00
version.c:733: Test failed: Offset 64: Expected 30, got 01
version.c:733: Test failed: Offset 65: Expected 31, got 01
version.c:733: Test failed: Offset 66: Expected 34, got 02
version.c:733: Test failed: Offset 67: Expected 00, got 03
version.c:733: Test failed: Offset 69: Expected 01, got b7
version.c:733: Test failed: Offset 70: Expected 1b, got ff
version.c:733: Test failed: Offset 71: Expected 00, got 4f
version.c:733: Test failed: Offset 72: Expected 01, got 2a
version.c:733: Test failed: Offset 73: Expected 01, got c5
version.c:733: Test failed: Offset 74: Expected 02, got 53
version.c:733: Test failed: Offset 75: Expected 03, got 46
version.c:733: Test failed: Offset 76: Expected 00, got 9e
version.c:733: Test failed: Offset 77: Expected b7, got 8f
version.c:733: Test failed: Offset 78: Expected ff, got db
version.c:733: Test failed: Offset 79: Expected 4f, got 72
version.c:733: Test failed: Offset 80: Expected 2a, got e5
version.c:733: Test failed: Offset 81: Expected c5, got aa
version.c:733: Test failed: Offset 82: Expected 53, got 9a
version.c:733: Test failed: Offset 83: Expected 46, got b9
version.c:733: Test failed: Offset 84: Expected 9e, got de
version.c:733: Test failed: Offset 85: Expected 8f, got 06
version.c:733: Test failed: Offset 86: Expected db, got 00
version.c:733: Test failed: Offset 87: Expected 72, got 00
version.c:733: Test failed: Offset 88: Expected e5, got 51
version.c:733: Test failed: Offset 89: Expected aa, got 45
version.c:733: Test failed: Offset 90: Expected 9a, got 4d
version.c:733: Test failed: Offset 91: Expected b9, got 55
version.c:733: Test failed: Offset 92: Expected de, got 00
version.c:733: Test failed: Offset 93: Expected 06, got 53
version.c:733: Test failed: Offset 94: Expected 00, got 74
version.c:733: Test failed: Offset 95: Expected 00, got 61
version.c:733: Test failed: Offset 96: Expected 51, got 6e
version.c:733: Test failed: Offset 97: Expected 45, got 64
version.c:733: Test failed: Offset 98: Expected 4d, got 61
version.c:733: Test failed: Offset 99: Expected 55, got 72
version.c:733: Test failed: Offset 100: Expected 00, got 64
version.c:733: Test failed: Offset 101: Expected 53, got 20
version.c:733: Test failed: Offset 102: Expected 74, got 50
version.c:733: Test failed: Offset 103: Expected 61, got 43
version.c:733: Test failed: Offset 104: Expected 6e, got 20
version.c:733: Test failed: Offset 105: Expected 64, got 28
version.c:733: Test failed: Offset 106: Expected 61, got 69
version.c:733: Test failed: Offset 107: Expected 72, got 34
version.c:733: Test failed: Offset 108: Expected 64, got 34
version.c:733: Test failed: Offset 109: Expected 20, got 30
version.c:733: Test failed: Offset 110: Expected 50, got 46
version.c:733: Test failed: Offset 111: Expected 43, got 58
version.c:733: Test failed: Offset 113: Expected 28, got 2b
version.c:733: Test failed: Offset 114: Expected 69, got 20
version.c:733: Test failed: Offset 115: Expected 34, got 50
version.c:733: Test failed: Offset 116: Expected 34, got 49
version.c:733: Test failed: Offset 117: Expected 30, got 49
version.c:733: Test failed: Offset 118: Expected 46, got 58
version.c:733: Test failed: Offset 119: Expected 58, got 2c
version.c:733: Test failed: Offset 121: Expected 2b, got 31
version.c:733: Test failed: Offset 122: Expected 20, got 39
version.c:733: Test failed: Offset 123: Expected 50, got 39
version.c:733: Test failed: Offset 124: Expected 49, got 36
version.c:733: Test failed: Offset 125: Expected 49, got 29
version.c:733: Test failed: Offset 126: Expected 58, got 00
version.c:733: Test failed: Offset 127: Expected 2c, got 70
version.c:733: Test failed: Offset 128: Expected 20, got 63
version.c:733: Test failed: Offset 129: Expected 31, got 2d
version.c:733: Test failed: Offset 130: Expected 39, got 69
version.c:733: Test failed: Offset 131: Expected 39, got 34
version.c:733: Test failed: Offset 132: Expected 36, got 34
version.c:733: Test failed: Offset 133: Expected 29, got 30
version.c:733: Test failed: Offset 134: Expected 00, got 66
version.c:733: Test failed: Offset 135: Expected 70, got 78
version.c:733: Test failed: Offset 136: Expected 63, got 2d
version.c:733: Test failed: Offset 137: Expected 2d, got 32
version.c:733: Test failed: Offset 138: Expected 69, got 2e
version.c:733: Test failed: Offset 139: Expected 34, got 31
version.c:733: Test failed: Offset 140: Expected 34, got 00
version.c:733: Test failed: Offset 141: Expected 30, got 00
version.c:733: Test failed: Offset 142: Expected 66, got 03
version.c:733: Test failed: Offset 143: Expected 78, got 15
version.c:733: Test failed: Offset 144: Expected 2d, got 00
version.c:733: Test failed: Offset 145: Expected 32, got 03
version.c:733: Test failed: Offset 146: Expected 2e, got 01
version.c:733: Test failed: Offset 147: Expected 31, got 01
version.c:733: Test failed: Offset 148: Expected 00, got 02
version.c:733: Test failed: Offset 150: Expected 03, got 00
version.c:733: Test failed: Offset 151: Expected 15, got 03
version.c:733: Test failed: Offset 152: Expected 00, got 03
version.c:733: Test failed: Offset 154: Expected 01, got 02
version.c:733: Test failed: Offset 155: Expected 01, got 00
version.c:733: Test failed: Offset 156: Expected 02, got 00
version.c:733: Test failed: Offset 159: Expected 03, got 00
version.c:733: Test failed: Offset 160: Expected 03, got 00
version.c:733: Test failed: Offset 161: Expected 03, got 00
version.c:733: Test failed: Offset 162: Expected 02, got 00
version.c:733: Test failed: Offset 163: Expected 00, got 51
version.c:733: Test failed: Offset 164: Expected 00, got 45
version.c:733: Test failed: Offset 165: Expected 00, got 4d
version.c:733: Test failed: Offset 166: Expected 00, got 55
version.c:733: Test failed: Offset 168: Expected 00, got 70
version.c:733: Test failed: Offset 169: Expected 00, got 63
version.c:733: Test failed: Offset 170: Expected 00, got 2d
version.c:733: Test failed: Offset 171: Expected 51, got 69
version.c:733: Test failed: Offset 172: Expected 45, got 34
version.c:733: Test failed: Offset 173: Expected 4d, got 34
version.c:733: Test failed: Offset 174: Expected 55, got 30
version.c:733: Test failed: Offset 175: Expected 00, got 66
version.c:733: Test failed: Offset 176: Expected 70, got 78
version.c:733: Test failed: Offset 177: Expected 63, got 2d
version.c:733: Test failed: Offset 178: Expected 2d, got 32
version.c:733: Test failed: Offset 179: Expected 69, got 2e
version.c:733: Test failed: Offset 180: Expected 34, got 31
version.c:733: Test failed: Offset 181: Expected 34, got 00
version.c:733: Test failed: Offset 182: Expected 30, got 00
version.c:733: Test failed: Offset 183: Expected 66, got 04
version.c:733: Test failed: Offset 184: Expected 78, got 2a
version.c:733: Test failed: Offset 185: Expected 2d, got 00
version.c:733: Test failed: Offset 186: Expected 32, got 04
version.c:733: Test failed: Offset 187: Expected 2e, got 01
version.c:733: Test failed: Offset 188: Expected 31, got 03
version.c:733: Test failed: Offset 189: Expected 00, got 01
version.c:733: Test failed: Offset 190: Expected 00, got 02
version.c:733: Test failed: Offset 191: Expected 04, got 61
version.c:733: Test failed: Offset 192: Expected 2a, got 0f
version.c:733: Test failed: Offset 194: Expected 04, got 00
version.c:733: Test failed: Offset 195: Expected 01, got fd
version.c:733: Test failed: Offset 196: Expected 03, got fb
version.c:733: Test failed: Offset 197: Expected 01, got 8b
version.c:733: Test failed: Offset 198: Expected 02, got 07
version.c:733: Test failed: Offset 199: Expected 61, got 03
version.c:733: Test failed: Offset 200: Expected 0f, got 00
version.c:733: Test failed: Offset 203: Expected fd, got d0
version.c:733: Test failed: Offset 204: Expected fb, got 07
version.c:733: Test failed: Offset 205: Expected 8b, got d0
version.c:733: Test failed: Offset 207: Expected 03, got 41
version.c:733: Test failed: Offset 208: Expected 00, got 01
version.c:733: Test failed: Offset 209: Expected 00, got ff
version.c:733: Test failed: Offset 210: Expected 00, got ff
version.c:733: Test failed: Offset 211: Expected d0, got ff
version.c:733: Test failed: Offset 212: Expected 07, got ff
version.c:733: Test failed: Offset 213: Expected d0, got ff
version.c:733: Test failed: Offset 214: Expected 07, got ff
version.c:733: Test failed: Offset 215: Expected 41, got 00
version.c:733: Test failed: Offset 216: Expected 01, got 00
version.c:733: Test failed: Offset 217: Expected ff, got 00
version.c:733: Test failed: Offset 218: Expected ff, got 01
version.c:733: Test failed: Offset 219: Expected ff, got 01
version.c:733: Test failed: Offset 220: Expected ff, got 01
version.c:733: Test failed: Offset 221: Expected ff, got 02
version.c:733: Test failed: Offset 222: Expected ff, got 00
version.c:733: Test failed: Offset 223: Expected 00, got 01
version.c:733: Test failed: Offset 225: Expected 00, got 43
version.c:733: Test failed: Offset 226: Expected 01, got 50
version.c:733: Test failed: Offset 227: Expected 01, got 55
version.c:733: Test failed: Offset 228: Expected 01, got 20
version.c:733: Test failed: Offset 229: Expected 02, got 30
version.c:733: Test failed: Offset 231: Expected 01, got 51
version.c:733: Test failed: Offset 232: Expected 00, got 45
version.c:733: Test failed: Offset 233: Expected 43, got 4d
version.c:733: Test failed: Offset 234: Expected 50, got 55
version.c:733: Test failed: Offset 235: Expected 55, got 00
version.c:733: Test failed: Offset 236: Expected 20, got 70
version.c:733: Test failed: Offset 237: Expected 30, got 63
version.c:733: Test failed: Offset 238: Expected 00, got 2d
version.c:733: Test failed: Offset 239: Expected 51, got 69
version.c:733: Test failed: Offset 240: Expected 45, got 34
version.c:733: Test failed: Offset 241: Expected 4d, got 34
version.c:733: Test failed: Offset 242: Expected 55, got 30
version.c:733: Test failed: Offset 243: Expected 00, got 66
version.c:733: Test failed: Offset 244: Expected 70, got 78
version.c:733: Test failed: Offset 245: Expected 63, got 2d
version.c:733: Test failed: Offset 246: Expected 2d, got 32
version.c:733: Test failed: Offset 247: Expected 69, got 2e
version.c:733: Test failed: Offset 248: Expected 34, got 31
version.c:733: Test failed: Offset 249: Expected 34, got 00
version.c:733: Test failed: Offset 250: Expected 30, got 00
version.c:733: Test failed: Offset 251: Expected 66, got 04
version.c:733: Test failed: Offset 252: Expected 78, got 2a
version.c:733: Test failed: Offset 253: Expected 2d, got 01
version.c:733: Test failed: Offset 254: Expected 32, got 04
version.c:733: Test failed: Offset 255: Expected 2e, got 01
version.c:733: Test failed: Offset 256: Expected 31, got 03
version.c:733: Test failed: Offset 257: Expected 00, got 01
version.c:733: Test failed: Offset 258: Expected 00, got 02
version.c:733: Test failed: Offset 259: Expected 04, got 61
version.c:733: Test failed: Offset 260: Expected 2a, got 0f
version.c:733: Test failed: Offset 261: Expected 01, got 00
version.c:733: Test failed: Offset 262: Expected 04, got 00
version.c:733: Test failed: Offset 263: Expected 01, got fd
version.c:733: Test failed: Offset 264: Expected 03, got fb
version.c:733: Test failed: Offset 265: Expected 01, got 8b
version.c:733: Test failed: Offset 266: Expected 02, got 07
version.c:733: Test failed: Offset 267: Expected 61, got 03
version.c:733: Test failed: Offset 268: Expected 0f, got 00
version.c:733: Test failed: Offset 271: Expected fd, got d0
version.c:733: Test failed: Offset 272: Expected fb, got 07
version.c:733: Test failed: Offset 273: Expected 8b, got d0
version.c:733: Test failed: Offset 275: Expected 03, got 41
version.c:733: Test failed: Offset 276: Expected 00, got 01
version.c:733: Test failed: Offset 277: Expected 00, got ff
version.c:733: Test failed: Offset 278: Expected 00, got ff
version.c:733: Test failed: Offset 279: Expected d0, got ff
version.c:733: Test failed: Offset 280: Expected 07, got ff
version.c:733: Test failed: Offset 281: Expected d0, got ff
version.c:733: Test failed: Offset 282: Expected 07, got ff
version.c:733: Test failed: Offset 283: Expected 41, got 00
version.c:733: Test failed: Offset 284: Expected 01, got 00
version.c:733: Test failed: Offset 285: Expected ff, got 00
version.c:733: Test failed: Offset 286: Expected ff, got 01
version.c:733: Test failed: Offset 287: Expected ff, got 01
version.c:733: Test failed: Offset 288: Expected ff, got 01
version.c:733: Test failed: Offset 289: Expected ff, got 02
version.c:733: Test failed: Offset 290: Expected ff, got 00
version.c:733: Test failed: Offset 291: Expected 00, got 01
version.c:733: Test failed: Offset 293: Expected 00, got 43
version.c:733: Test failed: Offset 294: Expected 01, got 50
version.c:733: Test failed: Offset 295: Expected 01, got 55
version.c:733: Test failed: Offset 296: Expected 01, got 20
version.c:733: Test failed: Offset 297: Expected 02, got 31
version.c:733: Test failed: Offset 299: Expected 01, got 51
version.c:733: Test failed: Offset 300: Expected 00, got 45
version.c:733: Test failed: Offset 301: Expected 43, got 4d
version.c:733: Test failed: Offset 302: Expected 50, got 55
version.c:733: Test failed: Offset 303: Expected 55, got 00
version.c:733: Test failed: Offset 304: Expected 20, got 70
version.c:733: Test failed: Offset 305: Expected 31, got 63
version.c:733: Test failed: Offset 306: Expected 00, got 2d
version.c:733: Test failed: Offset 307: Expected 51, got 69
version.c:733: Test failed: Offset 308: Expected 45, got 34
version.c:733: Test failed: Offset 309: Expected 4d, got 34
version.c:733: Test failed: Offset 310: Expected 55, got 30
version.c:733: Test failed: Offset 311: Expected 00, got 66
version.c:733: Test failed: Offset 312: Expected 70, got 78
version.c:733: Test failed: Offset 313: Expected 63, got 2d
version.c:733: Test failed: Offset 314: Expected 2d, got 32
version.c:733: Test failed: Offset 315: Expected 69, got 2e
version.c:733: Test failed: Offset 316: Expected 34, got 31
version.c:733: Test failed: Offset 317: Expected 34, got 00
version.c:733: Test failed: Offset 318: Expected 30, got 00
version.c:733: Test failed: Offset 319: Expected 66, got 10
version.c:733: Test failed: Offset 320: Expected 78, got 17
version.c:733: Test failed: Offset 321: Expected 2d, got 00
version.c:733: Test failed: Offset 322: Expected 32, got 10
version.c:733: Test failed: Offset 323: Expected 2e, got 01
version.c:733: Test failed: Offset 324: Expected 31, got 03
version.c:733: Test failed: Offset 325: Expected 00, got 06
version.c:733: Test failed: Offset 327: Expected 10, got 00
version.c:733: Test failed: Offset 328: Expected 17, got 10
version.c:733: Test failed: Offset 330: Expected 10, got fe
version.c:733: Test failed: Offset 331: Expected 01, got ff
version.c:733: Test failed: Offset 332: Expected 03, got 01
version.c:733: Test failed: Offset 333: Expected 06, got 00
version.c:733: Test failed: Offset 336: Expected 10, got 00
version.c:733: Test failed: Offset 338: Expected fe, got 00
version.c:733: Test failed: Offset 339: Expected ff, got 00
version.c:733: Test failed: Offset 340: Expected 01, got 00
version.c:733: Test failed: Offset 344: Expected 00, got 11
version.c:733: Test failed: Offset 345: Expected 00, got 28
version.c:733: Test failed: Offset 347: Expected 00, got 11
version.c:733: Test failed: Offset 349: Expected 00, got 10
version.c:733: Test failed: Offset 350: Expected 00, got fe
version.c:733: Test failed: Offset 351: Expected 00, got ff
version.c:733: Test failed: Offset 352: Expected 11, got ff
version.c:733: Test failed: Offset 353: Expected 28, got ff
version.c:733: Test failed: Offset 354: Expected 00, got ff
version.c:733: Test failed: Offset 355: Expected 11, got ff
version.c:733: Test failed: Offset 357: Expected 10, got 04
version.c:733: Test failed: Offset 358: Expected fe, got 09
version.c:733: Test failed: Offset 359: Expected ff, got 00
version.c:733: Test failed: Offset 360: Expected ff, got 01
version.c:733: Test failed: Offset 361: Expected ff, got 00
version.c:733: Test failed: Offset 362: Expected ff, got 07
version.c:733: Test failed: Offset 363: Expected ff, got 02
version.c:733: Test failed: Offset 365: Expected 04, got 00
version.c:733: Test failed: Offset 366: Expected 09, got 00
version.c:733: Test failed: Offset 367: Expected 00, got 02
version.c:733: Test failed: Offset 368: Expected 01, got 00
version.c:733: Test failed: Offset 370: Expected 07, got 00
version.c:733: Test failed: Offset 371: Expected 02, got 00
version.c:733: Test failed: Offset 375: Expected 02, got 00
version.c:733: Test failed: Offset 384: Expected 00, got 44
version.c:733: Test failed: Offset 385: Expected 00, got 49
version.c:733: Test failed: Offset 386: Expected 00, got 4d
version.c:733: Test failed: Offset 387: Expected 00, got 4d
version.c:733: Test failed: Offset 388: Expected 00, got 20
version.c:733: Test failed: Offset 389: Expected 00, got 30
version.c:733: Test failed: Offset 391: Expected 00, got 51
version.c:733: Test failed: Offset 392: Expected 44, got 45
version.c:733: Test failed: Offset 393: Expected 49, got 4d
version.c:733: Test failed: Offset 394: Expected 4d, got 55
version.c:733: Test failed: Offset 395: Expected 4d, got 00
version.c:733: Test failed: Offset 396: Expected 20, got 00
version.c:733: Test failed: Offset 397: Expected 30, got 13
version.c:733: Test failed: Offset 398: Expected 00, got 1f
version.c:733: Test failed: Offset 399: Expected 51, got 00
version.c:733: Test failed: Offset 400: Expected 45, got 13
version.c:733: Test failed: Offset 401: Expected 4d, got 00
version.c:733: Test failed: Offset 402: Expected 55, got 00
version.c:733: Test failed: Offset 405: Expected 13, got ff
version.c:733: Test failed: Offset 406: Expected 1f, got ff
version.c:733: Test failed: Offset 407: Expected 00, got 0f
version.c:733: Test failed: Offset 408: Expected 13, got 00
version.c:733: Test failed: Offset 410: Expected 00, got 10
version.c:733: Test failed: Offset 411: Expected 00, got 01
version.c:733: Test failed: Offset 413: Expected ff, got 00
version.c:733: Test failed: Offset 414: Expected ff, got 00
version.c:733: Test failed: Offset 415: Expected 0f, got 00
version.c:733: Test failed: Offset 418: Expected 10, got 00
version.c:733: Test failed: Offset 419: Expected 01, got 00
version.c:733: Test failed: Offset 430: Expected 00, got 20
version.c:733: Test failed: Offset 431: Expected 00, got 0b
version.c:733: Test failed: Offset 433: Expected 00, got 20
version.c:733: Test failed: Offset 438: Expected 20, got 00
version.c:733: Test failed: Offset 439: Expected 0b, got 00
version.c:733: Test failed: Offset 441: Expected 20, got 00
version.c:733: Test failed: Offset 443: Expected 00, got 7f
version.c:733: Test failed: Offset 444: Expected 00, got 04
version.c:733: Test failed: Offset 446: Expected 00, got 7f
June 15, 2018
Re: [PATCH v5 2/8] ntdll/tests: Add SystemFirmwareTableInformation tests
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39153
Your paranoid android.
=== wxppro (32 bit info) ===
info.c:844: Test failed: Expected STATUS_INFO_LENGTH_MISMATCH, got c0000003
info.c:846: Test failed: Expected length 16, got 0
info.c:850: Test failed: Expected STATUS_NOT_IMPLEMENTED, got c0000003
info.c:858: Test failed: Expected STATUS_BUFFER_TOO_SMALL, got c0000003
info.c:860: Test failed: Expected length >= 16, got 0
info.c:867: Test failed: Expected STATUS_SUCCESS, got c0000003
=== w2003std (32 bit info) ===
info.c:846: Test failed: Expected length 16, got 0
info.c:850: Test failed: Expected STATUS_NOT_IMPLEMENTED, got c0000004
info.c:858: Test failed: Expected STATUS_BUFFER_TOO_SMALL, got c0000004
info.c:860: Test failed: Expected length >= 16, got 0
info.c:867: Test failed: Expected STATUS_SUCCESS, got c0000004
=== wvistau64 (32 bit info) ===
info.c:1836: Test failed: Expected STATUS_SUCCESS, got c0000022
0b9c:info: unhandled exception c0000005 at 003D0000
=== wvistau64_zh_CN (32 bit info) ===
info.c:1836: Test failed: Expected STATUS_SUCCESS, got c0000022
0bd0:info: unhandled exception c0000005 at 00360000
=== wvistau64_fr (32 bit info) ===
info.c:1836: Test failed: Expected STATUS_SUCCESS, got c0000022
072c:info: unhandled exception c0000005 at 003E0000
=== wvistau64_he (32 bit info) ===
info.c:1836: Test failed: Expected STATUS_SUCCESS, got c0000022
0be0:info: unhandled exception c0000005 at 003D0000
=== w2008s64 (32 bit info) ===
info.c:1836: Test failed: Expected STATUS_SUCCESS, got c0000022
0874:info: unhandled exception c0000005 at 002C0000
=== w7u (32 bit info) ===
info.c:1836: Test failed: Expected STATUS_SUCCESS, got c0000022
=== w7pro64 (32 bit info) ===
info.c:1836: Test failed: Expected STATUS_SUCCESS, got c0000022
0bf8:info: unhandled exception c0000005 at 003C0000
=== w8 (32 bit info) ===
info.c:1836: Test failed: Expected STATUS_SUCCESS, got c0000022
0fdc:info: unhandled exception c0000005 at 003E0000
=== w864 (32 bit info) ===
info.c:1836: Test failed: Expected STATUS_SUCCESS, got c0000022
0d10:info: unhandled exception c0000005 at 00360000
=== w1064 (32 bit info) ===
info.c:1836: Test failed: Expected STATUS_SUCCESS, got c0000022
064c:info: unhandled exception c0000005 at 002D0000
June 15, 2018
[PATCH v5 8/8] ntdll: Return chassis info from NtQuerySystemInformation on Linux
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/ntdll/nt.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index e79059b224..7380b236b1 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -108,6 +108,17 @@ struct smbios_board {
BYTE serial;
};
+struct smbios_chassis {
+ BYTE type;
+ BYTE length;
+ WORD handle;
+ BYTE vendor;
+ BYTE shape;
+ BYTE version;
+ BYTE serial;
+ BYTE asset_tag;
+};
+
#include "poppack.h"
/* Firmware table providers */
@@ -1945,12 +1956,15 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
size_t system_vendor_size, system_product_size, system_version_size, system_serial_size;
char *board_vendor, *board_product, *board_version, *board_serial;
size_t board_vendor_size, board_product_size, board_version_size, board_serial_size;
+ char *chassis_vendor, *chassis_version, *chassis_serial, *chassis_asset_tag;
+ size_t chassis_vendor_size, chassis_version_size, chassis_serial_size, chassis_asset_tag_size;
char *buffer = (char*)sfti->TableBuffer;
BYTE string_count;
struct smbios_prologue *prologue;
struct smbios_bios *bios;
struct smbios_system *system;
struct smbios_board *board;
+ struct smbios_chassis *chassis;
bios_vendor = get_smbios_string("/sys/class/dmi/id/bios_vendor", &bios_vendor_size);
bios_version = get_smbios_string("/sys/class/dmi/id/bios_version", &bios_version_size);
@@ -1963,6 +1977,10 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
board_product = get_smbios_string("/sys/class/dmi/id/board_name", &board_product_size);
board_version = get_smbios_string("/sys/class/dmi/id/board_version", &board_version_size);
board_serial = get_smbios_string("/sys/class/dmi/id/board_serial", &board_serial_size);
+ chassis_vendor = get_smbios_string("/sys/class/dmi/id/chassis_vendor", &chassis_vendor_size);
+ chassis_version = get_smbios_string("/sys/class/dmi/id/chassis_version", &chassis_version_size);
+ chassis_serial = get_smbios_string("/sys/class/dmi/id/chassis_serial", &chassis_serial_size);
+ chassis_asset_tag = get_smbios_string("/sys/class/dmi/id/chassis_tag", &chassis_asset_tag_size);
*required_len = FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
@@ -1980,6 +1998,10 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
*required_len += max(board_vendor_size + board_product_size + board_version_size +
board_serial_size + 1, 2);
+ *required_len += sizeof(struct smbios_chassis);
+ *required_len += max(chassis_vendor_size + chassis_version_size + chassis_serial_size +
+ chassis_asset_tag_size + 1, 2);
+
if (available_len < *required_len)
{
return STATUS_BUFFER_TOO_SMALL;
@@ -2048,6 +2070,33 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
buffer += 2;
}
+ string_count = 0;
+ chassis = (struct smbios_chassis*)buffer;
+ chassis->type = 3;
+ chassis->length = sizeof(struct smbios_chassis);
+ chassis->handle = 0;
+ chassis->vendor = chassis_vendor ? ++string_count : 0;
+ chassis->shape = 0x2; /* unknown */
+ chassis->version = chassis_version ? ++string_count : 0;
+ chassis->serial = chassis_serial ? ++string_count : 0;
+ chassis->asset_tag = chassis_asset_tag ? ++string_count : 0;
+ buffer += sizeof(struct smbios_chassis);
+
+ if (string_count)
+ {
+ copy_smbios_string(&buffer, chassis_vendor, chassis_vendor_size);
+ copy_smbios_string(&buffer, chassis_version, chassis_version_size);
+ copy_smbios_string(&buffer, chassis_serial, chassis_serial_size);
+ copy_smbios_string(&buffer, chassis_asset_tag, chassis_asset_tag_size);
+ memset(buffer, 0, 1);
+ buffer++;
+ }
+ else
+ {
+ memset(buffer, 0, 2);
+ buffer += 2;
+ }
+
string_count = 0;
board = (struct smbios_board*)buffer;
board->type = 2;
@@ -2083,6 +2132,10 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
free(board_product);
free(board_version);
free(board_serial);
+ free(chassis_vendor);
+ free(chassis_version);
+ free(chassis_serial);
+ free(chassis_asset_tag);
return STATUS_SUCCESS;
}
--
2.17.1
June 15, 2018
[PATCH v5 7/8] ntdll: Return board info from NtQuerySystemInformation on Linux
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/ntdll/nt.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 560cb747bf..e79059b224 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -98,6 +98,16 @@ struct smbios_system {
BYTE serial;
};
+struct smbios_board {
+ BYTE type;
+ BYTE length;
+ WORD handle;
+ BYTE vendor;
+ BYTE product;
+ BYTE version;
+ BYTE serial;
+};
+
#include "poppack.h"
/* Firmware table providers */
@@ -1933,11 +1943,14 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
size_t bios_vendor_size, bios_version_size, bios_date_size;
char *system_vendor, *system_product, *system_version, *system_serial;
size_t system_vendor_size, system_product_size, system_version_size, system_serial_size;
+ char *board_vendor, *board_product, *board_version, *board_serial;
+ size_t board_vendor_size, board_product_size, board_version_size, board_serial_size;
char *buffer = (char*)sfti->TableBuffer;
BYTE string_count;
struct smbios_prologue *prologue;
struct smbios_bios *bios;
struct smbios_system *system;
+ struct smbios_board *board;
bios_vendor = get_smbios_string("/sys/class/dmi/id/bios_vendor", &bios_vendor_size);
bios_version = get_smbios_string("/sys/class/dmi/id/bios_version", &bios_version_size);
@@ -1946,6 +1959,10 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
system_product = get_smbios_string("/sys/class/dmi/id/product", &system_product_size);
system_version = get_smbios_string("/sys/class/dmi/id/product_version", &system_version_size);
system_serial = get_smbios_string("/sys/class/dmi/id/product_serial", &system_serial_size);
+ board_vendor = get_smbios_string("/sys/class/dmi/id/board_vendor", &board_vendor_size);
+ board_product = get_smbios_string("/sys/class/dmi/id/board_name", &board_product_size);
+ board_version = get_smbios_string("/sys/class/dmi/id/board_version", &board_version_size);
+ board_serial = get_smbios_string("/sys/class/dmi/id/board_serial", &board_serial_size);
*required_len = FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
@@ -1955,9 +1972,14 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
*required_len += max(bios_vendor_size + bios_version_size + bios_date_size + 1, 2);
*required_len += sizeof(struct smbios_system);
+
*required_len += max(system_vendor_size + system_product_size + system_version_size +
system_serial_size + 1, 2);
+ *required_len += sizeof(struct smbios_board);
+ *required_len += max(board_vendor_size + board_product_size + board_version_size +
+ board_serial_size + 1, 2);
+
if (available_len < *required_len)
{
return STATUS_BUFFER_TOO_SMALL;
@@ -2018,6 +2040,32 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
copy_smbios_string(&buffer, system_version, system_version_size);
copy_smbios_string(&buffer, system_serial, system_serial_size);
memset(buffer, 0, 1);
+ buffer++;
+ }
+ else
+ {
+ memset(buffer, 0, 2);
+ buffer += 2;
+ }
+
+ string_count = 0;
+ board = (struct smbios_board*)buffer;
+ board->type = 2;
+ board->length = sizeof(struct smbios_board);
+ board->handle = 0;
+ board->vendor = board_vendor ? ++string_count : 0;
+ board->product = board_product ? ++string_count : 0;
+ board->version = board_version ? ++string_count : 0;
+ board->serial = board_serial ? ++string_count : 0;
+ buffer += sizeof(struct smbios_board);
+
+ if (string_count)
+ {
+ copy_smbios_string(&buffer, board_vendor, board_vendor_size);
+ copy_smbios_string(&buffer, board_product, board_product_size);
+ copy_smbios_string(&buffer, board_version, board_version_size);
+ copy_smbios_string(&buffer, board_serial, board_serial_size);
+ memset(buffer, 0, 1);
}
else
{
@@ -2031,6 +2079,10 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
free(system_product);
free(system_version);
free(system_serial);
+ free(board_vendor);
+ free(board_product);
+ free(board_version);
+ free(board_serial);
return STATUS_SUCCESS;
}
--
2.17.1
June 15, 2018
[PATCH v5 6/8] ntdll: Return system info from NtQuerySystemInformation on Linux
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/ntdll/nt.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 658970b051..560cb747bf 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -88,6 +88,16 @@ struct smbios_bios {
UINT64 characteristics;
};
+struct smbios_system {
+ BYTE type;
+ BYTE length;
+ WORD handle;
+ BYTE vendor;
+ BYTE product;
+ BYTE version;
+ BYTE serial;
+};
+
#include "poppack.h"
/* Firmware table providers */
@@ -1921,14 +1931,21 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
{
char *bios_vendor, *bios_version, *bios_date;
size_t bios_vendor_size, bios_version_size, bios_date_size;
+ char *system_vendor, *system_product, *system_version, *system_serial;
+ size_t system_vendor_size, system_product_size, system_version_size, system_serial_size;
char *buffer = (char*)sfti->TableBuffer;
BYTE string_count;
struct smbios_prologue *prologue;
struct smbios_bios *bios;
+ struct smbios_system *system;
bios_vendor = get_smbios_string("/sys/class/dmi/id/bios_vendor", &bios_vendor_size);
bios_version = get_smbios_string("/sys/class/dmi/id/bios_version", &bios_version_size);
bios_date = get_smbios_string("/sys/class/dmi/id/bios_date", &bios_date_size);
+ system_vendor = get_smbios_string("/sys/class/dmi/id/sys_vendor", &system_vendor_size);
+ system_product = get_smbios_string("/sys/class/dmi/id/product", &system_product_size);
+ system_version = get_smbios_string("/sys/class/dmi/id/product_version", &system_version_size);
+ system_serial = get_smbios_string("/sys/class/dmi/id/product_serial", &system_serial_size);
*required_len = FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
@@ -1937,6 +1954,10 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
*required_len += sizeof(struct smbios_bios);
*required_len += max(bios_vendor_size + bios_version_size + bios_date_size + 1, 2);
+ *required_len += sizeof(struct smbios_system);
+ *required_len += max(system_vendor_size + system_product_size + system_version_size +
+ system_serial_size + 1, 2);
+
if (available_len < *required_len)
{
return STATUS_BUFFER_TOO_SMALL;
@@ -1971,6 +1992,32 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
copy_smbios_string(&buffer, bios_version, bios_version_size);
copy_smbios_string(&buffer, bios_date, bios_date_size);
memset(buffer, 0, 1);
+ buffer++;
+ }
+ else
+ {
+ memset(buffer, 0, 2);
+ buffer += 2;
+ }
+
+ string_count = 0;
+ system = (struct smbios_system*)buffer;
+ system->type = 1;
+ system->length = sizeof(struct smbios_system);
+ system->handle = 0;
+ system->vendor = system_vendor ? ++string_count : 0;
+ system->product = system_product ? ++string_count : 0;
+ system->version = system_version ? ++string_count : 0;
+ system->serial = system_serial ? ++string_count : 0;
+ buffer += sizeof(struct smbios_system);
+
+ if (string_count)
+ {
+ copy_smbios_string(&buffer, system_vendor, system_vendor_size);
+ copy_smbios_string(&buffer, system_product, system_product_size);
+ copy_smbios_string(&buffer, system_version, system_version_size);
+ copy_smbios_string(&buffer, system_serial, system_serial_size);
+ memset(buffer, 0, 1);
}
else
{
@@ -1980,6 +2027,10 @@ static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti
free(bios_vendor);
free(bios_version);
free(bios_date);
+ free(system_vendor);
+ free(system_product);
+ free(system_version);
+ free(system_serial);
return STATUS_SUCCESS;
}
--
2.17.1
June 15, 2018
[PATCH v5 5/8] kernel32: Connect GetSystemFirmwareTable to NtQuerySystemInformation
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/kernel32/cpu.c | 29 +++++++++++++++++++++++++++++
dlls/kernel32/process.c | 10 ----------
dlls/kernel32/tests/version.c | 2 --
3 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c
index ec1fd0f90d..8397fbe729 100644
--- a/dlls/kernel32/cpu.c
+++ b/dlls/kernel32/cpu.c
@@ -336,3 +336,32 @@ DWORD64 WINAPI GetEnabledXStateFeatures(void)
FIXME("\n");
return 0;
}
+
+/***********************************************************************
+ * GetSystemFirmwareTable (KERNEL32.@)
+ */
+UINT WINAPI GetSystemFirmwareTable(DWORD provider, DWORD id, void *buffer, DWORD size)
+{
+ ULONG buffer_size = FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer) + size;
+ SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = HeapAlloc(GetProcessHeap(), 0, buffer_size);
+ NTSTATUS status;
+
+ if (!sfti)
+ {
+ SetLastError(ERROR_OUTOFMEMORY);
+ return 0;
+ }
+
+ sfti->ProviderSignature = provider;
+ sfti->Action = SystemFirmwareTable_Get;
+ sfti->TableID = id;
+
+ status = NtQuerySystemInformation(SystemFirmwareTableInformation, sfti, buffer_size, &buffer_size);
+ buffer_size -= FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
+ if (buffer_size <= size)
+ memcpy(buffer, sfti->TableBuffer, buffer_size);
+
+ if (status) SetLastError(RtlNtStatusToDosError(status));
+ HeapFree(GetProcessHeap(), 0, sfti);
+ return buffer_size;
+}
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index ff56e9a692..6adf08d257 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -4126,16 +4126,6 @@ HRESULT WINAPI UnregisterApplicationRestart(void)
return S_OK;
}
-/***********************************************************************
- * GetSystemFirmwareTable (KERNEL32.@)
- */
-UINT WINAPI GetSystemFirmwareTable(DWORD provider, DWORD id, PVOID buffer, DWORD size)
-{
- FIXME("(%d %d %p %d):stub\n", provider, id, buffer, size);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
struct proc_thread_attr
{
DWORD_PTR attr;
diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c
index 6ca45f0b2e..90d63c2794 100644
--- a/dlls/kernel32/tests/version.c
+++ b/dlls/kernel32/tests/version.c
@@ -721,12 +721,10 @@ void test_GetSystemFirmwareTable(void)
expected_len -= 16;
len = GetSystemFirmwareTable(RSMB, 0, smbios_table, 0);
-todo_wine
ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len);
smbios_table = HeapAlloc(GetProcessHeap(), 0, len);
len = GetSystemFirmwareTable(RSMB, 0, smbios_table, len);
-todo_wine
ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len);
for (i = 0; i < len; i++)
{
--
2.17.1
June 15, 2018
[PATCH v5 4/8] ntdll: Return BIOS info from NtQuerySystemInformation on Linux
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/ntdll/nt.c | 174 ++++++++++++++++++++++++++++++++++++++++
dlls/ntdll/tests/info.c | 14 ++--
2 files changed, 182 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index dc0ce04f42..658970b051 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -66,6 +66,35 @@
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
+#include "pshpack1.h"
+
+struct smbios_prologue {
+ BYTE calling_method;
+ BYTE major_version;
+ BYTE minor_version;
+ BYTE revision;
+ DWORD length;
+};
+
+struct smbios_bios {
+ BYTE type;
+ BYTE length;
+ WORD handle;
+ BYTE vendor;
+ BYTE version;
+ WORD start;
+ BYTE date;
+ BYTE size;
+ UINT64 characteristics;
+};
+
+#include "poppack.h"
+
+/* Firmware table providers */
+#define ACPI 0x41435049
+#define FIRM 0x4649524D
+#define RSMB 0x52534D42
+
/*
* Token
*/
@@ -1850,6 +1879,129 @@ static NTSTATUS create_logical_proc_info(SYSTEM_LOGICAL_PROCESSOR_INFORMATION **
}
#endif
+static inline void copy_smbios_string(char **buffer, char *string, size_t string_size)
+{
+ if (!string) return;
+ strcpy(*buffer, string);
+ *buffer += string_size;
+}
+
+#ifdef linux
+
+static char* get_smbios_string(const char *path, size_t *string_size)
+{
+ FILE *file = fopen(path, "r");
+ char *ret = NULL;
+ *string_size = 0;
+ if (file)
+ {
+ *string_size = getline(&ret, string_size, file) + 1;
+ fclose(file);
+ if (*string_size >= 2 && ret[*string_size - 2] == '\n')
+ {
+ ret[*string_size - 2] = 0;
+ (*string_size)--;
+ }
+ if (*string_size == 1)
+ {
+ free(ret);
+ ret = NULL;
+ *string_size = 0;
+ }
+ }
+ return ret;
+}
+
+static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti,
+ ULONG available_len, ULONG *required_len)
+{
+ switch (sfti->ProviderSignature)
+ {
+ case RSMB:
+ {
+ char *bios_vendor, *bios_version, *bios_date;
+ size_t bios_vendor_size, bios_version_size, bios_date_size;
+ char *buffer = (char*)sfti->TableBuffer;
+ BYTE string_count;
+ struct smbios_prologue *prologue;
+ struct smbios_bios *bios;
+
+ bios_vendor = get_smbios_string("/sys/class/dmi/id/bios_vendor", &bios_vendor_size);
+ bios_version = get_smbios_string("/sys/class/dmi/id/bios_version", &bios_version_size);
+ bios_date = get_smbios_string("/sys/class/dmi/id/bios_date", &bios_date_size);
+
+ *required_len = FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
+
+ *required_len += sizeof(struct smbios_prologue);
+
+ *required_len += sizeof(struct smbios_bios);
+ *required_len += max(bios_vendor_size + bios_version_size + bios_date_size + 1, 2);
+
+ if (available_len < *required_len)
+ {
+ return STATUS_BUFFER_TOO_SMALL;
+ }
+
+ sfti->TableBufferLength = *required_len - FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
+
+ prologue = (struct smbios_prologue*)buffer;
+ prologue->calling_method = 0;
+ prologue->major_version = 2;
+ prologue->minor_version = 0;
+ prologue->revision = 0;
+ prologue->length = sfti->TableBufferLength - sizeof(struct smbios_prologue);
+ buffer += sizeof(struct smbios_prologue);
+
+ string_count = 0;
+ bios = (struct smbios_bios*)buffer;
+ bios->type = 0;
+ bios->length = sizeof(struct smbios_bios);
+ bios->handle = 0;
+ bios->vendor = bios_vendor ? ++string_count : 0;
+ bios->version = bios_version ? ++string_count : 0;
+ bios->start = 0;
+ bios->date = bios_date ? ++string_count : 0;
+ bios->size = 0;
+ bios->characteristics = 0x4; /* not supported */
+ buffer += sizeof(struct smbios_bios);
+
+ if (string_count)
+ {
+ copy_smbios_string(&buffer, bios_vendor, bios_vendor_size);
+ copy_smbios_string(&buffer, bios_version, bios_version_size);
+ copy_smbios_string(&buffer, bios_date, bios_date_size);
+ memset(buffer, 0, 1);
+ }
+ else
+ {
+ memset(buffer, 0, 2);
+ }
+
+ free(bios_vendor);
+ free(bios_version);
+ free(bios_date);
+
+ return STATUS_SUCCESS;
+ }
+ default:
+ {
+ return STATUS_NOT_IMPLEMENTED;
+ FIXME("info_class SYSTEM_FIRMWARE_TABLE_INFORMATION\n");
+ }
+ }
+}
+
+#else
+
+static inline NTSTATUS get_firmware_info(SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti,
+ ULONG available_len, ULONG *required_len)
+{
+ return STATUS_NOT_IMPLEMENTED;
+ FIXME("info_class SYSTEM_FIRMWARE_TABLE_INFORMATION\n");
+}
+
+#endif
+
/******************************************************************************
* NtQuerySystemInformation [NTDLL.@]
* ZwQuerySystemInformation [NTDLL.@]
@@ -2359,6 +2511,28 @@ NTSTATUS WINAPI NtQuerySystemInformation(
else ret = STATUS_INFO_LENGTH_MISMATCH;
}
break;
+ case SystemFirmwareTableInformation:
+ {
+ SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = (SYSTEM_FIRMWARE_TABLE_INFORMATION*)SystemInformation;
+ len = FIELD_OFFSET(SYSTEM_FIRMWARE_TABLE_INFORMATION, TableBuffer);
+ if (Length < len)
+ {
+ ret = STATUS_INFO_LENGTH_MISMATCH;
+ break;
+ }
+
+ switch (sfti->Action)
+ {
+ case SystemFirmwareTable_Get:
+ ret = get_firmware_info(sfti, Length, &len);
+ break;
+ default:
+ len = 0;
+ ret = STATUS_NOT_IMPLEMENTED;
+ FIXME("info_class SYSTEM_FIRMWARE_TABLE_INFORMATION\n");
+ }
+ }
+ break;
default:
FIXME("(0x%08x,%p,0x%08x,%p) stub\n",
SystemInformationClass,SystemInformation,Length,ResultLength);
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index cdb91e1b73..b8feebd474 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -59,6 +59,12 @@ static DWORD one_before_last_pid = 0;
#define FIRM 0x4649524D
#define RSMB 0x52534D42
+#ifdef linux
+static const int firmware_todo = 0;
+#else
+static const int firmware_todo = 1;
+#endif
+
static BOOL InitFunctionPtrs(void)
{
/* All needed functions are NT based, so using GetModuleHandle is a good check */
@@ -840,13 +846,10 @@ static void test_query_firmware(void)
ok(!!sfti, "Failed to allocate memory\n");
status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 15, &len1);
-todo_wine
ok(status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
-todo_wine
ok(len1 == 16, "Expected length 16, got %u\n", len1);
status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
-todo_wine
ok(status == STATUS_NOT_IMPLEMENTED, "Expected STATUS_NOT_IMPLEMENTED, got %08x\n", status);
ok(len1 == 0, "Expected length 0, got %u\n", len1);
@@ -854,16 +857,15 @@ todo_wine
sfti->Action = SystemFirmwareTable_Get;
status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
-todo_wine
+todo_wine_if(firmware_todo)
ok(status == STATUS_BUFFER_TOO_SMALL, "Expected STATUS_BUFFER_TOO_SMALL, got %08x\n", status);
-todo_wine
ok(len1 >= 16, "Expected length >= 16, got %u\n", len1);
sfti = HeapReAlloc(GetProcessHeap(), 0, sfti, len1);
ok(!!sfti, "Failed to allocate memory\n");
status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, len1, &len2);
-todo_wine
+todo_wine_if(firmware_todo)
ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
ok(len2 == len1, "Expected length %u, got %u\n", len1, len2);
--
2.17.1
June 15, 2018
[PATCH v5 3/8] kernel32/tests: Add GetSystemFirmwareTable tests
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/kernel32/tests/version.c | 42 +++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c
index eb78a383d2..6ca45f0b2e 100644
--- a/dlls/kernel32/tests/version.c
+++ b/dlls/kernel32/tests/version.c
@@ -26,11 +26,17 @@
#include "winternl.h"
static BOOL (WINAPI * pGetProductInfo)(DWORD, DWORD, DWORD, DWORD, DWORD *);
+static NTSTATUS (WINAPI * pNtQuerySystemInformation)(SYSTEM_INFORMATION_CLASS, void *, ULONG, ULONG *);
static NTSTATUS (WINAPI * pRtlGetVersion)(RTL_OSVERSIONINFOEXW *);
#define GET_PROC(func) \
p##func = (void *)GetProcAddress(hmod, #func);
+/* Firmware table providers */
+#define ACPI 0x41435049
+#define FIRM 0x4649524D
+#define RSMB 0x52534D42
+
static void init_function_pointers(void)
{
HMODULE hmod;
@@ -41,6 +47,7 @@ static void init_function_pointers(void)
hmod = GetModuleHandleA("ntdll.dll");
+ GET_PROC(NtQuerySystemInformation);
GET_PROC(RtlGetVersion);
}
@@ -697,6 +704,40 @@ static void test_VerifyVersionInfo(void)
ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError());
}
+void test_GetSystemFirmwareTable(void)
+{
+ ULONG expected_len, i;
+ UINT len;
+ SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = HeapAlloc(GetProcessHeap(), 0, 16);
+ UCHAR *smbios_table = NULL;
+
+ ok(!!sfti, "Failed to allocate memory\n");
+ sfti->ProviderSignature = RSMB;
+ sfti->Action = SystemFirmwareTable_Get;
+ pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &expected_len);
+ sfti = HeapReAlloc(GetProcessHeap(), 0, sfti, expected_len);
+ ok(!!sfti, "Failed to allocate memory\n");
+ pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, expected_len, &expected_len);
+
+ expected_len -= 16;
+ len = GetSystemFirmwareTable(RSMB, 0, smbios_table, 0);
+todo_wine
+ ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len);
+
+ smbios_table = HeapAlloc(GetProcessHeap(), 0, len);
+ len = GetSystemFirmwareTable(RSMB, 0, smbios_table, len);
+todo_wine
+ ok(len == expected_len, "Expected length %u, got %u\n", expected_len, len);
+ for (i = 0; i < len; i++)
+ {
+ ok(smbios_table[i] == sfti->TableBuffer[i],
+ "Offset %u: Expected %02x, got %02x\n", i, sfti->TableBuffer[i], smbios_table[i]);
+ }
+
+ HeapFree(GetProcessHeap(), 0, sfti);
+ HeapFree(GetProcessHeap(), 0, smbios_table);
+}
+
START_TEST(version)
{
init_function_pointers();
@@ -704,4 +745,5 @@ START_TEST(version)
test_GetProductInfo();
test_GetVersionEx();
test_VerifyVersionInfo();
+ test_GetSystemFirmwareTable();
}
--
2.17.1
June 15, 2018
[PATCH v5 2/8] ntdll/tests: Add SystemFirmwareTableInformation tests
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
dlls/ntdll/tests/info.c | 48 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index 6c93c3cd58..cdb91e1b73 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -54,6 +54,11 @@ static DWORD one_before_last_pid = 0;
} \
} while(0)
+/* Firmware table providers */
+#define ACPI 0x41435049
+#define FIRM 0x4649524D
+#define RSMB 0x52534D42
+
static BOOL InitFunctionPtrs(void)
{
/* All needed functions are NT based, so using GetModuleHandle is a good check */
@@ -826,6 +831,45 @@ static void test_query_logicalprocex(void)
}
}
+static void test_query_firmware(void)
+{
+ ULONG len1, len2;
+ NTSTATUS status;
+ SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 16);
+
+ ok(!!sfti, "Failed to allocate memory\n");
+
+ status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 15, &len1);
+todo_wine
+ ok(status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status);
+todo_wine
+ ok(len1 == 16, "Expected length 16, got %u\n", len1);
+
+ status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
+todo_wine
+ ok(status == STATUS_NOT_IMPLEMENTED, "Expected STATUS_NOT_IMPLEMENTED, got %08x\n", status);
+ ok(len1 == 0, "Expected length 0, got %u\n", len1);
+
+ sfti->ProviderSignature = RSMB;
+ sfti->Action = SystemFirmwareTable_Get;
+
+ status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, 16, &len1);
+todo_wine
+ ok(status == STATUS_BUFFER_TOO_SMALL, "Expected STATUS_BUFFER_TOO_SMALL, got %08x\n", status);
+todo_wine
+ ok(len1 >= 16, "Expected length >= 16, got %u\n", len1);
+
+ sfti = HeapReAlloc(GetProcessHeap(), 0, sfti, len1);
+ ok(!!sfti, "Failed to allocate memory\n");
+
+ status = pNtQuerySystemInformation(SystemFirmwareTableInformation, sfti, len1, &len2);
+todo_wine
+ ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status);
+ ok(len2 == len1, "Expected length %u, got %u\n", len1, len2);
+
+ HeapFree(GetProcessHeap(), 0, sfti);
+}
+
static void test_query_processor_power_info(void)
{
NTSTATUS status;
@@ -2267,6 +2311,10 @@ START_TEST(info)
trace("Starting test_process_debug_flags()\n");
test_query_process_debug_flags(argc, argv);
+ /* 0x4C SystemFirmwareTableInformation */
+ trace("Starting test_query_firmware()\n");
+ test_query_firmware();
+
/* belongs to its own file */
trace("Starting test_readvirtualmemory()\n");
test_readvirtualmemory();
--
2.17.1
June 15, 2018
[PATCH v5 1/8] include: Add SYSTEM_FIRMWARE_TABLE_INFORMATION to winternl.h
by Alex Henrie
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com>
---
include/winternl.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/include/winternl.h b/include/winternl.h
index 58c475dfff..6e0bd987b6 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -1579,6 +1579,23 @@ typedef struct _SYSTEM_TIME_ADJUSTMENT {
BOOLEAN TimeAdjustmentDisabled;
} SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
+typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION
+{
+ SystemFirmwareTable_Enumerate = 0,
+ SystemFirmwareTable_Get = 1
+} SYSTEM_FIRMWARE_TABLE_ACTION, *PSYSTEM_FIRMWARE_TABLE_ACTION;
+
+/* System Information Class 0x4C */
+
+typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION
+{
+ ULONG ProviderSignature;
+ SYSTEM_FIRMWARE_TABLE_ACTION Action;
+ ULONG TableID;
+ ULONG TableBufferLength;
+ UCHAR TableBuffer[1];
+} SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION;
+
typedef struct _TIME_FIELDS
{ CSHORT Year;
CSHORT Month;
--
2.17.1
June 15, 2018
[PATCH 2/2] iphlpapi: Improve parameter checking for IcmpSendEcho().
by Zhiyi Zhang
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/iphlpapi/icmp.c | 9 +++++++--
dlls/iphlpapi/tests/iphlpapi.c | 8 --------
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/dlls/iphlpapi/icmp.c b/dlls/iphlpapi/icmp.c
index 7c91443598..c9603b7baa 100644
--- a/dlls/iphlpapi/icmp.c
+++ b/dlls/iphlpapi/icmp.c
@@ -290,11 +290,16 @@ DWORD WINAPI IcmpSendEcho(
if (IcmpHandle==INVALID_HANDLE_VALUE) {
/* FIXME: in fact win98 seems to ignore the handle value !!! */
- SetLastError(ERROR_INVALID_HANDLE);
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+ }
+
+ if (!ReplyBuffer||!ReplySize) {
+ SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
- if (ReplySize<sizeof(ICMP_ECHO_REPLY)+ICMP_MINLEN) {
+ if (ReplySize<sizeof(ICMP_ECHO_REPLY)) {
SetLastError(IP_BUF_TOO_SMALL);
return 0;
}
diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c
index f964878d68..ff381c5e29 100644
--- a/dlls/iphlpapi/tests/iphlpapi.c
+++ b/dlls/iphlpapi/tests/iphlpapi.c
@@ -966,7 +966,6 @@ static void testIcmpSendEcho(void)
ret = pIcmpSendEcho(INVALID_HANDLE_VALUE, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000);
error = GetLastError();
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
-todo_wine
ok (error == ERROR_INVALID_PARAMETER
|| broken(error == ERROR_INVALID_HANDLE) /* <= 2003 */,
"expected 87, got %d\n", error);
@@ -1009,20 +1008,16 @@ todo_wine
error = GetLastError();
ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error);
- if (0) /* crashes in wine, remove IF when fixed */
- {
SetLastError(0xdeadbeef);
ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, NULL, replysz, 1000);
error = GetLastError();
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
ok (error == ERROR_INVALID_PARAMETER, "expected 87, got %d\n", error);
- }
SetLastError(0xdeadbeef);
ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, 0, 1000);
error = GetLastError();
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
-todo_wine
ok (error == ERROR_INVALID_PARAMETER
|| broken(error == ERROR_INSUFFICIENT_BUFFER) /* <= 2003 */,
"expected 87, got %d\n", error);
@@ -1031,7 +1026,6 @@ todo_wine
ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, NULL, 0, 1000);
error = GetLastError();
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
-todo_wine
ok (error == ERROR_INVALID_PARAMETER
|| broken(error == ERROR_INSUFFICIENT_BUFFER) /* <= 2003 */,
"expected 87, got %d\n", error);
@@ -1049,7 +1043,6 @@ todo_wine
replysz = sizeof(ICMP_ECHO_REPLY);
ret = pIcmpSendEcho(icmp, address, senddata, 0, NULL, replydata, replysz, 1000);
error = GetLastError();
-todo_wine
ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error);
SetLastError(0xdeadbeef);
@@ -1071,7 +1064,6 @@ todo_wine
ret = pIcmpSendEcho(icmp, address, senddata, ICMP_MINLEN, NULL, replydata, replysz - 1, 1000);
error = GetLastError();
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
-todo_wine
ok (error == IP_GENERAL_FAILURE
|| broken(error == IP_BUF_TOO_SMALL) /* <= 2003 */,
"expected 11050, got %d\n", error);
--
2.17.1
June 15, 2018
[PATCH 1/2] iphlpapi: Use a standalone buffer in IcmpSendEcho().
by Zhiyi Zhang
Fix https://bugs.winehq.org/show_bug.cgi?id=43252
The old implementation uses user provided buffer to receive
packet data, which is alway not enough, causing data corruptions
or incorrectly timeout.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/iphlpapi/icmp.c | 38 +++++++++++++++++++++++++++-------
dlls/iphlpapi/tests/iphlpapi.c | 21 +++++++++++++++----
2 files changed, 47 insertions(+), 12 deletions(-)
diff --git a/dlls/iphlpapi/icmp.c b/dlls/iphlpapi/icmp.c
index ebc2f2b65c..7c91443598 100644
--- a/dlls/iphlpapi/icmp.c
+++ b/dlls/iphlpapi/icmp.c
@@ -113,6 +113,9 @@ typedef struct {
#define IP_OPTS_DEFAULT 1
#define IP_OPTS_CUSTOM 2
+#define MAXIPLEN 60
+#define MAXICMPLEN 76
+
/* The sequence number is unique process wide, so that all threads
* have a distinct sequence number.
*/
@@ -270,13 +273,14 @@ DWORD WINAPI IcmpSendEcho(
icmp_t* icp=(icmp_t*)IcmpHandle;
unsigned char* reqbuf;
int reqsize;
+ unsigned char* repbuf;
+ int repsize;
struct icmp_echo_reply* ier;
struct ip* ip_header;
struct icmp* icmp_header;
char* endbuf;
int ip_header_len;
- int maxlen;
struct pollfd fdr;
DWORD send_time,recv_time;
struct sockaddr_in addr;
@@ -312,6 +316,16 @@ DWORD WINAPI IcmpSendEcho(
return 0;
}
+ /* max ip header + max icmp header and error data + reply size(max 65535 on Windows) */
+ /* FIXME: request size of 65535 is not supported yet because max buffer size of raw socket on linux is 32767 */
+ repsize=MAXIPLEN+MAXICMPLEN+(ReplySize&0xFFFF);
+ repbuf=HeapAlloc(GetProcessHeap(), 0, repsize);
+ if (reqbuf==NULL) {
+ HeapFree(GetProcessHeap(), 0, reqbuf);
+ SetLastError(ERROR_OUTOFMEMORY);
+ return 0;
+ }
+
icmp_header=(struct icmp*)reqbuf;
icmp_header->icmp_type=ICMP_ECHO;
icmp_header->icmp_code=0;
@@ -367,9 +381,7 @@ DWORD WINAPI IcmpSendEcho(
fdr.events = POLLIN;
addrlen=sizeof(addr);
ier=ReplyBuffer;
- ip_header=(struct ip *) ((char *) ReplyBuffer+sizeof(ICMP_ECHO_REPLY));
endbuf=(char *) ReplyBuffer+ReplySize;
- maxlen=ReplySize-sizeof(ICMP_ECHO_REPLY);
/* Send the packet */
TRACE("Sending %d bytes (RequestSize=%d) to %s\n", reqsize, RequestSize, inet_ntoa(addr.sin_addr));
@@ -407,10 +419,11 @@ DWORD WINAPI IcmpSendEcho(
}
/* Get the reply */
+ ip_header=(struct ip*)repbuf;
ip_header_len=0; /* because gcc was complaining */
while (poll(&fdr,1,Timeout)>0) {
recv_time = GetTickCount();
- res=recvfrom(icp->sid, (char*)ip_header, maxlen, 0, (struct sockaddr*)&addr,&addrlen);
+ res=recvfrom(icp->sid, (char*)repbuf, repsize, 0, (struct sockaddr*)&addr, &addrlen);
TRACE("received %d bytes from %s\n",res, inet_ntoa(addr.sin_addr));
ier->Status=IP_REQ_TIMED_OUT;
@@ -508,6 +521,12 @@ DWORD WINAPI IcmpSendEcho(
else Timeout = 0;
continue;
} else {
+ /* Check free space, should be large enough for an ICMP_ECHO_REPLY and remainning icmp data */
+ if (endbuf-(char *)ier < sizeof(struct icmp_echo_reply)+(res-ip_header_len-ICMP_MINLEN)) {
+ res=ier-(ICMP_ECHO_REPLY *)ReplyBuffer;
+ SetLastError(IP_GENERAL_FAILURE);
+ goto done;
+ }
/* This is a reply to our packet */
memcpy(&ier->Address,&ip_header->ip_src,sizeof(IPAddr));
/* Status is already set */
@@ -515,7 +534,7 @@ DWORD WINAPI IcmpSendEcho(
ier->DataSize=res-ip_header_len-ICMP_MINLEN;
ier->Reserved=0;
ier->Data=endbuf-ier->DataSize;
- memmove(ier->Data,((char*)ip_header)+ip_header_len+ICMP_MINLEN,ier->DataSize);
+ memcpy(ier->Data, ((char *)ip_header)+ip_header_len+ICMP_MINLEN, ier->DataSize);
ier->Options.Ttl=ip_header->ip_ttl;
ier->Options.Tos=ip_header->ip_tos;
ier->Options.Flags=ip_header->ip_off >> 13;
@@ -523,7 +542,7 @@ DWORD WINAPI IcmpSendEcho(
if (ier->Options.OptionsSize!=0) {
ier->Options.OptionsData=(unsigned char *) ier->Data-ier->Options.OptionsSize;
/* FIXME: We are supposed to rearrange the option's 'source route' data */
- memmove(ier->Options.OptionsData,((char*)ip_header)+ip_header_len,ier->Options.OptionsSize);
+ memcpy(ier->Options.OptionsData, ((char *)ip_header)+ip_header_len, ier->Options.OptionsSize);
endbuf=(char*)ier->Options.OptionsData;
} else {
ier->Options.OptionsData=NULL;
@@ -531,9 +550,8 @@ DWORD WINAPI IcmpSendEcho(
}
/* Prepare for the next packet */
+ endbuf-=ier->DataSize;
ier++;
- ip_header=(struct ip*)(((char*)ip_header)+sizeof(ICMP_ECHO_REPLY));
- maxlen=endbuf-(char*)ip_header;
/* Check out whether there is more but don't wait this time */
Timeout=0;
@@ -542,6 +560,10 @@ DWORD WINAPI IcmpSendEcho(
res=ier-(ICMP_ECHO_REPLY*)ReplyBuffer;
if (res==0)
SetLastError(IP_REQ_TIMED_OUT);
+ else
+ SetLastError(NO_ERROR);
+done:
+ HeapFree(GetProcessHeap(), 0, repbuf);
TRACE("received %d replies\n",res);
return res;
}
diff --git a/dlls/iphlpapi/tests/iphlpapi.c b/dlls/iphlpapi/tests/iphlpapi.c
index d5613d7b4b..f964878d68 100644
--- a/dlls/iphlpapi/tests/iphlpapi.c
+++ b/dlls/iphlpapi/tests/iphlpapi.c
@@ -951,6 +951,8 @@ static void testIcmpSendEcho(void)
char senddata[32], replydata[sizeof(senddata) + sizeof(ICMP_ECHO_REPLY)];
DWORD ret, error, replysz = sizeof(replydata);
IPAddr address;
+ ICMP_ECHO_REPLY *reply;
+ INT i;
if (!pIcmpSendEcho || !pIcmpCreateFile)
{
@@ -1038,12 +1040,10 @@ todo_wine
replysz = sizeof(replydata) - 1;
ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000);
error = GetLastError();
- todo_wine {
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
ok (error == IP_GENERAL_FAILURE
|| broken(error == IP_BUF_TOO_SMALL) /* <= 2003 */,
"expected 11050, got %d\n", error);
- }
SetLastError(0xdeadbeef);
replysz = sizeof(ICMP_ECHO_REPLY);
@@ -1056,7 +1056,6 @@ todo_wine
replysz = sizeof(ICMP_ECHO_REPLY) + ICMP_MINLEN;
ret = pIcmpSendEcho(icmp, address, senddata, ICMP_MINLEN, NULL, replydata, replysz, 1000);
error = GetLastError();
-todo_wine
ok (ret, "IcmpSendEcho failed unexpectedly with error %d\n", error);
SetLastError(0xdeadbeef);
@@ -1064,7 +1063,6 @@ todo_wine
ret = pIcmpSendEcho(icmp, address, senddata, ICMP_MINLEN + 1, NULL, replydata, replysz, 1000);
error = GetLastError();
ok (!ret, "IcmpSendEcho succeeded unexpectedly\n");
-todo_wine
ok (error == IP_GENERAL_FAILURE
|| broken(error == IP_BUF_TOO_SMALL) /* <= 2003 */,
"expected 11050, got %d\n", error);
@@ -1111,6 +1109,21 @@ todo_wine
{
skip ("Failed to ping with error %d, is lo interface down?.\n", error);
}
+
+ /* check reply data */
+ SetLastError(0xdeadbeef);
+ address = htonl(INADDR_LOOPBACK);
+ for (i = 0; i < ARRAY_SIZE(senddata); i++) senddata[i] = i & 0xff;
+ ret = pIcmpSendEcho(icmp, address, senddata, sizeof(senddata), NULL, replydata, replysz, 1000);
+ error = GetLastError();
+ reply = (ICMP_ECHO_REPLY *)replydata;
+ ok(ret, "IcmpSendEcho failed unexpectedly\n");
+ ok(error == NO_ERROR, "Expect last error:0x%08x, got:0x%08x\n", NO_ERROR, error);
+ ok(INADDR_LOOPBACK == ntohl(reply->Address), "Address mismatch, expect:%s, got: %s\n", ntoa(INADDR_LOOPBACK),
+ ntoa(reply->Address));
+ ok(reply->Status == IP_SUCCESS, "Expect status:0x%08x, got:0x%08x\n", IP_SUCCESS, reply->Status);
+ ok(reply->DataSize == sizeof(senddata), "Expect data size:%d, got:%d\n", sizeof(senddata), reply->DataSize);
+ ok(!memcmp(senddata, reply->Data, min(sizeof(senddata), reply->DataSize)), "Data mismatch\n");
}
/*
--
2.17.1
June 15, 2018
[PATCH] kernel32: Always start debugger on WinSta0.
by Alistair Leslie-Hughes
From: Sebastian Lackner <sebastian(a)fds-team.de>
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/kernel32/except.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/kernel32/except.c b/dlls/kernel32/except.c
index de244fc..5f2166e 100644
--- a/dlls/kernel32/except.c
+++ b/dlls/kernel32/except.c
@@ -304,6 +304,7 @@ static BOOL start_debugger(PEXCEPTION_POINTERS epointers, HANDLE hEvent)
TRACE("Starting debugger %s\n", debugstr_a(cmdline));
memset(&startup, 0, sizeof(startup));
startup.cb = sizeof(startup);
+ startup.lpDesktop = (char *)"WinSta0";
startup.dwFlags = STARTF_USESHOWWINDOW;
startup.wShowWindow = SW_SHOWNORMAL;
ret = CreateProcessA(NULL, cmdline, NULL, NULL, TRUE, 0, env, NULL, &startup, &info);
--
1.9.1
June 15, 2018
[PATCH v3] comctl32/taskdialog: Add support for progress bar.
by Zhiyi Zhang
Rebase. Supersede 147419.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/comctl32/taskdialog.c | 55 ++++++++++++++++++++++++++
dlls/comctl32/tests/taskdialog.c | 67 ++++++++++++++++++++++++++++++++
2 files changed, 122 insertions(+)
diff --git a/dlls/comctl32/taskdialog.c b/dlls/comctl32/taskdialog.c
index 07c031b2c7..1a5fad1609 100644
--- a/dlls/comctl32/taskdialog.c
+++ b/dlls/comctl32/taskdialog.c
@@ -57,6 +57,7 @@ struct taskdialog_info
HWND main_icon;
HWND main_instruction;
HWND content;
+ HWND progress_bar;
HWND *buttons;
INT button_count;
HWND default_button;
@@ -351,6 +352,17 @@ static void taskdialog_add_content(struct taskdialog_info *dialog_info)
taskdialog_hyperlink_enabled(dialog_info));
}
+static void taskdialog_add_progress_bar(struct taskdialog_info *dialog_info)
+{
+ const TASKDIALOGCONFIG *taskconfig = dialog_info->taskconfig;
+ DWORD style = PBS_SMOOTH | PBS_SMOOTHREVERSE | WS_CHILD | WS_VISIBLE;
+
+ if (!(taskconfig->dwFlags & (TDF_SHOW_PROGRESS_BAR | TDF_SHOW_MARQUEE_PROGRESS_BAR))) return;
+ if (taskconfig->dwFlags & TDF_SHOW_MARQUEE_PROGRESS_BAR) style |= PBS_MARQUEE;
+ dialog_info->progress_bar =
+ CreateWindowW(PROGRESS_CLASSW, NULL, style, 0, 0, 0, 0, dialog_info->hwnd, NULL, 0, NULL);
+}
+
static void taskdialog_add_button(struct taskdialog_info *dialog_info, HWND *button, INT_PTR id, const WCHAR *text,
BOOL custom_button)
{
@@ -464,6 +476,17 @@ static void taskdialog_layout(struct taskdialog_info *dialog_info)
/* Content */
taskdialog_label_layout(dialog_info, dialog_info->content, main_icon_right, dialog_width, &dialog_height, syslink);
+ /* Progress bar */
+ if (dialog_info->progress_bar)
+ {
+ x = main_icon_right + h_spacing;
+ y = dialog_height + v_spacing;
+ size.cx = dialog_width - x - h_spacing;
+ size.cy = GetSystemMetrics(SM_CYVSCROLL);
+ SetWindowPos(dialog_info->progress_bar, 0, x, y, size.cx, size.cy, SWP_NOZORDER);
+ dialog_height = y + size.cy;
+ }
+
dialog_height = max(dialog_height, main_icon_bottom);
/* Common and custom buttons */
@@ -598,6 +621,7 @@ static void taskdialog_init(struct taskdialog_info *dialog_info, HWND hwnd)
taskdialog_add_main_icon(dialog_info);
taskdialog_add_main_instruction(dialog_info);
taskdialog_add_content(dialog_info);
+ taskdialog_add_progress_bar(dialog_info);
taskdialog_add_buttons(dialog_info);
/* Set default button */
@@ -621,6 +645,7 @@ static INT_PTR CALLBACK taskdialog_proc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
{
static const WCHAR taskdialog_info_propnameW[] = {'T','a','s','k','D','i','a','l','o','g','I','n','f','o',0};
struct taskdialog_info *dialog_info;
+ LRESULT result;
TRACE("hwnd=%p msg=0x%04x wparam=%lx lparam=%lx\n", hwnd, msg, wParam, lParam);
@@ -635,6 +660,36 @@ static INT_PTR CALLBACK taskdialog_proc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
case TDM_ENABLE_BUTTON:
taskdialog_enable_button(dialog_info, wParam, lParam);
break;
+ case TDM_SET_MARQUEE_PROGRESS_BAR:
+ {
+ BOOL marquee = wParam;
+ LONG style;
+ if(!dialog_info->progress_bar) break;
+ style = GetWindowLongW(dialog_info->progress_bar, GWL_STYLE);
+ style = marquee ? style | PBS_MARQUEE : style & (~PBS_MARQUEE);
+ SetWindowLongW(dialog_info->progress_bar, GWL_STYLE, style);
+ break;
+ }
+ case TDM_SET_PROGRESS_BAR_STATE:
+ result = SendMessageW(dialog_info->progress_bar, PBM_SETSTATE, wParam, 0);
+ SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, result);
+ break;
+ case TDM_SET_PROGRESS_BAR_RANGE:
+ result = SendMessageW(dialog_info->progress_bar, PBM_SETRANGE, 0, lParam);
+ SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, result);
+ break;
+ case TDM_SET_PROGRESS_BAR_POS:
+ result = 0;
+ if (dialog_info->progress_bar)
+ {
+ LONG style = GetWindowLongW(dialog_info->progress_bar, GWL_STYLE);
+ if (!(style & PBS_MARQUEE)) result = SendMessageW(dialog_info->progress_bar, PBM_SETPOS, wParam, 0);
+ }
+ SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, result);
+ break;
+ case TDM_SET_PROGRESS_BAR_MARQUEE:
+ SendMessageW(dialog_info->progress_bar, PBM_SETMARQUEE, wParam, lParam);
+ break;
case WM_INITDIALOG:
dialog_info = (struct taskdialog_info *)lParam;
diff --git a/dlls/comctl32/tests/taskdialog.c b/dlls/comctl32/tests/taskdialog.c
index cca700cd18..e91a878876 100644
--- a/dlls/comctl32/tests/taskdialog.c
+++ b/dlls/comctl32/tests/taskdialog.c
@@ -373,6 +373,72 @@ static void test_timer(void)
pTaskDialogIndirect(&info, NULL, NULL, NULL);
}
+static HRESULT CALLBACK taskdialog_callback_proc_progress_bar(HWND hwnd, UINT notification, WPARAM wParam,
+ LPARAM lParam, LONG_PTR ref_data)
+{
+ unsigned long ret;
+ LONG flags = (LONG)ref_data;
+ if (notification == TDN_CREATED)
+ {
+ /* TDM_SET_PROGRESS_BAR_STATE */
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_STATE, PBST_NORMAL, 0);
+ ok(ret == PBST_NORMAL, "Expect state: %d got state: %lx\n", PBST_NORMAL, ret);
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_STATE, PBST_PAUSED, 0);
+ ok(ret == PBST_NORMAL, "Expect state: %d got state: %lx\n", PBST_NORMAL, ret);
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_STATE, PBST_ERROR, 0);
+ /* Progress bar has fixme on handling PBM_SETSTATE message */
+ todo_wine ok(ret == PBST_PAUSED, "Expect state: %d got state: %lx\n", PBST_PAUSED, ret);
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_STATE, PBST_NORMAL, 0);
+ todo_wine ok(ret == PBST_ERROR, "Expect state: %d got state: %lx\n", PBST_ERROR, ret);
+
+ /* TDM_SET_PROGRESS_BAR_RANGE */
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELPARAM(0, 200));
+ ok(ret == MAKELONG(0, 100), "Expect range:%x got:%lx\n", MAKELONG(0, 100), ret);
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_RANGE, 0, MAKELPARAM(0, 200));
+ ok(ret == MAKELONG(0, 200), "Expect range:%x got:%lx\n", MAKELONG(0, 200), ret);
+
+ /* TDM_SET_PROGRESS_BAR_POS */
+ if (flags & TDF_SHOW_MARQUEE_PROGRESS_BAR)
+ {
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_POS, 1, 0);
+ ok(ret == 0, "Expect position:%x got:%lx\n", 0, ret);
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_POS, 2, 0);
+ ok(ret == 0, "Expect position:%x got:%lx\n", 0, ret);
+ }
+ else
+ {
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_POS, 1, 0);
+ ok(ret == 0, "Expect position:%x got:%lx\n", 0, ret);
+ ret = SendMessageW(hwnd, TDM_SET_PROGRESS_BAR_POS, 2, 0);
+ ok(ret == 1, "Expect position:%x got:%lx\n", 1, ret);
+ }
+
+ SendMessageW(hwnd, TDM_CLICK_BUTTON, IDOK, 0);
+ }
+
+ return S_OK;
+}
+
+static void test_progress_bar(void)
+{
+ TASKDIALOGCONFIG info = {0};
+
+ info.cbSize = sizeof(TASKDIALOGCONFIG);
+ info.dwFlags = TDF_SHOW_PROGRESS_BAR;
+ info.pfCallback = taskdialog_callback_proc_progress_bar;
+ info.lpCallbackData = (LONG_PTR)info.dwFlags;
+ info.dwCommonButtons = TDCBF_OK_BUTTON;
+ pTaskDialogIndirect(&info, NULL, NULL, NULL);
+
+ info.dwFlags = TDF_SHOW_MARQUEE_PROGRESS_BAR;
+ info.lpCallbackData = (LONG_PTR)info.dwFlags;
+ pTaskDialogIndirect(&info, NULL, NULL, NULL);
+
+ info.dwFlags = TDF_SHOW_PROGRESS_BAR | TDF_SHOW_MARQUEE_PROGRESS_BAR;
+ info.lpCallbackData = (LONG_PTR)info.dwFlags;
+ pTaskDialogIndirect(&info, NULL, NULL, NULL);
+}
+
START_TEST(taskdialog)
{
ULONG_PTR ctx_cookie;
@@ -411,6 +477,7 @@ START_TEST(taskdialog)
test_buttons();
test_help();
test_timer();
+ test_progress_bar();
unload_v6_module(ctx_cookie, hCtx);
}
--
2.17.1
June 15, 2018
Re: [PATCH] urlmon/tests: Use the available ARRAY_SIZE() macro
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39144
Your paranoid android.
=== wvistau64 (64 bit url) ===
url.c:1877: Test failed: binding failed: 800c0006, expected 00000000
url.c:1888: Test failed: res = 00002f4f, expected 00000000
url.c:3190: Test failed: expected OnProgress_SENDINGREQUEST
url.c:3198: Test failed: expected OnProgress_MIMETYPEAVAILABLE
url.c:3199: Test failed: expected OnProgress_BEGINDOWNLOADDATA
url.c:3200: Test failed: expected OnProgress_ENDDOWNLOADDATA
url.c:3212: Test failed: expected OnDataAvailable
=== w7pro64 (64 bit url) ===
url.c:3680: Test failed: CreateFile failed
url.c:1550: Test failed: unexpected call QueryInterface_IWindowForBindingUI
url.c:1420: Test failed: unexpected call QueryService_IWindowForBindingUI
url.c:1350: Test failed: unexpected call GetWindow_ICodeInstall
url.c:1877: Test failed: binding failed: 80040154, expected 00000000
url.c:3430: Test failed: expected Obj_OnProgress_CLASSIDAVAILABLE
url.c:3439: Test failed: expected OnObjectAvailable
June 14, 2018
[PATCH] winex11.drv: Correct compile without vulkan support
by Alistair Leslie-Hughes
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com>
---
dlls/winex11.drv/vulkan.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c
index 7eca31b..fdb858d 100644
--- a/dlls/winex11.drv/vulkan.c
+++ b/dlls/winex11.drv/vulkan.c
@@ -626,4 +626,8 @@ const struct vulkan_funcs *get_vulkan_driver(UINT version)
return NULL;
}
+void wine_vk_surface_destroy(HWND hwnd)
+{
+}
+
#endif /* SONAME_LIBVULKAN */
--
1.9.1
June 14, 2018
Re: [PATCH] shell32/tests: Use the available ARRAY_SIZE() macro
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at
https://testbot.winehq.org/JobDetails.pl?Key=39142
Your paranoid android.
=== wvistau64_zh_CN (32 bit shlexec) ===
shlexec.c:2501: Test failed: ShellExecuteEx(mask="0x8540", file="C:\Users\winetest\AppData\Local\Temp\wt39B5.tmp\test file.sde") Assoc class="shlexec.sde", verb="Open", rawcmd="0", cmdtail="", ddeexec="[open("%1")]", app="shlexec", topic="dde" failed: rc=2 err=2
shlexec.c:2501: Test failed: ShellExecuteEx(mask="0x8540", file="C:\Users\winetest\AppData\Local\Temp\wt39B5.tmp\test file.sde") Assoc class="shlexec.sde", verb="Open", rawcmd="0", cmdtail=""%1"", ddeexec="[open("%1")]", app="shlexec", topic="dde" failed: rc=2 err=2
June 14, 2018
[PATCH] d3dx9/tests: Add initial tests for ID3DXFont::DrawText().
by Matteo Bruni
From: Kieran Duggan <kieranduggan15(a)gmail.com>
Signed-off-by: Kieran Duggan <kieranduggan15(a)gmail.com>
Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com>
---
dlls/d3dx9_36/tests/core.c | 81 +++++++++++++++++++++++++++++++++++-----------
1 file changed, 62 insertions(+), 19 deletions(-)
diff --git a/dlls/d3dx9_36/tests/core.c b/dlls/d3dx9_36/tests/core.c
index 75d33c1e0dc..3ed25f8176b 100644
--- a/dlls/d3dx9_36/tests/core.c
+++ b/dlls/d3dx9_36/tests/core.c
@@ -305,23 +305,28 @@ static void test_ID3DXSprite(IDirect3DDevice9 *device)
static void test_ID3DXFont(IDirect3DDevice9 *device)
{
- D3DXFONT_DESCA desc;
- ID3DXFont *font;
- HRESULT hr;
- int ref;
- int i;
- static const struct {
- INT font_height;
- UINT expected_size;
- DWORD expected_levels;
- } texture_tests[] = {
+ static const WCHAR testW[] = {'t','e','s','t',0};
+ static const struct
+ {
+ int font_height;
+ unsigned int expected_size;
+ unsigned int expected_levels;
+ }
+ tests[] =
+ {
{ 6, 128, 4 },
{ 8, 128, 4 },
{ 10, 256, 5 },
{ 12, 256, 5 },
- { 72, 256, 8 }
+ { 72, 256, 8 },
};
-
+ const unsigned int size = ARRAY_SIZE(testW);
+ D3DXFONT_DESCA desc;
+ ID3DXSprite *sprite;
+ int ref, i, height;
+ ID3DXFont *font;
+ HRESULT hr;
+ RECT rect;
/* D3DXCreateFont */
ref = get_ref((IUnknown*)device);
@@ -463,8 +468,6 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
/* ID3DXFont_PreloadText */
hr = D3DXCreateFontA(device, 12, 0, FW_DONTCARE, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Arial", &font);
if(SUCCEEDED(hr)) {
- const WCHAR testW[] = {'t','e','s','t',0};
-
todo_wine {
hr = ID3DXFont_PreloadTextA(font, NULL, -1);
ok(hr == D3DERR_INVALIDCALL, "ID3DXFont_PreloadTextA returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
@@ -552,7 +555,8 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
check_release((IUnknown*)font, 0);
} else skip("Failed to create a ID3DXFont object\n");
- for(i = 0; i < ARRAY_SIZE(texture_tests); i++) {
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
+ {
HDC hdc;
DWORD ret;
HRESULT hr;
@@ -560,7 +564,8 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
char c = 'a';
IDirect3DTexture9 *texture;
- hr = D3DXCreateFontA(device, texture_tests[i].font_height, 0, FW_DONTCARE, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Arial", &font);
+ hr = D3DXCreateFontA(device, tests[i].font_height, 0, FW_DONTCARE, 0, FALSE, DEFAULT_CHARSET,
+ OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, "Arial", &font);
if(FAILED(hr)) {
skip("Failed to create a ID3DXFont object\n");
continue;
@@ -578,17 +583,55 @@ static void test_ID3DXFont(IDirect3DDevice9 *device)
D3DSURFACE_DESC desc;
levels = IDirect3DTexture9_GetLevelCount(texture);
- ok(levels == texture_tests[i].expected_levels, "Got levels %u, expected %u\n", levels, texture_tests[i].expected_levels);
+ ok(levels == tests[i].expected_levels, "Got levels %u, expected %u\n",
+ levels, tests[i].expected_levels);
hr = IDirect3DTexture9_GetLevelDesc(texture, 0, &desc);
ok(hr == D3D_OK, "IDirect3DTexture9_GetLevelDesc failed\n");
ok(desc.Format == D3DFMT_A8R8G8B8, "Got format %#x, expected %#x\n", desc.Format, D3DFMT_A8R8G8B8);
ok(desc.Usage == 0, "Got usage %#x, expected %#x\n", desc.Usage, 0);
- ok(desc.Width == texture_tests[i].expected_size, "Got width %u, expected %u\n", desc.Width, texture_tests[i].expected_size);
- ok(desc.Height == texture_tests[i].expected_size, "Got height %u, expected %u\n", desc.Height, texture_tests[i].expected_size);
+ ok(desc.Width == tests[i].expected_size, "Got width %u, expected %u\n",
+ desc.Width, tests[i].expected_size);
+ ok(desc.Height == tests[i].expected_size, "Got height %u, expected %u\n",
+ desc.Height, tests[i].expected_size);
ok(desc.Pool == D3DPOOL_MANAGED, "Got pool %u, expected %u\n", desc.Pool, D3DPOOL_MANAGED);
IDirect3DTexture9_Release(texture);
}
+
+ /* ID3DXFontImpl_DrawText */
+ D3DXCreateSprite(device, &sprite);
+ SetRect(&rect, 0, 0, 640, 480);
+
+ IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 1.0f, 0);
+
+ IDirect3DDevice9_BeginScene(device);
+ hr = ID3DXSprite_Begin(sprite, D3DXSPRITE_ALPHABLEND);
+ ok (hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+
+ height = ID3DXFont_DrawTextW(font, sprite, testW, -1, &rect, DT_TOP, 0xffffffff);
+ ok(height == tests[i].font_height, "Got unexpected height %u.\n", height);
+ height = ID3DXFont_DrawTextW(font, sprite, testW, size, &rect, DT_TOP, 0xffffffff);
+ ok(height == tests[i].font_height, "Got unexpected height %u.\n", height);
+ height = ID3DXFont_DrawTextW(font, sprite, testW, size, &rect, DT_RIGHT, 0xffffffff);
+ ok(height == tests[i].font_height, "Got unexpected height %u.\n", height);
+ height = ID3DXFont_DrawTextW(font, sprite, testW, size, &rect, DT_LEFT | DT_NOCLIP,
+ 0xffffffff);
+ ok(height == tests[i].font_height, "Got unexpected height %u.\n", height);
+
+ SetRect(&rect, 0, 0, 0, 0);
+ height = ID3DXFont_DrawTextW(font, sprite, testW, size, &rect,
+ DT_LEFT | DT_CALCRECT, 0xffffffff);
+ ok(height == tests[i].font_height, "Got unexpected height %u.\n", height);
+ ok(!rect.left, "Got unexpected rect left %d.\n", rect.left);
+ ok(!rect.top, "Got unexpected rect top %d.\n", rect.top);
+ ok(rect.right, "Got unexpected rect right %d.\n", rect.right);
+ ok(rect.bottom == tests[i].font_height, "Got unexpected rect bottom %d.\n", rect.bottom);
+
+ hr = ID3DXSprite_End(sprite);
+ ok (hr == D3D_OK, "Got unexpected hr %#x.\n", hr);
+ IDirect3DDevice9_EndScene(device);
+ ID3DXSprite_Release(sprite);
+
ID3DXFont_Release(font);
}
}
--
2.16.1
June 14, 2018
[PATCH] urlmon/tests: Use the available ARRAY_SIZE() macro
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/urlmon/tests/misc.c | 66 +++++++++++++++++---------------------
dlls/urlmon/tests/protocol.c | 26 +++++++--------
dlls/urlmon/tests/sec_mgr.c | 20 ++++++------
dlls/urlmon/tests/uri.c | 76 ++++++++++++++++++++++----------------------
dlls/urlmon/tests/url.c | 2 +-
5 files changed, 91 insertions(+), 99 deletions(-)
diff --git a/dlls/urlmon/tests/misc.c b/dlls/urlmon/tests/misc.c
index e88c960497..ff0f24ed76 100644
--- a/dlls/urlmon/tests/misc.c
+++ b/dlls/urlmon/tests/misc.c
@@ -85,7 +85,7 @@ static HRESULT (WINAPI *pIEInstallScope)(DWORD*);
static int strcmp_wa(const WCHAR *strw, const char *stra)
{
WCHAR buf[512];
- MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, sizeof(buf)/sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, ARRAY_SIZE(buf));
return lstrcmpW(strw, buf);
}
@@ -367,23 +367,23 @@ static void test_CoInternetParseUrl(void)
3, &size, 0);
ok(hres == E_POINTER, "schema failed: %08x, expected E_POINTER\n", hres);
- for(i=0; i < sizeof(parse_tests)/sizeof(parse_tests[0]); i++) {
+ for(i = 0; i < ARRAY_SIZE(parse_tests); i++) {
memset(buf, 0xf0, sizeof(buf));
hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_SECURITY_URL, 0, buf,
- sizeof(buf)/sizeof(WCHAR), &size, 0);
+ ARRAY_SIZE(buf), &size, 0);
ok(hres == parse_tests[i].secur_hres, "[%d] security url failed: %08x, expected %08x\n",
i, hres, parse_tests[i].secur_hres);
memset(buf, 0xf0, sizeof(buf));
hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_ENCODE, 0, buf,
- sizeof(buf)/sizeof(WCHAR), &size, 0);
+ ARRAY_SIZE(buf), &size, 0);
ok(hres == S_OK, "[%d] encoding failed: %08x\n", i, hres);
ok(size == lstrlenW(parse_tests[i].encoded_url), "[%d] wrong size\n", i);
ok(!lstrcmpW(parse_tests[i].encoded_url, buf), "[%d] wrong encoded url\n", i);
memset(buf, 0xf0, sizeof(buf));
hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_PATH_FROM_URL, 0, buf,
- sizeof(buf)/sizeof(WCHAR), &size, 0);
+ ARRAY_SIZE(buf), &size, 0);
ok(hres == parse_tests[i].path_hres, "[%d] path failed: %08x, expected %08x\n",
i, hres, parse_tests[i].path_hres);
if(parse_tests[i].path) {
@@ -393,7 +393,7 @@ static void test_CoInternetParseUrl(void)
memset(buf, 0xf0, sizeof(buf));
hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_SCHEMA, 0, buf,
- sizeof(buf)/sizeof(WCHAR), &size, 0);
+ ARRAY_SIZE(buf), &size, 0);
ok(hres == S_OK, "[%d] schema failed: %08x\n", i, hres);
ok(size == lstrlenW(parse_tests[i].schema), "[%d] wrong size\n", i);
ok(!lstrcmpW(parse_tests[i].schema, buf), "[%d] wrong schema\n", i);
@@ -402,7 +402,7 @@ static void test_CoInternetParseUrl(void)
&& memcmp(parse_tests[i].url, wszAbout, 5*sizeof(WCHAR))) {
memset(buf, 0xf0, sizeof(buf));
hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_DOMAIN, 0, buf,
- sizeof(buf)/sizeof(WCHAR), &size, 0);
+ ARRAY_SIZE(buf), &size, 0);
ok(hres == parse_tests[i].domain_hres, "[%d] domain failed: %08x\n", i, hres);
if(parse_tests[i].domain)
ok(!lstrcmpW(parse_tests[i].domain, buf), "[%d] wrong domain, received %s\n", i, wine_dbgstr_w(buf));
@@ -410,7 +410,7 @@ static void test_CoInternetParseUrl(void)
memset(buf, 0xf0, sizeof(buf));
hres = pCoInternetParseUrl(parse_tests[i].url, PARSE_ROOTDOCUMENT, 0, buf,
- sizeof(buf)/sizeof(WCHAR), &size, 0);
+ ARRAY_SIZE(buf), &size, 0);
ok(hres == parse_tests[i].rootdocument_hres, "[%d] rootdocument failed: %08x\n", i, hres);
if(parse_tests[i].rootdocument)
ok(!lstrcmpW(parse_tests[i].rootdocument, buf), "[%d] wrong rootdocument, received %s\n", i, wine_dbgstr_w(buf));
@@ -451,7 +451,7 @@ static void test_CoInternetQueryInfo(void)
DWORD cb, i;
HRESULT hres;
- for(i=0; i < sizeof(query_info_tests)/sizeof(query_info_tests[0]); i++) {
+ for(i = 0; i < ARRAY_SIZE(query_info_tests); i++) {
cb = 0xdeadbeef;
memset(buf, '?', sizeof(buf));
hres = pCoInternetQueryInfo(query_info_tests[0].url, QUERY_USES_NETWORK, 0, buf, sizeof(buf), &cb, 0);
@@ -724,7 +724,7 @@ static void test_FindMimeFromData(void)
static const WCHAR text_htmlW[] = {'t','e','x','t','/','h','t','m','l',0};
static const WCHAR text_plainW[] = {'t','e','x','t','/','p','l','a','i','n',0};
- for(i=0; i<sizeof(mime_tests)/sizeof(mime_tests[0]); i++) {
+ for(i = 0; i < ARRAY_SIZE(mime_tests); i++) {
mime = (LPWSTR)0xf0f0f0f0;
url = a2w(mime_tests[i].url);
hres = pFindMimeFromData(NULL, url, NULL, 0, NULL, 0, &mime, 0);
@@ -757,7 +757,7 @@ static void test_FindMimeFromData(void)
heap_free(url);
}
- for(i=0; i < sizeof(mime_tests2)/sizeof(mime_tests2[0]); i++) {
+ for(i = 0; i < ARRAY_SIZE(mime_tests2); i++) {
url = a2w(mime_tests2[i].url);
proposed_mime = a2w(mime_tests2[i].proposed_mime);
hres = pFindMimeFromData(NULL, url, mime_tests2[i].data, mime_tests2[i].size,
@@ -879,9 +879,9 @@ static HRESULT WINAPI InternetProtocolInfo_ParseUrl(IInternetProtocolInfo *iface
if(ParseAction == PARSE_SECURITY_URL) {
if(pcchResult)
- *pcchResult = sizeof(url1)/sizeof(WCHAR);
+ *pcchResult = ARRAY_SIZE(url1);
- if(cchResult<sizeof(url1)/sizeof(WCHAR))
+ if(cchResult < ARRAY_SIZE(url1))
return S_FALSE;
memcpy(pwzResult, url1, sizeof(url1));
@@ -1032,8 +1032,7 @@ static void test_NameSpace(void)
SET_EXPECT(CreateInstance);
SET_EXPECT(ParseUrl);
- hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
- &size, 0);
+ hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, ARRAY_SIZE(buf), &size, 0);
ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
CHECK_CALLED(QI_IInternetProtocolInfo);
@@ -1044,8 +1043,7 @@ static void test_NameSpace(void)
SET_EXPECT(QI_IInternetProtocolInfo);
SET_EXPECT(ParseUrl);
- hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
- &size, 0);
+ hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, ARRAY_SIZE(buf), &size, 0);
ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
CHECK_CALLED(QI_IInternetProtocolInfo);
@@ -1054,11 +1052,10 @@ static void test_NameSpace(void)
SET_EXPECT(QI_IInternetProtocolInfo);
SET_EXPECT(ParseUrl);
- hres = pCoInternetParseUrl(url8, PARSE_SECURITY_URL, 0, buf,
- sizeof(buf)/sizeof(WCHAR), &size, 0);
+ hres = pCoInternetParseUrl(url8, PARSE_SECURITY_URL, 0, buf, ARRAY_SIZE(buf), &size, 0);
ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
- ok(size == sizeof(url1)/sizeof(WCHAR), "Size = %d\n", size);
- if(size == sizeof(url1)/sizeof(WCHAR))
+ ok(size == ARRAY_SIZE(url1), "Size = %d\n", size);
+ if(size == ARRAY_SIZE(url1))
ok(!memcmp(buf, url1, sizeof(url1)), "Encoded url = %s\n", wine_dbgstr_w(buf));
CHECK_CALLED(QI_IInternetProtocolInfo);
@@ -1071,7 +1068,7 @@ static void test_NameSpace(void)
hres = pCoInternetGetSecurityUrl(url8, &sec_url, PSU_SECURITY_URL_ONLY, 0);
ok(hres == S_OK, "CoInternetGetSecurityUrl failed: %08x\n", hres);
if(hres == S_OK) {
- ok(lstrlenW(sec_url)>sizeof(wszFile)/sizeof(WCHAR) &&
+ ok(lstrlenW(sec_url) > ARRAY_SIZE(wszFile) &&
!memcmp(sec_url, wszFile, sizeof(wszFile)-sizeof(WCHAR)),
"Encoded url = %s\n", wine_dbgstr_w(sec_url));
CoTaskMemFree(sec_url);
@@ -1084,8 +1081,7 @@ static void test_NameSpace(void)
hres = IInternetSession_UnregisterNameSpace(session, &test_protocol_cf, wszTest);
ok(hres == S_OK, "UnregisterNameSpace failed: %08x\n", hres);
- hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
- &size, 0);
+ hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, ARRAY_SIZE(buf), &size, 0);
ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
hres = IInternetSession_RegisterNameSpace(session, &test_protocol_cf2, &IID_NULL,
@@ -1103,8 +1099,7 @@ static void test_NameSpace(void)
SET_EXPECT(QI_IInternetProtocolInfo);
SET_EXPECT(ParseUrl);
- hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
- &size, 0);
+ hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, ARRAY_SIZE(buf), &size, 0);
ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
CHECK_CALLED(QI_IInternetProtocolInfo);
@@ -1116,8 +1111,7 @@ static void test_NameSpace(void)
SET_EXPECT(QI_IInternetProtocolInfo);
SET_EXPECT(ParseUrl);
- hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
- &size, 0);
+ hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, ARRAY_SIZE(buf), &size, 0);
ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
CHECK_CALLED(QI_IInternetProtocolInfo);
@@ -1130,8 +1124,7 @@ static void test_NameSpace(void)
SET_EXPECT(QI_IInternetProtocolInfo);
SET_EXPECT(ParseUrl);
- hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
- &size, 0);
+ hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, ARRAY_SIZE(buf), &size, 0);
ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
CHECK_CALLED(QI_IInternetProtocolInfo);
@@ -1149,8 +1142,7 @@ static void test_NameSpace(void)
hres = IInternetSession_UnregisterNameSpace(session, &test_protocol_cf2, wszTest);
ok(hres == S_OK, "UnregisterNameSpace failed: %08x\n", hres);
- hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, sizeof(buf)/sizeof(WCHAR),
- &size, 0);
+ hres = pCoInternetParseUrl(url8, PARSE_ENCODE, 0, buf, ARRAY_SIZE(buf), &size, 0);
ok(hres == S_OK, "CoInternetParseUrl failed: %08x\n", hres);
IInternetSession_Release(session);
@@ -1627,7 +1619,7 @@ static void test_MkParseDisplayNameEx(void)
CreateBindCtx(0, &bctx);
- for (i = 0; i < sizeof(invalid_parameters)/sizeof(invalid_parameters[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_parameters); i++)
{
eaten = 0xdeadbeef;
mon = (IMoniker *)0xdeadbeef;
@@ -1643,7 +1635,7 @@ static void test_MkParseDisplayNameEx(void)
hres = MkParseDisplayNameEx(bctx, url9, &eaten, &mon);
ok(hres == S_OK, "MkParseDisplayNameEx failed: %08x\n", hres);
- ok(eaten == sizeof(url9)/sizeof(WCHAR)-1, "eaten=%d\n", eaten);
+ ok(eaten == ARRAY_SIZE(url9)-1, "eaten=%d\n", eaten);
ok(mon != NULL, "mon == NULL\n");
hres = IMoniker_GetDisplayName(mon, NULL, 0, &name);
@@ -1659,7 +1651,7 @@ static void test_MkParseDisplayNameEx(void)
hres = MkParseDisplayNameEx(bctx, clsid_nameW, &eaten, &mon);
ok(hres == S_OK, "MkParseDisplayNameEx failed: %08x\n", hres);
- ok(eaten == sizeof(clsid_nameW)/sizeof(WCHAR)-1, "eaten=%d\n", eaten);
+ ok(eaten == ARRAY_SIZE(clsid_nameW)-1, "eaten=%d\n", eaten);
ok(mon != NULL, "mon == NULL\n");
hres = IMoniker_IsSystemMoniker(mon, &issys);
@@ -1733,7 +1725,7 @@ static void test_internet_feature_defaults(void) {
HRESULT hres;
DWORD i;
- for(i = 0; i < sizeof(default_feature_tests)/sizeof(default_feature_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(default_feature_tests); ++i) {
hres = pCoInternetIsFeatureEnabled(default_feature_tests[i].feature, default_feature_tests[i].get_flags);
todo_wine_if (default_feature_tests[i].todo)
ok(hres == default_feature_tests[i].expected, "CoInternetIsFeatureEnabled returned %08x, expected %08x on test %d\n",
@@ -1880,7 +1872,7 @@ static void test_CoInternetSetFeatureEnabled(void) {
hres = pCoInternetSetFeatureEnabled(FEATURE_ENTRY_COUNT,SET_FEATURE_ON_PROCESS,TRUE);
ok(hres == E_FAIL, "CoInternetSetFeatureEnabled returned %08x, expected E_FAIL\n", hres);
- for(i = 0; i < sizeof(internet_feature_tests)/sizeof(internet_feature_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(internet_feature_tests); ++i) {
hres = pCoInternetSetFeatureEnabled(internet_feature_tests[i].feature, internet_feature_tests[i].set_flags,
internet_feature_tests[i].enable);
todo_wine_if (internet_feature_tests[i].set_todo)
diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c
index 0ca8feebcb..999b591f5f 100644
--- a/dlls/urlmon/tests/protocol.c
+++ b/dlls/urlmon/tests/protocol.c
@@ -824,7 +824,7 @@ static HRESULT WINAPI ProtocolSink_ReportProgress(IInternetProtocolSink *iface,
if (winetest_debug > 1)
{
- if (ulStatusCode < sizeof(status_names)/sizeof(status_names[0]))
+ if (ulStatusCode < ARRAY_SIZE(status_names))
trace( "progress: %s %s\n", status_names[ulStatusCode], wine_dbgstr_w(szStatusText) );
else
trace( "progress: %u %s\n", ulStatusCode, wine_dbgstr_w(szStatusText) );
@@ -3051,55 +3051,55 @@ static void test_file_protocol(void) {
test_file_protocol_url(index_url);
memcpy(buf, wszFile, sizeof(wszFile));
- len = sizeof(wszFile)/sizeof(WCHAR)-1;
- len += GetCurrentDirectoryW(sizeof(buf)/sizeof(WCHAR)-len, buf+len);
+ len = ARRAY_SIZE(wszFile)-1;
+ len += GetCurrentDirectoryW(ARRAY_SIZE(buf)-len, buf+len);
buf[len++] = '\\';
memcpy(buf+len, wszIndexHtml, sizeof(wszIndexHtml));
- file_name = buf + sizeof(wszFile)/sizeof(WCHAR)-1;
+ file_name = buf + ARRAY_SIZE(wszFile)-1;
bindf = 0;
test_file_protocol_url(buf);
bindf = BINDF_FROMURLMON;
test_file_protocol_url(buf);
memcpy(buf, wszFile2, sizeof(wszFile2));
- len = GetCurrentDirectoryW(sizeof(file_name_buf)/sizeof(WCHAR), file_name_buf);
+ len = GetCurrentDirectoryW(ARRAY_SIZE(file_name_buf), file_name_buf);
file_name_buf[len++] = '\\';
memcpy(file_name_buf+len, wszIndexHtml, sizeof(wszIndexHtml));
- lstrcpyW(buf+sizeof(wszFile2)/sizeof(WCHAR)-1, file_name_buf);
+ lstrcpyW(buf+ARRAY_SIZE(wszFile2)-1, file_name_buf);
file_name = file_name_buf;
bindf = 0;
test_file_protocol_url(buf);
bindf = BINDF_FROMURLMON;
test_file_protocol_url(buf);
- buf[sizeof(wszFile2)/sizeof(WCHAR)] = '|';
+ buf[ARRAY_SIZE(wszFile2)] = '|';
test_file_protocol_url(buf);
memcpy(buf, wszFile3, sizeof(wszFile3));
- len = sizeof(wszFile3)/sizeof(WCHAR)-1;
- len += GetCurrentDirectoryW(sizeof(buf)/sizeof(WCHAR)-len, buf+len);
+ len = ARRAY_SIZE(wszFile3)-1;
+ len += GetCurrentDirectoryW(ARRAY_SIZE(buf)-len, buf+len);
buf[len++] = '\\';
memcpy(buf+len, wszIndexHtml, sizeof(wszIndexHtml));
- file_name = buf + sizeof(wszFile3)/sizeof(WCHAR)-1;
+ file_name = buf + ARRAY_SIZE(wszFile3)-1;
bindf = 0;
test_file_protocol_url(buf);
bindf = BINDF_FROMURLMON;
test_file_protocol_url(buf);
memcpy(buf, wszFile4, sizeof(wszFile4));
- len = GetCurrentDirectoryW(sizeof(file_name_buf)/sizeof(WCHAR), file_name_buf);
+ len = GetCurrentDirectoryW(ARRAY_SIZE(file_name_buf), file_name_buf);
file_name_buf[len++] = '\\';
memcpy(file_name_buf+len, wszIndexHtml, sizeof(wszIndexHtml));
- lstrcpyW(buf+sizeof(wszFile4)/sizeof(WCHAR)-1, file_name_buf);
+ lstrcpyW(buf+ARRAY_SIZE(wszFile4)-1, file_name_buf);
file_name = file_name_buf;
bindf = 0;
test_file_protocol_url(buf);
bindf = BINDF_FROMURLMON;
test_file_protocol_url(buf);
- buf[sizeof(wszFile4)/sizeof(WCHAR)] = '|';
+ buf[ARRAY_SIZE(wszFile4)] = '|';
test_file_protocol_url(buf);
/* Fragment part of URL is skipped if the file doesn't exist. */
diff --git a/dlls/urlmon/tests/sec_mgr.c b/dlls/urlmon/tests/sec_mgr.c
index 411a3b7781..2974eecc36 100644
--- a/dlls/urlmon/tests/sec_mgr.c
+++ b/dlls/urlmon/tests/sec_mgr.c
@@ -221,7 +221,7 @@ static LONG myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey)
dwMaxSubkeyLen++;
dwMaxValueLen++;
dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
- if (dwMaxLen > sizeof(szNameBuf)/sizeof(CHAR))
+ if (dwMaxLen > ARRAY_SIZE(szNameBuf))
{
/* Name too big: alloc a buffer for it */
if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(CHAR))))
@@ -381,7 +381,7 @@ static void test_SecurityManager(void)
if(FAILED(hres))
return;
- for(i=0; i < sizeof(secmgr_tests)/sizeof(secmgr_tests[0]); i++) {
+ for(i = 0; i < ARRAY_SIZE(secmgr_tests); i++) {
zone = 100;
hres = IInternetSecurityManager_MapUrlToZone(secmgr, secmgr_tests[i].url,
&zone, 0);
@@ -785,7 +785,7 @@ static BOOL register_zone_domains(void)
res = RegOpenKeyA(HKEY_CURRENT_USER, szZoneMapDomainsKey, &domains);
ok(res == ERROR_SUCCESS, "RegOpenKey failed: %d\n", res);
- for(i = 0; i < sizeof(zone_domain_mappings)/sizeof(zone_domain_mappings[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(zone_domain_mappings); ++i) {
const zone_domain_mapping *test = zone_domain_mappings+i;
HKEY domain;
@@ -830,7 +830,7 @@ static void unregister_zone_domains(void)
res = RegOpenKeyA(HKEY_CURRENT_USER, szZoneMapDomainsKey, &domains);
ok(res == ERROR_SUCCESS, "RegOpenKey failed: %d\n", res);
- for(i = 0; i < sizeof(zone_domain_mappings)/sizeof(zone_domain_mappings[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(zone_domain_mappings); ++i) {
const zone_domain_mapping *test = zone_domain_mappings+i;
/* FIXME: Uses the "cludge" approach to remove the test data from the registry!
@@ -936,7 +936,7 @@ static void test_zone_domain_mappings(void)
RegCloseKey(domains);
}
- for(i = 0; i < sizeof(zone_mapping_tests)/sizeof(zone_mapping_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(zone_mapping_tests); ++i) {
const zone_mapping_test *test = zone_mapping_tests+i;
LPWSTR urlW = a2w(test->url);
zone = URLZONE_INVALID;
@@ -1360,7 +1360,7 @@ static void test_InternetGetSecurityUrl(void)
trace("testing CoInternetGetSecurityUrl...\n");
- for(i=0; i<sizeof(in)/sizeof(WCHAR*); i++) {
+ for(i = 0; i < ARRAY_SIZE(in); i++) {
hres = pCoInternetGetSecurityUrl(in[i], &sec, PSU_DEFAULT, 0);
ok(hres == S_OK, "(%d) CoInternetGetSecurityUrl returned: %08x\n", i, hres);
if(hres == S_OK) {
@@ -1625,7 +1625,7 @@ static void test_InternetGetSecurityUrlEx(void)
ok(hr == E_INVALIDARG, "CoInternetGetSecurityUrlEx returned 0x%08x, expected E_INVALIDARG\n", hr);
ok(result == (void*) 0xdeadbeef, "'result' was %p\n", result);
- for(i = 0; i < sizeof(sec_url_ex_tests)/sizeof(sec_url_ex_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(sec_url_ex_tests); ++i) {
LPWSTR uriW = a2w(sec_url_ex_tests[i].uri);
uri = NULL;
@@ -1827,7 +1827,7 @@ static void test_SecurityManagerEx2(void)
IUri_Release(uri);
- for(i = 0; i < sizeof(sec_mgr_ex2_tests)/sizeof(sec_mgr_ex2_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(sec_mgr_ex2_tests); ++i) {
LPWSTR uriW = a2w(sec_mgr_ex2_tests[i].uri);
uri = NULL;
@@ -1925,7 +1925,7 @@ static void test_CoInternetIsFeatureZoneElevationEnabled(void)
trace("Testing CoInternetIsFeatureZoneElevationEnabled... (%x)\n", hres);
- for(i=0; i<sizeof(testcases)/sizeof(testcases[0]); i++) {
+ for(i = 0; i < ARRAY_SIZE(testcases); i++) {
if(hres==S_OK && testcases[i].flags == GET_FEATURE_FROM_PROCESS)
testcases[i].policy_flags = URLPOLICY_ALLOW;
}
@@ -1940,7 +1940,7 @@ static void test_CoInternetIsFeatureZoneElevationEnabled(void)
return;
}
- for(i=0; i<sizeof(testcases)/sizeof(testcases[0]); i++) {
+ for(i = 0; i < ARRAY_SIZE(testcases); i++) {
url_from = a2w(testcases[i].url_from);
url_to = a2w(testcases[i].url_to);
diff --git a/dlls/urlmon/tests/uri.c b/dlls/urlmon/tests/uri.c
index 90f51bf5dd..7580a1302d 100644
--- a/dlls/urlmon/tests/uri.c
+++ b/dlls/urlmon/tests/uri.c
@@ -7786,7 +7786,7 @@ static void change_property(IUriBuilder *builder, const uri_builder_property *pr
static void test_CreateUri_InvalidFlags(void) {
DWORD i;
- for(i = 0; i < sizeof(invalid_flag_tests)/sizeof(invalid_flag_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(invalid_flag_tests); ++i) {
HRESULT hr;
IUri *uri = (void*) 0xdeadbeef;
@@ -7825,7 +7825,7 @@ static void test_CreateUri_InvalidArgs(void) {
static void test_CreateUri_InvalidUri(void) {
DWORD i;
- for(i = 0; i < sizeof(invalid_uri_tests)/sizeof(invalid_uri_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(invalid_uri_tests); ++i) {
invalid_uri test = invalid_uri_tests[i];
IUri *uri = NULL;
LPWSTR uriW;
@@ -7877,7 +7877,7 @@ static void test_IUri_GetPropertyBSTR(void) {
}
if(uri) IUri_Release(uri);
- for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
uri_properties test = uri_tests[i];
LPWSTR uriW;
uri = NULL;
@@ -7937,7 +7937,7 @@ static void test_IUri_GetPropertyDWORD(void) {
}
if(uri) IUri_Release(uri);
- for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
uri_properties test = uri_tests[i];
LPWSTR uriW;
uri = NULL;
@@ -7952,7 +7952,7 @@ static void test_IUri_GetPropertyDWORD(void) {
DWORD j;
/* Checks all the DWORD properties of the uri. */
- for(j = 0; j < sizeof(test.dword_props)/sizeof(test.dword_props[0]); ++j) {
+ for(j = 0; j < ARRAY_SIZE(test.dword_props); ++j) {
DWORD received;
uri_dword_property prop = test.dword_props[j];
@@ -8029,7 +8029,7 @@ static void test_IUri_GetStrProperties(void) {
}
if(uri) IUri_Release(uri);
- for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
uri_properties test = uri_tests[i];
LPWSTR uriW;
uri = NULL;
@@ -8257,7 +8257,7 @@ static void test_IUri_GetDwordProperties(void) {
}
if(uri) IUri_Release(uri);
- for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
uri_properties test = uri_tests[i];
LPWSTR uriW;
uri = NULL;
@@ -8343,7 +8343,7 @@ static void test_IUri_GetPropertyLength(void) {
}
if(uri) IUri_Release(uri);
- for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
uri_properties test = uri_tests[i];
LPWSTR uriW;
uri = NULL;
@@ -8426,7 +8426,7 @@ static void test_IUri_GetProperties(void) {
}
if(uri) IUri_Release(uri);
- for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
uri_properties test = uri_tests[i];
LPWSTR uriW;
uri = NULL;
@@ -8475,7 +8475,7 @@ static void test_IUri_HasProperty(void) {
}
if(uri) IUri_Release(uri);
- for(i = 0; i < sizeof(uri_tests)/sizeof(uri_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_tests); ++i) {
uri_properties test = uri_tests[i];
LPWSTR uriW;
uri = NULL;
@@ -8540,7 +8540,7 @@ static void test_IUri_IsEqual(void) {
IUri_Release(uriA);
IUri_Release(uriB);
- for(i = 0; i < sizeof(equality_tests)/sizeof(equality_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(equality_tests); ++i) {
uri_equality test = equality_tests[i];
LPWSTR uriA_W, uriB_W;
@@ -8592,7 +8592,7 @@ static void test_CreateUriWithFragment_InvalidArgs(void) {
static void test_CreateUriWithFragment_InvalidFlags(void) {
DWORD i;
- for(i = 0; i < sizeof(invalid_flag_tests)/sizeof(invalid_flag_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(invalid_flag_tests); ++i) {
HRESULT hr;
IUri *uri = (void*) 0xdeadbeef;
@@ -8606,7 +8606,7 @@ static void test_CreateUriWithFragment_InvalidFlags(void) {
static void test_CreateUriWithFragment(void) {
DWORD i;
- for(i = 0; i < sizeof(uri_fragment_tests)/sizeof(uri_fragment_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_fragment_tests); ++i) {
HRESULT hr;
IUri *uri = NULL;
LPWSTR uriW, fragW;
@@ -8685,7 +8685,7 @@ static void test_IUriBuilder_CreateUri(IUriBuilder *builder, const uri_builder_t
if(SUCCEEDED(hr)) {
DWORD i;
- for(i = 0; i < sizeof(test->expected_str_props)/sizeof(test->expected_str_props[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->expected_str_props); ++i) {
uri_builder_str_property prop = test->expected_str_props[i];
BSTR received = NULL;
@@ -8703,7 +8703,7 @@ static void test_IUriBuilder_CreateUri(IUriBuilder *builder, const uri_builder_t
SysFreeString(received);
}
- for(i = 0; i < sizeof(test->expected_dword_props)/sizeof(test->expected_dword_props[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->expected_dword_props); ++i) {
uri_builder_dword_property prop = test->expected_dword_props[i];
DWORD received = -2;
@@ -8737,7 +8737,7 @@ static void test_IUriBuilder_CreateUriSimple(IUriBuilder *builder, const uri_bui
if(SUCCEEDED(hr)) {
DWORD i;
- for(i = 0; i < sizeof(test->expected_str_props)/sizeof(test->expected_str_props[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->expected_str_props); ++i) {
uri_builder_str_property prop = test->expected_str_props[i];
BSTR received = NULL;
@@ -8755,7 +8755,7 @@ static void test_IUriBuilder_CreateUriSimple(IUriBuilder *builder, const uri_bui
SysFreeString(received);
}
- for(i = 0; i < sizeof(test->expected_dword_props)/sizeof(test->expected_dword_props[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->expected_dword_props); ++i) {
uri_builder_dword_property prop = test->expected_dword_props[i];
DWORD received = -2;
@@ -8790,7 +8790,7 @@ static void test_IUriBuilder_CreateUriWithFlags(IUriBuilder *builder, const uri_
if(SUCCEEDED(hr)) {
DWORD i;
- for(i = 0; i < sizeof(test->expected_str_props)/sizeof(test->expected_str_props[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->expected_str_props); ++i) {
uri_builder_str_property prop = test->expected_str_props[i];
BSTR received = NULL;
@@ -8808,7 +8808,7 @@ static void test_IUriBuilder_CreateUriWithFlags(IUriBuilder *builder, const uri_
SysFreeString(received);
}
- for(i = 0; i < sizeof(test->expected_dword_props)/sizeof(test->expected_dword_props[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->expected_dword_props); ++i) {
uri_builder_dword_property prop = test->expected_dword_props[i];
DWORD received = -2;
@@ -9051,7 +9051,7 @@ static void test_IUriBuilder_GetFragment(IUriBuilder *builder, const uri_builder
const uri_builder_property *prop = NULL;
/* Check if the property was set earlier. */
- for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_FRAGMENT)
prop = &(test->properties[i]);
}
@@ -9146,7 +9146,7 @@ static void test_IUriBuilder_GetHost(IUriBuilder *builder, const uri_builder_tes
const uri_builder_property *prop = NULL;
/* Check if the property was set earlier. */
- for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_HOST)
prop = &(test->properties[i]);
}
@@ -9241,7 +9241,7 @@ static void test_IUriBuilder_GetPassword(IUriBuilder *builder, const uri_builder
const uri_builder_property *prop = NULL;
/* Check if the property was set earlier. */
- for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_PASSWORD)
prop = &(test->properties[i]);
}
@@ -9336,7 +9336,7 @@ static void test_IUriBuilder_GetPath(IUriBuilder *builder, const uri_builder_tes
const uri_builder_property *prop = NULL;
/* Check if the property was set earlier. */
- for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_PATH)
prop = &(test->properties[i]);
}
@@ -9498,7 +9498,7 @@ static void test_IUriBuilder_GetQuery(IUriBuilder *builder, const uri_builder_te
const uri_builder_property *prop = NULL;
/* Check if the property was set earlier. */
- for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_QUERY)
prop = &(test->properties[i]);
}
@@ -9593,7 +9593,7 @@ static void test_IUriBuilder_GetSchemeName(IUriBuilder *builder, const uri_build
const uri_builder_property *prop = NULL;
/* Check if the property was set earlier. */
- for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_SCHEME_NAME)
prop = &(test->properties[i]);
}
@@ -9688,7 +9688,7 @@ static void test_IUriBuilder_GetUserName(IUriBuilder *builder, const uri_builder
const uri_builder_property *prop = NULL;
/* Check if the property was set earlier. */
- for(i = 0; i < sizeof(test->properties)/sizeof(test->properties[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(test->properties); ++i) {
if(test->properties[i].change && test->properties[i].property == Uri_PROPERTY_USER_NAME)
prop = &(test->properties[i]);
}
@@ -9780,7 +9780,7 @@ static void test_IUriBuilder(void) {
IUriBuilder *builder;
DWORD i;
- for(i = 0; i < sizeof(uri_builder_tests)/sizeof(uri_builder_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_builder_tests); ++i) {
IUri *uri = NULL;
uri_builder_test test = uri_builder_tests[i];
LPWSTR uriW = NULL;
@@ -10132,7 +10132,7 @@ static void test_IUriBuilder_RemoveProperties(void) {
}
if(builder) IUriBuilder_Release(builder);
- for(i = 0; i < sizeof(uri_builder_remove_tests)/sizeof(uri_builder_remove_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_builder_remove_tests); ++i) {
uri_builder_remove_test test = uri_builder_remove_tests[i];
IUri *uri = NULL;
LPWSTR uriW;
@@ -10328,7 +10328,7 @@ static void test_CoInternetCombineIUri(void) {
if(base) IUri_Release(base);
if(relative) IUri_Release(relative);
- for(i = 0; i < sizeof(uri_combine_tests)/sizeof(uri_combine_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_combine_tests); ++i) {
LPWSTR baseW = a2w(uri_combine_tests[i].base_uri);
hr = pCreateUri(baseW, uri_combine_tests[i].base_create_flags, 0, &base);
@@ -10349,7 +10349,7 @@ static void test_CoInternetCombineIUri(void) {
if(SUCCEEDED(hr)) {
DWORD j;
- for(j = 0; j < sizeof(uri_combine_tests[i].str_props)/sizeof(uri_combine_tests[i].str_props[0]); ++j) {
+ for(j = 0; j < ARRAY_SIZE(uri_combine_tests[i].str_props); ++j) {
uri_combine_str_property prop = uri_combine_tests[i].str_props[j];
BSTR received;
@@ -10366,7 +10366,7 @@ static void test_CoInternetCombineIUri(void) {
SysFreeString(received);
}
- for(j = 0; j < sizeof(uri_combine_tests[i].dword_props)/sizeof(uri_combine_tests[i].dword_props[0]); ++j) {
+ for(j = 0; j < ARRAY_SIZE(uri_combine_tests[i].dword_props); ++j) {
uri_dword_property prop = uri_combine_tests[i].dword_props[j];
DWORD received;
@@ -10619,7 +10619,7 @@ static void test_CoInternetCombineUrlEx(void) {
hr, E_POINTER);
if(base) IUri_Release(base);
- for(i = 0; i < sizeof(uri_combine_tests)/sizeof(uri_combine_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_combine_tests); ++i) {
LPWSTR baseW = a2w(uri_combine_tests[i].base_uri);
hr = pCreateUri(baseW, uri_combine_tests[i].base_create_flags, 0, &base);
@@ -10636,7 +10636,7 @@ static void test_CoInternetCombineUrlEx(void) {
if(SUCCEEDED(hr)) {
DWORD j;
- for(j = 0; j < sizeof(uri_combine_tests[i].str_props)/sizeof(uri_combine_tests[i].str_props[0]); ++j) {
+ for(j = 0; j < ARRAY_SIZE(uri_combine_tests[i].str_props); ++j) {
uri_combine_str_property prop = uri_combine_tests[i].str_props[j];
BSTR received;
LPCSTR value = (prop.value_ex) ? prop.value_ex : prop.value;
@@ -10654,7 +10654,7 @@ static void test_CoInternetCombineUrlEx(void) {
SysFreeString(received);
}
- for(j = 0; j < sizeof(uri_combine_tests[i].dword_props)/sizeof(uri_combine_tests[i].dword_props[0]); ++j) {
+ for(j = 0; j < ARRAY_SIZE(uri_combine_tests[i].dword_props); ++j) {
uri_dword_property prop = uri_combine_tests[i].dword_props[j];
DWORD received;
@@ -10776,7 +10776,7 @@ static void test_CoInternetParseIUri_InvalidArgs(void) {
len = INTERNET_MAX_URL_LENGTH*2;
longurl = heap_alloc((len+1)*sizeof(WCHAR));
memcpy(longurl, http_urlW, sizeof(http_urlW));
- for(i = sizeof(http_urlW)/sizeof(WCHAR)-1; i < len; i++)
+ for(i = ARRAY_SIZE(http_urlW)-1; i < len; i++)
longurl[i] = 'x';
longurl[len] = 0;
@@ -10803,7 +10803,7 @@ static void test_CoInternetParseIUri_InvalidArgs(void) {
static void test_CoInternetParseIUri(void) {
DWORD i;
- for(i = 0; i < sizeof(uri_parse_tests)/sizeof(uri_parse_tests[0]); ++i) {
+ for(i = 0; i < ARRAY_SIZE(uri_parse_tests); ++i) {
HRESULT hr;
IUri *uri;
LPWSTR uriW;
@@ -11001,7 +11001,7 @@ static void test_CreateURLMoniker(void)
IUri *uri, *base_uri;
HRESULT hres;
- for(test = create_urlmon_tests; test < create_urlmon_tests + sizeof(create_urlmon_tests)/sizeof(*create_urlmon_tests); test++) {
+ for(test = create_urlmon_tests; test < create_urlmon_tests + ARRAY_SIZE(create_urlmon_tests); test++) {
url = a2w(test->url);
base_url = a2w(test->base_url);
@@ -11100,7 +11100,7 @@ static void test_IPersistStream(void)
props_order[Uri_PROPERTY_SCHEME_NAME] = 8;
props_order[Uri_PROPERTY_USER_NAME] = 9;
- for(i=0; i<sizeof(uri_tests)/sizeof(*uri_tests); i++) {
+ for(i = 0; i < ARRAY_SIZE(uri_tests); i++) {
const uri_properties *test = uri_tests+i;
LPWSTR uriW;
IUri *uri;
diff --git a/dlls/urlmon/tests/url.c b/dlls/urlmon/tests/url.c
index 8da0fd8256..893632fd2e 100644
--- a/dlls/urlmon/tests/url.c
+++ b/dlls/urlmon/tests/url.c
@@ -2901,7 +2901,7 @@ static void init_bind_test(int protocol, DWORD flags, DWORD t)
}
if(url_a)
- MultiByteToWideChar(CP_ACP, 0, url_a, -1, current_url, sizeof(current_url)/sizeof(*current_url));
+ MultiByteToWideChar(CP_ACP, 0, url_a, -1, current_url, ARRAY_SIZE(current_url));
test_redirect = (flags & BINDTEST_REDIRECT) != 0;
use_cache_file = (flags & BINDTEST_USE_CACHE) != 0;
--
2.14.4
June 14, 2018
[PATCH] shell32/tests: Use the available ARRAY_SIZE() macro
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/shell32/tests/autocomplete.c | 4 ++--
dlls/shell32/tests/shelldispatch.c | 14 +++++++-------
dlls/shell32/tests/shelllink.c | 2 +-
dlls/shell32/tests/shellole.c | 2 +-
dlls/shell32/tests/shellpath.c | 4 ++--
dlls/shell32/tests/shlexec.c | 14 +++++++-------
dlls/shell32/tests/string.c | 8 ++++----
7 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/dlls/shell32/tests/autocomplete.c b/dlls/shell32/tests/autocomplete.c
index 859734ce59..1c51e5179f 100644
--- a/dlls/shell32/tests/autocomplete.c
+++ b/dlls/shell32/tests/autocomplete.c
@@ -369,7 +369,7 @@ static void test_custom_source(void)
hr = CoCreateInstance(&CLSID_AutoComplete, NULL, CLSCTX_INPROC_SERVER, &IID_IAutoComplete2, (void**)&autocomplete);
ok(hr == S_OK, "CoCreateInstance failed: %x\n", hr);
- string_enumerator_create((void**)&enumerator, suggestions, sizeof(suggestions) / sizeof(*suggestions));
+ string_enumerator_create((void**)&enumerator, suggestions, ARRAY_SIZE(suggestions));
hr = IAutoComplete2_SetOptions(autocomplete, ACO_AUTOSUGGEST | ACO_AUTOAPPEND);
ok(hr == S_OK, "IAutoComplete2_SetOptions failed: %x\n", hr);
@@ -385,7 +385,7 @@ static void test_custom_source(void)
TranslateMessage(&msg);
DispatchMessageA(&msg);
}
- SendMessageW(hwnd_edit, WM_GETTEXT, sizeof(buffer) / sizeof(*buffer), (LPARAM)buffer);
+ SendMessageW(hwnd_edit, WM_GETTEXT, ARRAY_SIZE(buffer), (LPARAM)buffer);
ok(lstrcmpW(str_beta, buffer) == 0, "Expected %s, got %s\n", wine_dbgstr_w(str_beta), wine_dbgstr_w(buffer));
ShowWindow(hMainWnd, SW_HIDE);
diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c
index ed109a9e17..30c8291f58 100644
--- a/dlls/shell32/tests/shelldispatch.c
+++ b/dlls/shell32/tests/shelldispatch.c
@@ -161,7 +161,7 @@ static void test_namespace(void)
ok(folder == NULL, "expected NULL, got %p\n", folder);
/* test valid folder ids */
- for (i = 0; i < sizeof(special_folders)/sizeof(special_folders[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(special_folders); i++)
{
V_VT(&var) = VT_I4;
V_I4(&var) = special_folders[i];
@@ -474,7 +474,7 @@ static void test_items(void)
ok(!item, "item is not null\n");
/* create test files */
- for (i = 0; i < sizeof(file_defs)/sizeof(file_defs[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(file_defs); i++)
{
switch (file_defs[i].type)
{
@@ -605,7 +605,7 @@ static void test_items(void)
V_VT(&int_index) = VT_I4;
/* test the folder item corresponding to each file */
- for (i = 0; i < sizeof(file_defs)/sizeof(file_defs[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(file_defs); i++)
{
VARIANT_BOOL b;
BSTR name;
@@ -729,7 +729,7 @@ static void test_items(void)
}
/* test that there are only as many folder items as there were files */
- V_I4(&int_index) = sizeof(file_defs)/sizeof(file_defs[0]);
+ V_I4(&int_index) = ARRAY_SIZE(file_defs);
item = (FolderItem*)0xdeadbeef;
r = FolderItems_Item(items, int_index, &item);
ok(r == S_FALSE, "expected S_FALSE, got %08x\n", r);
@@ -975,7 +975,7 @@ if (0) /* crashes on pre-vista */ {
IShellView_Release(view);
/* Try with some other folder, that's not a desktop */
- GetTempPathW(sizeof(pathW)/sizeof(pathW[0]), pathW);
+ GetTempPathW(ARRAY_SIZE(pathW), pathW);
hr = IShellFolder_ParseDisplayName(desktop, NULL, NULL, pathW, NULL, &pidl, NULL);
ok(hr == S_OK, "got 0x%08x\n", hr);
@@ -1218,7 +1218,7 @@ static void test_ParseName(void)
&IID_IShellDispatch, (void**)&sd);
ok(hr == S_OK, "got 0x%08x\n", hr);
- GetTempPathW(sizeof(pathW)/sizeof(pathW[0]), pathW);
+ GetTempPathW(ARRAY_SIZE(pathW), pathW);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = SysAllocString(pathW);
hr = IShellDispatch_NameSpace(sd, v, &folder);
@@ -1287,7 +1287,7 @@ static void test_Verbs(void)
&IID_IShellDispatch, (void**)&sd);
ok(hr == S_OK, "got 0x%08x\n", hr);
- GetTempPathW(sizeof(pathW)/sizeof(pathW[0]), pathW);
+ GetTempPathW(ARRAY_SIZE(pathW), pathW);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = SysAllocString(pathW);
hr = IShellDispatch_NameSpace(sd, v, &folder);
diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c
index 1e07090dc4..65e9a6dd55 100644
--- a/dlls/shell32/tests/shelllink.c
+++ b/dlls/shell32/tests/shelllink.c
@@ -1287,7 +1287,7 @@ if (0)
ok(hicon == NULL, "Got icon %p\n", hicon);
/* Create a temporary non-executable file */
- GetTempPathW(sizeof(pathW)/sizeof(pathW[0]), pathW);
+ GetTempPathW(ARRAY_SIZE(pathW), pathW);
lstrcatW(pathW, nameW);
file = CreateFileW(pathW, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
ok(file != INVALID_HANDLE_VALUE, "Failed to create a test file\n");
diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c
index 4144f18155..4b91302a15 100644
--- a/dlls/shell32/tests/shellole.c
+++ b/dlls/shell32/tests/shellole.c
@@ -869,7 +869,7 @@ static void test_SHCreateSessionKey(void)
HKEY hkey, hkey2;
HRESULT hr;
DWORD session;
- WCHAR sessionW[(sizeof(session_format)/sizeof(WCHAR)) + 16];
+ WCHAR sessionW[ARRAY_SIZE(session_format) + 16];
LONG ret;
if (!pSHCreateSessionKey)
diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c
index 613c4eb15d..505da2778e 100644
--- a/dlls/shell32/tests/shellpath.c
+++ b/dlls/shell32/tests/shellpath.c
@@ -114,7 +114,7 @@ static const BYTE printersType[] = { PT_YAGUID, PT_SHELLEXT, 0x71 };
static const BYTE ieSpecialType[] = { PT_IESPECIAL2 };
static const BYTE shellExtType[] = { PT_SHELLEXT };
static const BYTE workgroupType[] = { PT_WORKGRP };
-#define DECLARE_TYPE(x, y) { x, sizeof(y) / sizeof(y[0]), y }
+#define DECLARE_TYPE(x, y) { x, ARRAY_SIZE(y), y }
static const struct shellExpectedValues requiredShellValues[] = {
DECLARE_TYPE(CSIDL_BITBUCKET, guidType),
DECLARE_TYPE(CSIDL_CONTROLS, controlPanelType),
@@ -2545,7 +2545,7 @@ static void test_DoEnvironmentSubst(void)
"%HOMEDRIVE%%HOMEPATH%",
"%OS% %windir%"}; /* always the last entry in the table */
- for (i = 0; i < (sizeof(names)/sizeof(LPSTR)); i++)
+ for (i = 0; i < (ARRAY_SIZE(names)); i++)
{
memset(bufferA, '#', MAX_PATH - 1);
bufferA[MAX_PATH - 1] = 0;
diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index 7cdae878db..c67cc46a46 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -758,7 +758,7 @@ static LSTATUS myRegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey)
dwMaxSubkeyLen++;
dwMaxValueLen++;
dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
- if (dwMaxLen > sizeof(szNameBuf)/sizeof(CHAR))
+ if (dwMaxLen > ARRAY_SIZE(szNameBuf))
{
/* Name too big: alloc a buffer for it */
if (!(lpszName = heap_alloc(dwMaxLen*sizeof(CHAR))))
@@ -1329,7 +1329,7 @@ static BOOL test_one_cmdline(const cmdline_tests_t* test)
int i, count;
/* trace("----- cmd='%s'\n", test->cmd); */
- MultiByteToWideChar(CP_ACP, 0, test->cmd, -1, cmdW, sizeof(cmdW)/sizeof(*cmdW));
+ MultiByteToWideChar(CP_ACP, 0, test->cmd, -1, cmdW, ARRAY_SIZE(cmdW));
argsW = cl2a = CommandLineToArgvW(cmdW, &cl2a_count);
if (argsW == NULL && cl2a_count == -1)
{
@@ -1349,7 +1349,7 @@ static BOOL test_one_cmdline(const cmdline_tests_t* test)
{
if (i < count)
{
- MultiByteToWideChar(CP_ACP, 0, test->args[i], -1, argW, sizeof(argW)/sizeof(*argW));
+ MultiByteToWideChar(CP_ACP, 0, test->args[i], -1, argW, ARRAY_SIZE(argW));
todo_wine_if(test->todo & (1 << (i+4)))
ok(!lstrcmpW(*argsW, argW), "%s: arg[%d] expected %s but got %s\n", test->cmd, i, wine_dbgstr_w(argW), wine_dbgstr_w(*argsW));
}
@@ -1395,7 +1395,7 @@ static void test_commandline2argv(void)
"expected NULL-terminated list of commandline arguments\n");
if (numargs == 1)
{
- GetModuleFileNameW(NULL, strW, sizeof(strW)/sizeof(*strW));
+ GetModuleFileNameW(NULL, strW, ARRAY_SIZE(strW));
ok(!lstrcmpW(args[0], strW), "wrong path to the current executable: %s instead of %s\n", wine_dbgstr_w(args[0]), wine_dbgstr_w(strW));
}
if (args) LocalFree(args);
@@ -1859,7 +1859,7 @@ static void test_fileurls(void)
return;
}
- get_long_path_name(tmpdir, longtmpdir, sizeof(longtmpdir)/sizeof(*longtmpdir));
+ get_long_path_name(tmpdir, longtmpdir, ARRAY_SIZE(longtmpdir));
SetEnvironmentVariableA("urlprefix", "file:///");
test=fileurl_tests;
@@ -2779,7 +2779,7 @@ static void init_test(void)
/* Setup the test shortcuts */
sprintf(filename, "%s\\test_shortcut_shlexec.lnk", tmpdir);
- MultiByteToWideChar(CP_ACP, 0, filename, -1, lnkfile, sizeof(lnkfile)/sizeof(*lnkfile));
+ MultiByteToWideChar(CP_ACP, 0, filename, -1, lnkfile, ARRAY_SIZE(lnkfile));
desc.description=NULL;
desc.workdir=NULL;
sprintf(filename, "%s\\test file.shlexec", tmpdir);
@@ -2793,7 +2793,7 @@ static void init_test(void)
create_lnk(lnkfile, &desc, 0);
sprintf(filename, "%s\\test_shortcut_exe.lnk", tmpdir);
- MultiByteToWideChar(CP_ACP, 0, filename, -1, lnkfile, sizeof(lnkfile)/sizeof(*lnkfile));
+ MultiByteToWideChar(CP_ACP, 0, filename, -1, lnkfile, ARRAY_SIZE(lnkfile));
desc.description=NULL;
desc.workdir=NULL;
desc.path=argv0;
diff --git a/dlls/shell32/tests/string.c b/dlls/shell32/tests/string.c
index 6cdb386eba..5fd589300b 100644
--- a/dlls/shell32/tests/string.c
+++ b/dlls/shell32/tests/string.c
@@ -67,14 +67,14 @@ static void test_StrRetToStringNW(void)
strret.uType = STRRET_WSTR;
U(strret).pOleStr = CoDupStrW("Test");
memset(buff, 0xff, sizeof(buff));
- ret = pStrRetToStrNAW(buff, sizeof(buff)/sizeof(WCHAR), &strret, NULL);
+ ret = pStrRetToStrNAW(buff, ARRAY_SIZE(buff), &strret, NULL);
ok(ret == TRUE && !strcmpW(buff, szTestW),
"STRRET_WSTR: dup failed, ret=%d\n", ret);
strret.uType = STRRET_CSTR;
lstrcpyA(U(strret).cStr, "Test");
memset(buff, 0xff, sizeof(buff));
- ret = pStrRetToStrNAW(buff, sizeof(buff)/sizeof(WCHAR), &strret, NULL);
+ ret = pStrRetToStrNAW(buff, ARRAY_SIZE(buff), &strret, NULL);
ok(ret == TRUE && !strcmpW(buff, szTestW),
"STRRET_CSTR: dup failed, ret=%d\n", ret);
@@ -82,7 +82,7 @@ static void test_StrRetToStringNW(void)
U(strret).uOffset = 1;
strcpy((char*)&iidl, " Test");
memset(buff, 0xff, sizeof(buff));
- ret = pStrRetToStrNAW(buff, sizeof(buff)/sizeof(WCHAR), &strret, iidl);
+ ret = pStrRetToStrNAW(buff, ARRAY_SIZE(buff), &strret, iidl);
ok(ret == TRUE && !strcmpW(buff, szTestW),
"STRRET_OFFSET: dup failed, ret=%d\n", ret);
@@ -92,7 +92,7 @@ if (0)
/* Invalid dest - should return FALSE, except NT4 does not, so we don't check. */
strret.uType = STRRET_WSTR;
U(strret).pOleStr = CoDupStrW("Test");
- pStrRetToStrNAW(NULL, sizeof(buff)/sizeof(WCHAR), &strret, NULL);
+ pStrRetToStrNAW(NULL, ARRAY_SIZE(buff), &strret, NULL);
trace("NULL dest: ret=%d\n", ret);
}
}
--
2.14.4
June 14, 2018
[PATCH] shell32/tests: Avoid sizeof in a trace
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/shell32/tests/shelldispatch.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c
index cc00757840..ed109a9e17 100644
--- a/dlls/shell32/tests/shelldispatch.c
+++ b/dlls/shell32/tests/shelldispatch.c
@@ -541,8 +541,7 @@ static void test_items(void)
count = -1;
r = FolderItems_get_Count(items, &count);
ok(r == S_OK, "FolderItems::get_Count failed: %08x\n", r);
- ok(count == sizeof(file_defs)/sizeof(file_defs[0]),
- "expected %d files, got %d\n", (LONG)(sizeof(file_defs)/sizeof(file_defs[0])), count);
+ ok(count == ARRAY_SIZE(file_defs), "got %d files\n", count);
V_VT(&var) = VT_EMPTY;
item = (FolderItem*)0xdeadbeef;
--
2.14.4
June 14, 2018
[PATCH] setupapi/tests: Use the available ARRAY_SIZE() macro
by Michael Stefaniuc
Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org>
---
dlls/setupapi/tests/devinst.c | 4 ++--
dlls/setupapi/tests/misc.c | 4 ++--
dlls/setupapi/tests/parser.c | 8 ++++----
dlls/setupapi/tests/setupcab.c | 20 +++++++++-----------
4 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c
index 4df00b1855..420c65a142 100644
--- a/dlls/setupapi/tests/devinst.c
+++ b/dlls/setupapi/tests/devinst.c
@@ -121,7 +121,7 @@ static LSTATUS devinst_RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey)
dwMaxSubkeyLen++;
dwMaxValueLen++;
dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen);
- if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR))
+ if (dwMaxLen > ARRAY_SIZE(szNameBuf))
{
/* Name too big: alloc a buffer for it */
if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR))))
@@ -1259,7 +1259,7 @@ static void testSetupDiGetINFClassA(void)
retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count);
ok(!retval, "expected SetupDiGetINFClassA to fail!\n");
- for(i=0; i < sizeof(signatures)/sizeof(char*); i++)
+ for(i=0; i < ARRAY_SIZE(signatures); i++)
{
trace("testing signature %s\n", signatures[i]);
h = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
diff --git a/dlls/setupapi/tests/misc.c b/dlls/setupapi/tests/misc.c
index dbe684bb29..9143cd4bd3 100644
--- a/dlls/setupapi/tests/misc.c
+++ b/dlls/setupapi/tests/misc.c
@@ -594,7 +594,7 @@ static void test_SetupDecompressOrCopyFile(void)
create_source_file(source, uncompressed, sizeof(uncompressed));
- for (i = 0; i < sizeof(invalid_parameters)/sizeof(invalid_parameters[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_parameters); i++)
{
type = FILE_COMPRESSION_NONE;
ret = SetupDecompressOrCopyFileA(invalid_parameters[i].source,
@@ -697,7 +697,7 @@ static void test_SetupDecompressOrCopyFile(void)
p = strrchr(target, '\\');
- for (i = 0; i < sizeof(zip_multi_tests)/sizeof(zip_multi_tests[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(zip_multi_tests); i++)
{
lstrcpyA(p + 1, zip_multi_tests[i].filename);
diff --git a/dlls/setupapi/tests/parser.c b/dlls/setupapi/tests/parser.c
index 67c9887a61..f8d2c5de1c 100644
--- a/dlls/setupapi/tests/parser.c
+++ b/dlls/setupapi/tests/parser.c
@@ -154,7 +154,7 @@ static void test_invalid_files(void)
HINF hinf;
DWORD err;
- for (i = 0; i < sizeof(invalid_files)/sizeof(invalid_files[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_files); i++)
{
SetLastError( 0xdeadbeef );
err_line = 0xdeadbeef;
@@ -229,7 +229,7 @@ static void test_section_names(void)
DWORD err;
LONG ret;
- for (i = 0; i < sizeof(section_names)/sizeof(section_names[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(section_names); i++)
{
SetLastError( 0xdeadbeef );
hinf = test_file_contents( section_names[i].data, &err_line );
@@ -418,7 +418,7 @@ static void test_key_names(void)
BOOL ret;
INFCONTEXT context;
- for (i = 0; i < sizeof(key_names)/sizeof(key_names[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(key_names); i++)
{
strcpy( buffer, STD_HEADER "[Test]\n" );
strcat( buffer, key_names[i].data );
@@ -622,7 +622,7 @@ static void test_SetupGetIntField(void)
};
unsigned int i;
- for (i = 0; i < sizeof(keys)/sizeof(keys[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(keys); i++)
{
HINF hinf;
char buffer[MAX_INF_STRING_LENGTH];
diff --git a/dlls/setupapi/tests/setupcab.c b/dlls/setupapi/tests/setupcab.c
index 33daae922b..bb9add035d 100644
--- a/dlls/setupapi/tests/setupcab.c
+++ b/dlls/setupapi/tests/setupcab.c
@@ -109,7 +109,7 @@ static void test_invalid_parametersA(void)
create_source_fileA(source, NULL, 0);
- for (i = 0; i < sizeof(invalid_parameters)/sizeof(invalid_parameters[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_parameters); i++)
{
SetLastError(0xdeadbeef);
ret = SetupIterateCabinetA(invalid_parameters[i].CabinetFile, 0,
@@ -170,12 +170,12 @@ static void test_invalid_parametersW(void)
return;
}
- GetTempPathW(sizeof(temp)/sizeof(WCHAR), temp);
+ GetTempPathW(ARRAY_SIZE(temp), temp);
GetTempFileNameW(temp, docW, 0, source);
create_source_fileW(source, NULL, 0);
- for (i = 0; i < sizeof(invalid_parameters)/sizeof(invalid_parameters[0]); i++)
+ for (i = 0; i < ARRAY_SIZE(invalid_parameters); i++)
{
SetLastError(0xdeadbeef);
ret = SetupIterateCabinetW(invalid_parameters[i].CabinetFile, 0,
@@ -275,7 +275,7 @@ static void test_invalid_callbackW(void)
return;
}
- GetTempPathW(sizeof(temp)/sizeof(WCHAR), temp);
+ GetTempPathW(ARRAY_SIZE(temp), temp);
GetTempFileNameW(temp, docW, 0, source);
create_source_fileW(source, comp_cab_zip_multi, sizeof(comp_cab_zip_multi));
@@ -316,7 +316,7 @@ static UINT CALLBACK simple_callbackA(PVOID Context, UINT Notification,
(*file_count)++;
- if (index < sizeof(expected_files)/sizeof(char *))
+ if (index < ARRAY_SIZE(expected_files))
{
ok(!strcmp(expected_files[index], info->NameInCabinet),
"[%d] Expected file \"%s\", got \"%s\"\n",
@@ -348,8 +348,7 @@ static void test_simple_enumerationA(void)
ret = SetupIterateCabinetA(source, 0, simple_callbackA, &enum_count);
ok(ret == 1, "Expected SetupIterateCabinetA to return 1, got %d\n", ret);
- ok(enum_count == sizeof(expected_files)/sizeof(char *),
- "Unexpectedly enumerated %d files\n", enum_count);
+ ok(enum_count == ARRAY_SIZE(expected_files), "Unexpectedly enumerated %d files\n", enum_count);
DeleteFileA(source);
}
@@ -376,7 +375,7 @@ static UINT CALLBACK simple_callbackW(PVOID Context, UINT Notification,
(*file_count)++;
- if (index < sizeof(expected_filesW)/sizeof(WCHAR *))
+ if (index < ARRAY_SIZE(expected_filesW))
{
ok(!lstrcmpW(expected_filesW[index], info->NameInCabinet),
"[%d] Expected file %s, got %s\n",
@@ -408,15 +407,14 @@ static void test_simple_enumerationW(void)
return;
}
- GetTempPathW(sizeof(temp)/sizeof(WCHAR), temp);
+ GetTempPathW(ARRAY_SIZE(temp), temp);
GetTempFileNameW(temp, docW, 0, source);
create_source_fileW(source, comp_cab_zip_multi, sizeof(comp_cab_zip_multi));
ret = SetupIterateCabinetW(source, 0, simple_callbackW, &enum_count);
ok(ret == 1, "Expected SetupIterateCabinetW to return 1, got %d\n", ret);
- ok(enum_count == sizeof(expected_files)/sizeof(WCHAR *),
- "Unexpectedly enumerated %d files\n", enum_count);
+ ok(enum_count == ARRAY_SIZE(expected_files), "Unexpectedly enumerated %d files\n", enum_count);
DeleteFileW(source);
}
--
2.14.4
June 14, 2018
[PATCH] winedbg/gdbproxy: Handle VS thread renaming.
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
programs/winedbg/gdbproxy.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
index 869d56b..7f59ce1 100644
--- a/programs/winedbg/gdbproxy.c
+++ b/programs/winedbg/gdbproxy.c
@@ -339,6 +339,30 @@ static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* e
ret = TRUE;
/* FIXME: we could also add here a O packet with additional information */
break;
+ case EXCEPTION_NAME_THREAD:
+ {
+ const THREADNAME_INFO *threadname = (const THREADNAME_INFO *)rec->ExceptionInformation;
+ struct dbg_thread *thread;
+ char name[9];
+ SIZE_T read;
+
+ if (threadname->dwThreadID == -1)
+ thread = dbg_curr_thread;
+ else
+ thread = dbg_get_thread(gdbctx->process, threadname->dwThreadID);
+ if (thread)
+ {
+ if (gdbctx->process->process_io->read( gdbctx->process->handle,
+ threadname->szName, name, sizeof(name), &read) && read == sizeof(name))
+ {
+ fprintf(stderr, "Thread ID=%04x renamed to \"%.9s\"\n",
+ threadname->dwThreadID, name);
+ }
+ }
+ else
+ fprintf(stderr, "Cannot set name of thread %04x\n", threadname->dwThreadID);
+ return DBG_CONTINUE;
+ }
default:
if (gdbctx->trace & GDBPXY_TRC_WIN32_EVENT)
fprintf(stderr, "Unhandled exception code 0x%08x\n", rec->ExceptionCode);
--
2.7.4
June 14, 2018
[PATCH 6/6] dbghelp: Read the stabs nlist entry corresponding to the target's architecture.
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/dbghelp/dbghelp_private.h | 2 +-
dlls/dbghelp/macho_module.c | 16 +++------
dlls/dbghelp/stabs.c | 73 ++++++++++++++++++++++++------------------
3 files changed, 47 insertions(+), 44 deletions(-)
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h
index 0963f1e..76f5d00 100644
--- a/dlls/dbghelp/dbghelp_private.h
+++ b/dlls/dbghelp/dbghelp_private.h
@@ -676,7 +676,7 @@ typedef void (*stabs_def_cb)(struct module* module, unsigned long load_offset,
BOOL is_public, BOOL is_global, unsigned char other,
struct symt_compiland* compiland, void* user);
extern BOOL stabs_parse(struct module* module, unsigned long load_offset,
- const void* stabs, int stablen,
+ const char* stabs, int stablen,
const char* strs, int strtablen,
stabs_def_cb callback, void* user) DECLSPEC_HIDDEN;
diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c
index b8f5967..52c8e69 100644
--- a/dlls/dbghelp/macho_module.c
+++ b/dlls/dbghelp/macho_module.c
@@ -88,13 +88,6 @@ struct dyld_all_image_infos {
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_macho);
-#ifdef _WIN64
-typedef struct nlist_64 macho_nlist;
-#else
-typedef struct nlist macho_nlist;
-#endif
-
-
/* Bitmask for Mach-O image header flags indicating that the image is in dyld's
shared cached. That implies that its segments are mapped non-contiguously.
This value isn't defined anywhere in headers. It's used in dyld and in
@@ -913,24 +906,25 @@ static int macho_parse_symtab(struct image_file_map* ifm,
struct macho_file_map* fmap = &ifm->u.macho;
const struct symtab_command* sc = (const struct symtab_command*)lc;
struct macho_debug_info* mdi = user;
- const macho_nlist* stab;
const char* stabstr;
int ret = 0;
+ size_t stabsize = (ifm->addr_size == 32) ? sizeof(struct nlist) : sizeof(struct nlist_64);
+ const char *stab;
TRACE("(%p/%d, %p, %p) %u syms at 0x%08x, strings 0x%08x - 0x%08x\n", fmap, fmap->fd, lc,
user, sc->nsyms, sc->symoff, sc->stroff, sc->stroff + sc->strsize);
- if (!macho_map_ranges(fmap, sc->symoff, sc->nsyms * sizeof(macho_nlist),
+ if (!macho_map_ranges(fmap, sc->symoff, sc->nsyms * stabsize,
sc->stroff, sc->strsize, (const void**)&stab, (const void**)&stabstr))
return 0;
if (!stabs_parse(mdi->module,
mdi->module->format_info[DFI_MACHO]->u.macho_info->load_addr - fmap->segs_start,
- stab, sc->nsyms * sizeof(macho_nlist),
+ stab, sc->nsyms * stabsize,
stabstr, sc->strsize, macho_stabs_def_cb, mdi))
ret = -1;
- macho_unmap_ranges(fmap, sc->symoff, sc->nsyms * sizeof(macho_nlist),
+ macho_unmap_ranges(fmap, sc->symoff, sc->nsyms * stabsize,
sc->stroff, sc->strsize, (const void**)&stab, (const void**)&stabstr);
return ret;
diff --git a/dlls/dbghelp/stabs.c b/dlls/dbghelp/stabs.c
index 177c6bc..846a935 100644
--- a/dlls/dbghelp/stabs.c
+++ b/dlls/dbghelp/stabs.c
@@ -41,6 +41,7 @@
#include <sys/mman.h>
#endif
#include <limits.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
@@ -111,11 +112,7 @@ struct stab_nlist
unsigned char n_type;
char n_other;
short n_desc;
-#if defined(__APPLE__) && defined(_WIN64)
- unsigned long n_value;
-#else
unsigned n_value;
-#endif
};
static void stab_strcpy(char* dest, int sz, const char* source)
@@ -1265,7 +1262,7 @@ static inline void stabbuf_append(char **buf, unsigned *buf_size, const char *st
}
BOOL stabs_parse(struct module* module, unsigned long load_offset,
- const void* pv_stab_ptr, int stablen,
+ const char* pv_stab_ptr, int stablen,
const char* strs, int strtablen,
stabs_def_cb callback, void* user)
{
@@ -1278,7 +1275,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
const char* ptr;
char* stabbuff;
unsigned int stabbufflen;
- const struct stab_nlist* stab_ptr = pv_stab_ptr;
+ const struct stab_nlist* stab_ptr;
const char* strs_end;
int strtabinc;
char symname[4096];
@@ -1290,8 +1287,14 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
BOOL ret = TRUE;
struct location loc;
unsigned char type;
+ size_t stabsize = sizeof(struct stab_nlist);
+ uint64_t n_value;
- nstab = stablen / sizeof(struct stab_nlist);
+#ifdef __APPLE__
+ if (module->process->is_64bit)
+ stabsize = sizeof(struct nlist_64);
+#endif
+ nstab = stablen / stabsize;
strs_end = strs + strtablen;
memset(stabs_basic, 0, sizeof(stabs_basic));
@@ -1307,8 +1310,14 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
strtabinc = 0;
stabbuff[0] = '\0';
- for (i = 0; i < nstab; i++, stab_ptr++)
+ for (i = 0; i < nstab; i++)
{
+ stab_ptr = (struct stab_nlist *)(pv_stab_ptr + i * stabsize);
+ n_value = stab_ptr->n_value;
+#ifdef __APPLE__
+ if (module->process->is_64bit)
+ n_value = ((struct nlist_64 *)stab_ptr)->n_value;
+#endif
ptr = strs + stab_ptr->n_strx;
if ((ptr > strs_end) || (ptr + strlen(ptr) > strs_end))
{
@@ -1382,7 +1391,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
stab_strcpy(symname, sizeof(symname), ptr);
loc.kind = loc_absolute;
loc.reg = 0;
- loc.offset = load_offset + stab_ptr->n_value;
+ loc.offset = load_offset + n_value;
symt_new_global_variable(module, compiland, symname, TRUE /* FIXME */,
loc, 0, stabs_parse_type(ptr));
break;
@@ -1392,7 +1401,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
stab_strcpy(symname, sizeof(symname), ptr);
loc.kind = loc_absolute;
loc.reg = 0;
- loc.offset = load_offset + stab_ptr->n_value;
+ loc.offset = load_offset + n_value;
symt_new_global_variable(module, compiland, symname, TRUE /* FIXME */,
loc, 0, stabs_parse_type(ptr));
break;
@@ -1400,14 +1409,14 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
if (curr_func)
{
block = symt_open_func_block(module, curr_func, block,
- stab_ptr->n_value, 0);
+ n_value, 0);
pending_flush(&pending_block, module, curr_func, block);
}
break;
case N_RBRAC:
if (curr_func)
block = symt_close_func_block(module, curr_func, block,
- stab_ptr->n_value);
+ n_value);
break;
case N_PSYM:
/* These are function parameters. */
@@ -1417,9 +1426,9 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
stab_strcpy(symname, sizeof(symname), ptr);
loc.kind = loc_regrel;
loc.reg = dbghelp_current_cpu->frame_regno;
- loc.offset = stab_ptr->n_value;
+ loc.offset = n_value;
symt_add_func_local(module, curr_func,
- (int)stab_ptr->n_value >= 0 ? DataIsParam : DataIsLocal,
+ (int)n_value >= 0 ? DataIsParam : DataIsLocal,
&loc, NULL, param_type, symname);
symt_add_function_signature_parameter(module,
(struct symt_function_signature*)curr_func->type,
@@ -1433,7 +1442,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
loc.kind = loc_register;
loc.offset = 0;
- switch (stab_ptr->n_value)
+ switch (n_value)
{
case 0: loc.reg = CV_REG_EAX; break;
case 1: loc.reg = CV_REG_ECX; break;
@@ -1451,7 +1460,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
case 16:
case 17:
case 18:
- case 19: loc.reg = CV_REG_ST0 + stab_ptr->n_value - 12; break;
+ case 19: loc.reg = CV_REG_ST0 + n_value - 12; break;
case 21:
case 22:
case 23:
@@ -1459,7 +1468,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
case 25:
case 26:
case 27:
- case 28: loc.reg = CV_REG_XMM0 + stab_ptr->n_value - 21; break;
+ case 28: loc.reg = CV_REG_XMM0 + n_value - 21; break;
case 29:
case 30:
case 31:
@@ -1467,9 +1476,9 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
case 33:
case 34:
case 35:
- case 36: loc.reg = CV_REG_MM0 + stab_ptr->n_value - 29; break;
+ case 36: loc.reg = CV_REG_MM0 + n_value - 29; break;
default:
- FIXME("Unknown register value (%lu)\n", (unsigned long)stab_ptr->n_value);
+ FIXME("Unknown register value (%lu)\n", (unsigned long)n_value);
loc.reg = CV_REG_NONE;
break;
}
@@ -1492,7 +1501,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
/* These are local variables */
loc.kind = loc_regrel;
loc.reg = dbghelp_current_cpu->frame_regno;
- loc.offset = stab_ptr->n_value;
+ loc.offset = n_value;
if (curr_func != NULL) pending_add_var(&pending_block, ptr, DataIsLocal, &loc);
break;
case N_SLINE:
@@ -1503,14 +1512,14 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
assert(source_idx >= 0);
if (curr_func != NULL)
{
- unsigned long offset = stab_ptr->n_value;
+ unsigned long offset = n_value;
if (module->type == DMT_MACHO)
offset -= curr_func->address - load_offset;
symt_add_func_line(module, curr_func, source_idx,
stab_ptr->n_desc, offset);
}
else pending_add_line(&pending_func, source_idx, stab_ptr->n_desc,
- stab_ptr->n_value, load_offset);
+ n_value, load_offset);
break;
case N_FUN:
/*
@@ -1537,13 +1546,13 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
* and offset of last function
*/
stabs_finalize_function(module, curr_func,
- stab_ptr->n_value ?
- (load_offset + stab_ptr->n_value - curr_func->address) : 0);
+ n_value ?
+ (load_offset + n_value - curr_func->address) : 0);
}
func_type = symt_new_function_signature(module,
stabs_parse_type(ptr), -1);
curr_func = symt_new_function(module, compiland, symname,
- load_offset + stab_ptr->n_value, 0,
+ load_offset + n_value, 0,
&func_type->symt);
pending_flush(&pending_func, module, curr_func, NULL);
}
@@ -1552,7 +1561,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
/* some versions of GCC to use a N_FUN "" to mark the end of a function
* and n_value contains the size of the func
*/
- stabs_finalize_function(module, curr_func, stab_ptr->n_value);
+ stabs_finalize_function(module, curr_func, n_value);
curr_func = NULL;
}
break;
@@ -1594,7 +1603,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
break;
case N_UNDF:
strs += strtabinc;
- strtabinc = stab_ptr->n_value;
+ strtabinc = n_value;
/* I'm not sure this is needed, so trace it before we obsolete it */
if (curr_func)
{
@@ -1607,7 +1616,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
/* Ignore this. We don't care what it points to. */
break;
case N_BINCL:
- stabs_add_include(stabs_new_include(ptr, stab_ptr->n_value));
+ stabs_add_include(stabs_new_include(ptr, n_value));
assert(incl_stk < (int)(sizeof(incl) / sizeof(incl[0])) - 1);
incl[++incl_stk] = source_idx;
source_idx = source_new(module, NULL, ptr);
@@ -1617,9 +1626,9 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
source_idx = incl[incl_stk--];
break;
case N_EXCL:
- if (stabs_add_include(stabs_find_include(ptr, stab_ptr->n_value)) < 0)
+ if (stabs_add_include(stabs_find_include(ptr, n_value)) < 0)
{
- ERR("Excluded header not found (%s,%ld)\n", ptr, (unsigned long)stab_ptr->n_value);
+ ERR("Excluded header not found (%s,%ld)\n", ptr, (unsigned long)n_value);
module_reset_debug_info(module);
ret = FALSE;
goto done;
@@ -1656,7 +1665,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
if (*ptr == '_') ptr++;
stab_strcpy(symname, sizeof(symname), ptr);
- callback(module, load_offset, symname, stab_ptr->n_value,
+ callback(module, load_offset, symname, n_value,
is_public, is_global, stab_ptr->n_other, compiland, user);
}
break;
@@ -1666,7 +1675,7 @@ BOOL stabs_parse(struct module* module, unsigned long load_offset,
}
stabbuff[0] = '\0';
TRACE("0x%02x %lx %s\n",
- stab_ptr->n_type, (unsigned long)stab_ptr->n_value, debugstr_a(strs + stab_ptr->n_strx));
+ stab_ptr->n_type, (unsigned long)n_value, debugstr_a(strs + stab_ptr->n_strx));
}
module->module.SymType = SymDia;
module->module.CVSig = 'S' | ('T' << 8) | ('A' << 16) | ('B' << 24);
--
2.7.4
June 14, 2018
[PATCH 5/6] dbghelp: Translate the 32-bit Mach-O section header to the 64-bit one.
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/dbghelp/image_private.h | 8 +-------
dlls/dbghelp/macho_module.c | 43 +++++++++++++++++++++++++++++--------------
2 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/dlls/dbghelp/image_private.h b/dlls/dbghelp/image_private.h
index 60cdd35..9990850 100644
--- a/dlls/dbghelp/image_private.h
+++ b/dlls/dbghelp/image_private.h
@@ -44,12 +44,6 @@
#endif
#ifdef HAVE_MACH_O_LOADER_H
#include <mach-o/loader.h>
-
-#ifdef _WIN64
-typedef struct section_64 macho_section;
-#else
-typedef struct section macho_section;
-#endif
#endif
#define IMAGE_NO_MAP ((void*)-1)
@@ -105,7 +99,7 @@ struct image_file_map
int num_sections;
struct
{
- const macho_section* section;
+ struct section_64 section;
const char* mapped;
unsigned int ignored : 1;
}* sect;
diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c
index 52ea739..b8f5967 100644
--- a/dlls/dbghelp/macho_module.c
+++ b/dlls/dbghelp/macho_module.c
@@ -328,7 +328,7 @@ BOOL macho_find_section(struct image_file_map* ifm, const char* segname, const c
{
struct macho_file_map* fmap;
unsigned i;
- char tmp[sizeof(fmap->sect[0].section->sectname)];
+ char tmp[sizeof(fmap->sect[0].section.sectname)];
/* Other parts of dbghelp use section names like ".eh_frame". Mach-O uses
names like "__eh_frame". Convert those. */
@@ -345,8 +345,8 @@ BOOL macho_find_section(struct image_file_map* ifm, const char* segname, const c
for (i = 0; i < fmap->num_sections; i++)
{
if (!fmap->sect[i].ignored &&
- strcmp(fmap->sect[i].section->sectname, sectname) == 0 &&
- (!segname || strcmp(fmap->sect[i].section->segname, segname) == 0))
+ strcmp(fmap->sect[i].section.sectname, sectname) == 0 &&
+ (!segname || strcmp(fmap->sect[i].section.segname, segname) == 0))
{
ism->fmap = ifm;
ism->sidx = i;
@@ -372,7 +372,7 @@ const char* macho_map_section(struct image_section_map* ism)
if (ism->sidx < 0 || ism->sidx >= ism->fmap->u.macho.num_sections || fmap->sect[ism->sidx].ignored)
return IMAGE_NO_MAP;
- return macho_map_range(fmap, fmap->sect[ism->sidx].section->offset, fmap->sect[ism->sidx].section->size,
+ return macho_map_range(fmap, fmap->sect[ism->sidx].section.offset, fmap->sect[ism->sidx].section.size,
&fmap->sect[ism->sidx].mapped);
}
@@ -385,8 +385,8 @@ void macho_unmap_section(struct image_section_map* ism)
if (ism->sidx >= 0 && ism->sidx < fmap->num_sections && fmap->sect[ism->sidx].mapped != IMAGE_NO_MAP)
{
- macho_unmap_range(&fmap->sect[ism->sidx].mapped, NULL, fmap, fmap->sect[ism->sidx].section->offset,
- fmap->sect[ism->sidx].section->size);
+ macho_unmap_range(&fmap->sect[ism->sidx].mapped, NULL, fmap, fmap->sect[ism->sidx].section.offset,
+ fmap->sect[ism->sidx].section.size);
}
}
@@ -398,7 +398,7 @@ DWORD_PTR macho_get_map_rva(const struct image_section_map* ism)
if (ism->sidx < 0 || ism->sidx >= ism->fmap->u.macho.num_sections ||
ism->fmap->u.macho.sect[ism->sidx].ignored)
return 0;
- return ism->fmap->u.macho.sect[ism->sidx].section->addr - ism->fmap->u.macho.segs_start;
+ return ism->fmap->u.macho.sect[ism->sidx].section.addr - ism->fmap->u.macho.segs_start;
}
/******************************************************************
@@ -409,7 +409,7 @@ unsigned macho_get_map_size(const struct image_section_map* ism)
if (ism->sidx < 0 || ism->sidx >= ism->fmap->u.macho.num_sections ||
ism->fmap->u.macho.sect[ism->sidx].ignored)
return 0;
- return ism->fmap->u.macho.sect[ism->sidx].section->size;
+ return ism->fmap->u.macho.sect[ism->sidx].section.size;
}
/******************************************************************
@@ -539,12 +539,12 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct load
struct macho_file_map* fmap = &ifm->u.macho;
struct section_info* info = user;
BOOL ignore;
- const macho_section* section;
int i;
unsigned long tmp, page_mask = sysconf( _SC_PAGESIZE ) - 1;
uint64_t vmaddr, vmsize;
char segname[16];
uint32_t nsects;
+ const void *sections;
if (ifm->addr_size == 32)
{
@@ -553,7 +553,7 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct load
vmsize = sc->vmsize;
memcpy(segname, sc->segname, sizeof(segname));
nsects = sc->nsects;
- section = (const macho_section*)(sc + 1);
+ sections = (const void *)(sc + 1);
}
else
{
@@ -562,7 +562,7 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct load
vmsize = sc->vmsize;
memcpy(segname, sc->segname, sizeof(segname));
nsects = sc->nsects;
- section = (const macho_section*)(sc + 1);
+ sections = (const void *)(sc + 1);
}
TRACE("(%p/%d, %p, %p) before: 0x%08lx - 0x%08lx\n", fmap, fmap->fd, lc, user,
@@ -596,7 +596,22 @@ static int macho_load_section_info(struct image_file_map* ifm, const struct load
for (i = 0; i < nsects; i++)
{
- fmap->sect[info->section_index].section = §ion[i];
+ if (ifm->addr_size == 32)
+ {
+ const struct section *section = &((const struct section *)sections)[i];
+ memcpy(fmap->sect[info->section_index].section.sectname, section->sectname, sizeof(section->sectname));
+ memcpy(fmap->sect[info->section_index].section.segname, section->segname, sizeof(section->segname));
+ fmap->sect[info->section_index].section.addr = section->addr;
+ fmap->sect[info->section_index].section.size = section->size;
+ fmap->sect[info->section_index].section.offset = section->offset;
+ fmap->sect[info->section_index].section.align = section->align;
+ fmap->sect[info->section_index].section.reloff = section->reloff;
+ fmap->sect[info->section_index].section.nreloc = section->nreloc;
+ fmap->sect[info->section_index].section.flags = section->flags;
+ }
+ else
+ fmap->sect[info->section_index].section = ((const struct section_64 *)sections)[i];
+
fmap->sect[info->section_index].mapped = IMAGE_NO_MAP;
fmap->sect[info->section_index].ignored = ignore;
info->section_index++;
@@ -831,8 +846,8 @@ static BOOL macho_sect_is_code(struct macho_file_map* fmap, unsigned char sectid
sectidx--; /* convert from 1-based to 0-based */
if (sectidx >= fmap->num_sections || fmap->sect[sectidx].ignored) return FALSE;
- ret = (!(fmap->sect[sectidx].section->flags & SECTION_TYPE) &&
- (fmap->sect[sectidx].section->flags & (S_ATTR_PURE_INSTRUCTIONS|S_ATTR_SOME_INSTRUCTIONS)));
+ ret = (!(fmap->sect[sectidx].section.flags & SECTION_TYPE) &&
+ (fmap->sect[sectidx].section.flags & (S_ATTR_PURE_INSTRUCTIONS|S_ATTR_SOME_INSTRUCTIONS)));
TRACE("-> %d\n", ret);
return ret;
}
--
2.7.4
June 14, 2018
[PATCH 4/6] dbghelp: Read the Mach-O segment command corresponding to the target's architecture.
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/dbghelp/macho_module.c | 68 +++++++++++++++++++++++++++++++++------------
1 file changed, 50 insertions(+), 18 deletions(-)
diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c
index 50fcca4..52ea739 100644
--- a/dlls/dbghelp/macho_module.c
+++ b/dlls/dbghelp/macho_module.c
@@ -89,10 +89,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_macho);
#ifdef _WIN64
-typedef struct segment_command_64 macho_segment_command;
typedef struct nlist_64 macho_nlist;
#else
-typedef struct segment_command macho_segment_command;
typedef struct nlist macho_nlist;
#endif
@@ -506,12 +504,26 @@ static int macho_enum_load_commands(struct image_file_map *ifm, unsigned cmd,
*/
static int macho_count_sections(struct image_file_map* ifm, const struct load_command* lc, void* user)
{
- const macho_segment_command* sc = (const macho_segment_command*)lc;
+ char segname[16];
+ uint32_t nsects;
+
+ if (ifm->addr_size == 32)
+ {
+ const struct segment_command *sc = (const struct segment_command *)lc;
+ memcpy(segname, sc->segname, sizeof(segname));
+ nsects = sc->nsects;
+ }
+ else
+ {
+ const struct segment_command_64 *sc = (const struct segment_command_64 *)lc;
+ memcpy(segname, sc->segname, sizeof(segname));
+ nsects = sc->nsects;
+ }
TRACE("(%p/%d, %p, %p) segment %s\n", ifm, ifm->u.macho.fd, lc, user,
- debugstr_an(sc->segname, sizeof(sc->segname)));
+ debugstr_an(segname, sizeof(segname)));
- ifm->u.macho.num_sections += sc->nsects;
+ ifm->u.macho.num_sections += nsects;
return 0;
}
@@ -525,44 +537,64 @@ static int macho_count_sections(struct image_file_map* ifm, const struct load_co
static int macho_load_section_info(struct image_file_map* ifm, const struct load_command* lc, void* user)
{
struct macho_file_map* fmap = &ifm->u.macho;
- const macho_segment_command* sc = (const macho_segment_command*)lc;
struct section_info* info = user;
BOOL ignore;
const macho_section* section;
int i;
unsigned long tmp, page_mask = sysconf( _SC_PAGESIZE ) - 1;
+ uint64_t vmaddr, vmsize;
+ char segname[16];
+ uint32_t nsects;
+
+ if (ifm->addr_size == 32)
+ {
+ const struct segment_command *sc = (const struct segment_command *)lc;
+ vmaddr = sc->vmaddr;
+ vmsize = sc->vmsize;
+ memcpy(segname, sc->segname, sizeof(segname));
+ nsects = sc->nsects;
+ section = (const macho_section*)(sc + 1);
+ }
+ else
+ {
+ const struct segment_command_64 *sc = (const struct segment_command_64 *)lc;
+ vmaddr = sc->vmaddr;
+ vmsize = sc->vmsize;
+ memcpy(segname, sc->segname, sizeof(segname));
+ nsects = sc->nsects;
+ section = (const macho_section*)(sc + 1);
+ }
TRACE("(%p/%d, %p, %p) before: 0x%08lx - 0x%08lx\n", fmap, fmap->fd, lc, user,
(unsigned long)fmap->segs_start, (unsigned long)fmap->segs_size);
- TRACE("Segment command vm: 0x%08lx - 0x%08lx\n", (unsigned long)sc->vmaddr,
- (unsigned long)(sc->vmaddr + sc->vmsize));
+ TRACE("Segment command vm: 0x%08lx - 0x%08lx\n", (unsigned long)vmaddr,
+ (unsigned long)(vmaddr + vmsize));
/* Images in the dyld shared cache have their segments mapped non-contiguously.
We don't know how to properly locate any of the segments other than __TEXT,
so ignore them. */
- ignore = (info->split_segs && strcmp(sc->segname, SEG_TEXT));
+ ignore = (info->split_segs && strcmp(segname, SEG_TEXT));
- if (!strncmp(sc->segname, "WINE_", 5))
- TRACE("Ignoring special Wine segment %s\n", debugstr_an(sc->segname, sizeof(sc->segname)));
- else if (!strncmp(sc->segname, "__PAGEZERO", 10))
+ if (!strncmp(segname, "WINE_", 5))
+ TRACE("Ignoring special Wine segment %s\n", debugstr_an(segname, sizeof(segname)));
+ else if (!strncmp(segname, "__PAGEZERO", 10))
TRACE("Ignoring __PAGEZERO segment\n");
else if (ignore)
- TRACE("Ignoring %s segment because image has split segments\n", sc->segname);
+ TRACE("Ignoring %s segment because image has split segments\n", segname);
else
{
/* If this segment starts before previously-known earliest, record new earliest. */
- if (sc->vmaddr < fmap->segs_start)
- fmap->segs_start = sc->vmaddr;
+ if (vmaddr < fmap->segs_start)
+ fmap->segs_start = vmaddr;
/* If this segment extends beyond previously-known furthest, record new furthest. */
- tmp = (sc->vmaddr + sc->vmsize + page_mask) & ~page_mask;
+ tmp = (vmaddr + vmsize + page_mask) & ~page_mask;
if (fmap->segs_size < tmp) fmap->segs_size = tmp;
TRACE("after: 0x%08lx - 0x%08lx\n", (unsigned long)fmap->segs_start, (unsigned long)fmap->segs_size);
}
- section = (const macho_section*)(sc + 1);
- for (i = 0; i < sc->nsects; i++)
+ for (i = 0; i < nsects; i++)
{
fmap->sect[info->section_index].section = §ion[i];
fmap->sect[info->section_index].mapped = IMAGE_NO_MAP;
--
2.7.4
June 14, 2018
[PATCH 3/6] dbghelp: Pass an image_file_map to macho_enum_load_commands().
by Zebediah Figura
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/dbghelp/macho_module.c | 38 ++++++++++++++++++++++----------------
1 file changed, 22 insertions(+), 16 deletions(-)
diff --git a/dlls/dbghelp/macho_module.c b/dlls/dbghelp/macho_module.c
index 679c203..50fcca4 100644
--- a/dlls/dbghelp/macho_module.c
+++ b/dlls/dbghelp/macho_module.c
@@ -467,10 +467,11 @@ static const struct load_command* macho_next_load_command(const struct load_comm
* callback. If >=0, that's the count of load commands successfully
* processed.
*/
-static int macho_enum_load_commands(struct macho_file_map* fmap, unsigned cmd,
- int (*cb)(struct macho_file_map*, const struct load_command*, void*),
+static int macho_enum_load_commands(struct image_file_map *ifm, unsigned cmd,
+ int (*cb)(struct image_file_map*, const struct load_command*, void*),
void* user)
{
+ struct macho_file_map* fmap = &ifm->u.macho;
const struct load_command* lc;
int i;
int count = 0;
@@ -488,7 +489,7 @@ static int macho_enum_load_commands(struct macho_file_map* fmap, unsigned cmd,
if (cmd && cmd != lc->cmd) continue;
count++;
- result = cb(fmap, lc, user);
+ result = cb(ifm, lc, user);
TRACE("load_command[%d] (%p), cmd %u; callback => %d\n", i, lc, lc->cmd, result);
if (result) return (result < 0) ? result : count;
}
@@ -503,13 +504,14 @@ static int macho_enum_load_commands(struct macho_file_map* fmap, unsigned cmd,
* significant sections in a Mach-O file. All commands are
* expected to be of LC_SEGMENT[_64] type.
*/
-static int macho_count_sections(struct macho_file_map* fmap, const struct load_command* lc, void* user)
+static int macho_count_sections(struct image_file_map* ifm, const struct load_command* lc, void* user)
{
const macho_segment_command* sc = (const macho_segment_command*)lc;
- TRACE("(%p/%d, %p, %p) segment %s\n", fmap, fmap->fd, lc, user, debugstr_an(sc->segname, sizeof(sc->segname)));
+ TRACE("(%p/%d, %p, %p) segment %s\n", ifm, ifm->u.macho.fd, lc, user,
+ debugstr_an(sc->segname, sizeof(sc->segname)));
- fmap->num_sections += sc->nsects;
+ ifm->u.macho.num_sections += sc->nsects;
return 0;
}
@@ -520,8 +522,9 @@ static int macho_count_sections(struct macho_file_map* fmap, const struct load_c
* range covered by the segments of a Mach-O file and builds the
* section map. All commands are expected to be of LC_SEGMENT[_64] type.
*/
-static int macho_load_section_info(struct macho_file_map* fmap, const struct load_command* lc, void* user)
+static int macho_load_section_info(struct image_file_map* ifm, const struct load_command* lc, void* user)
{
+ struct macho_file_map* fmap = &ifm->u.macho;
const macho_segment_command* sc = (const macho_segment_command*)lc;
struct section_info* info = user;
BOOL ignore;
@@ -576,9 +579,9 @@ static int macho_load_section_info(struct macho_file_map* fmap, const struct loa
* Callback for macho_enum_load_commands. Records the UUID load
* command of a Mach-O file.
*/
-static int find_uuid(struct macho_file_map* fmap, const struct load_command* lc, void* user)
+static int find_uuid(struct image_file_map* ifm, const struct load_command* lc, void* user)
{
- fmap->uuid = (const struct uuid_command*)lc;
+ ifm->u.macho.uuid = (const struct uuid_command*)lc;
return 1;
}
@@ -700,7 +703,7 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW,
TRACE("... verified Mach header\n");
fmap->num_sections = 0;
- if (macho_enum_load_commands(fmap, target_cmd, macho_count_sections, NULL) < 0)
+ if (macho_enum_load_commands(ifm, target_cmd, macho_count_sections, NULL) < 0)
goto done;
TRACE("%d sections\n", fmap->num_sections);
@@ -713,7 +716,7 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW,
info.split_segs = split_segs;
info.section_index = 0;
- if (macho_enum_load_commands(fmap, target_cmd, macho_load_section_info, &info) < 0)
+ if (macho_enum_load_commands(ifm, target_cmd, macho_load_section_info, &info) < 0)
{
fmap->num_sections = 0;
goto done;
@@ -723,7 +726,7 @@ static BOOL macho_map_file(struct process *pcs, const WCHAR *filenameW,
TRACE("segs_start: 0x%08lx, segs_size: 0x%08lx\n", (unsigned long)fmap->segs_start,
(unsigned long)fmap->segs_size);
- if (macho_enum_load_commands(fmap, LC_UUID, find_uuid, NULL) < 0)
+ if (macho_enum_load_commands(ifm, LC_UUID, find_uuid, NULL) < 0)
goto done;
if (fmap->uuid)
{
@@ -857,9 +860,10 @@ static void macho_stabs_def_cb(struct module* module, unsigned long load_offset,
* Callback for macho_enum_load_commands. Processes the LC_SYMTAB
* load commands from the Mach-O file.
*/
-static int macho_parse_symtab(struct macho_file_map* fmap,
+static int macho_parse_symtab(struct image_file_map* ifm,
const struct load_command* lc, void* user)
{
+ struct macho_file_map* fmap = &ifm->u.macho;
const struct symtab_command* sc = (const struct symtab_command*)lc;
struct macho_debug_info* mdi = user;
const macho_nlist* stab;
@@ -1219,6 +1223,7 @@ BOOL macho_load_debug_info(struct process *pcs, struct module* module)
BOOL ret = FALSE;
struct macho_debug_info mdi;
int result;
+ struct image_file_map *ifm;
struct macho_file_map *fmap;
if (module->type != DMT_MACHO || !module->format_info[DFI_MACHO]->u.macho_info)
@@ -1227,7 +1232,8 @@ BOOL macho_load_debug_info(struct process *pcs, struct module* module)
return FALSE;
}
- fmap = &module->format_info[DFI_MACHO]->u.macho_info->file_map.u.macho;
+ ifm = &module->format_info[DFI_MACHO]->u.macho_info->file_map;
+ fmap = &ifm->u.macho;
TRACE("(%p, %p/%d)\n", module, fmap, fmap->fd);
@@ -1246,7 +1252,7 @@ BOOL macho_load_debug_info(struct process *pcs, struct module* module)
mdi.module = module;
pool_init(&mdi.pool, 65536);
hash_table_init(&mdi.pool, &mdi.ht_symtab, 256);
- result = macho_enum_load_commands(fmap, LC_SYMTAB, macho_parse_symtab, &mdi);
+ result = macho_enum_load_commands(ifm, LC_SYMTAB, macho_parse_symtab, &mdi);
if (result > 0)
ret = TRUE;
else if (result < 0)
@@ -1255,7 +1261,7 @@ BOOL macho_load_debug_info(struct process *pcs, struct module* module)
if (!(dbghelp_options & SYMOPT_PUBLICS_ONLY) && fmap->dsym)
{
mdi.fmap = &fmap->dsym->u.macho;
- result = macho_enum_load_commands(mdi.fmap, LC_SYMTAB, macho_parse_symtab, &mdi);
+ result = macho_enum_load_commands(fmap->dsym, LC_SYMTAB, macho_parse_symtab, &mdi);
if (result > 0)
ret = TRUE;
else if (result < 0)
--
2.7.4
June 14, 2018