It'll make thinks simpler from unixlib when long types are enabled
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- include/wine/nsi.h | 304 ++++++++++++++++++++++++++-------------------------- 1 file changed, 152 insertions(+), 152 deletions(-)
diff --git a/include/wine/nsi.h b/include/wine/nsi.h index b8e59c7bf548..42fc4f68a67b 100644 --- a/include/wine/nsi.h +++ b/include/wine/nsi.h @@ -32,26 +32,26 @@ struct nsi_ndis_ifinfo_rw { GUID network_guid; - DWORD admin_status; + UINT admin_status; IF_COUNTED_STRING alias; /* .Length in bytes not including '\0' */ IF_PHYSICAL_ADDRESS phys_addr; USHORT pad; IF_COUNTED_STRING name2; - DWORD unk; + UINT unk; };
struct nsi_ndis_ifinfo_dynamic { - DWORD oper_status; + UINT oper_status; struct { - DWORD unk : 1; - DWORD not_media_conn : 1; - DWORD unk2 : 30; + UINT unk : 1; + UINT not_media_conn : 1; + UINT unk2 : 30; } flags; - DWORD media_conn_state; - DWORD unk; - DWORD mtu; + UINT media_conn_state; + UINT unk; + UINT mtu; ULONG64 xmit_speed; ULONG64 rcv_speed; ULONG64 in_errors; @@ -79,23 +79,23 @@ struct nsi_ndis_ifinfo_dynamic
struct nsi_ndis_ifinfo_static { - DWORD if_index; + UINT if_index; IF_COUNTED_STRING descr; - DWORD type; - DWORD access_type; - DWORD unk; - DWORD conn_type; + UINT type; + UINT access_type; + UINT unk; + UINT conn_type; GUID if_guid; USHORT conn_present; IF_PHYSICAL_ADDRESS perm_phys_addr; struct { - DWORD hw : 1; - DWORD filter : 1; - DWORD unk : 30; + UINT hw : 1; + UINT filter : 1; + UINT unk : 30; } flags; - DWORD media_type; - DWORD phys_medium_type; + UINT media_type; + UINT phys_medium_type; };
/* Undocumented NSI IP tables */ @@ -108,33 +108,33 @@ struct nsi_ndis_ifinfo_static
struct nsi_ip_cmpt_rw { - DWORD not_forwarding; - DWORD unk; - DWORD default_ttl; - DWORD unk2; + UINT not_forwarding; + UINT unk; + UINT default_ttl; + UINT unk2; };
struct nsi_ip_cmpt_dynamic { - DWORD num_ifs; - DWORD num_routes; - DWORD unk; - DWORD num_addrs; + UINT num_ifs; + UINT num_routes; + UINT unk; + UINT num_addrs; };
struct nsi_ip_icmpstats_dynamic { - DWORD in_msgs; - DWORD in_errors; - DWORD in_type_counts[256]; - DWORD out_msgs; - DWORD out_errors; - DWORD out_type_counts[256]; + UINT in_msgs; + UINT in_errors; + UINT in_type_counts[256]; + UINT out_msgs; + UINT out_errors; + UINT out_type_counts[256]; };
struct nsi_ip_ipstats_dynamic { - DWORD unk[4]; + UINT unk[4]; ULONGLONG in_recv; ULONGLONG in_octets; ULONGLONG fwd_dgrams; @@ -145,32 +145,32 @@ struct nsi_ip_ipstats_dynamic ULONGLONG out_octets; ULONGLONG unk4[6]; ULONGLONG in_hdr_errs; - DWORD in_addr_errs; - DWORD in_unk_protos; - DWORD unk5; - DWORD reasm_reqds; - DWORD reasm_oks; - DWORD reasm_fails; - DWORD in_discards; - DWORD out_no_routes; - DWORD out_discards; - DWORD routing_discards; - DWORD frag_oks; - DWORD frag_fails; - DWORD frag_creates; - DWORD unk6[7]; + UINT in_addr_errs; + UINT in_unk_protos; + UINT unk5; + UINT reasm_reqds; + UINT reasm_oks; + UINT reasm_fails; + UINT in_discards; + UINT out_no_routes; + UINT out_discards; + UINT routing_discards; + UINT frag_oks; + UINT frag_fails; + UINT frag_creates; + UINT unk6[7]; };
struct nsi_ip_ipstats_static { - DWORD reasm_timeout; + UINT reasm_timeout; };
struct nsi_ipv4_unicast_key { NET_LUID luid; IN_ADDR addr; - DWORD pad; + UINT pad; };
struct nsi_ipv6_unicast_key @@ -181,18 +181,18 @@ struct nsi_ipv6_unicast_key
struct nsi_ip_unicast_rw { - DWORD preferred_lifetime; - DWORD valid_lifetime; - DWORD prefix_origin; - DWORD suffix_origin; - DWORD on_link_prefix; - DWORD unk[2]; + UINT preferred_lifetime; + UINT valid_lifetime; + UINT prefix_origin; + UINT suffix_origin; + UINT on_link_prefix; + UINT unk[2]; };
struct nsi_ip_unicast_dynamic { - DWORD scope_id; - DWORD dad_state; + UINT scope_id; + UINT dad_state; };
struct nsi_ip_unicast_static @@ -205,7 +205,7 @@ struct nsi_ipv4_neighbour_key NET_LUID luid; NET_LUID luid2; IN_ADDR addr; - DWORD pad; + UINT pad; };
struct nsi_ipv6_neighbour_key @@ -222,38 +222,38 @@ struct nsi_ip_neighbour_rw
struct nsi_ip_neighbour_dynamic { - DWORD state; - DWORD time; + UINT state; + UINT time; struct { BOOLEAN is_router; BOOLEAN is_unreachable; } flags; USHORT phys_addr_len; - DWORD unk; + UINT unk; };
struct nsi_ipv4_forward_key { - DWORD unk; + UINT unk; IN_ADDR prefix; BYTE prefix_len; BYTE unk2[3]; - DWORD unk3[3]; + UINT unk3[3]; NET_LUID luid; NET_LUID luid2; IN_ADDR next_hop; - DWORD pad; + UINT pad; };
struct nsi_ipv6_forward_key { - DWORD unk; + UINT unk; IN6_ADDR prefix; BYTE prefix_len; BYTE unk2[3]; - DWORD unk3[3]; - DWORD pad; + UINT unk3[3]; + UINT pad; NET_LUID luid; NET_LUID luid2; IN6_ADDR next_hop; @@ -261,37 +261,37 @@ struct nsi_ipv6_forward_key
struct nsi_ip_forward_rw { - DWORD site_prefix_len; - DWORD valid_lifetime; - DWORD preferred_lifetime; - DWORD metric; - DWORD protocol; + UINT site_prefix_len; + UINT valid_lifetime; + UINT preferred_lifetime; + UINT metric; + UINT protocol; BYTE loopback; BYTE autoconf; BYTE publish; BYTE immortal; BYTE unk[4]; - DWORD unk2; + UINT unk2; };
struct nsi_ipv4_forward_dynamic { - DWORD age; - DWORD unk[3]; + UINT age; + UINT unk[3]; IN_ADDR addr2; /* often a repeat of prefix */ };
struct nsi_ipv6_forward_dynamic { - DWORD age; - DWORD unk[3]; + UINT age; + UINT unk[3]; IN6_ADDR addr2; /* often a repeat of prefix */ };
struct nsi_ip_forward_static { - DWORD origin; - DWORD if_index; + UINT origin; + UINT if_index; };
/* Undocumented NSI TCP tables */ @@ -302,28 +302,28 @@ struct nsi_ip_forward_static
struct nsi_tcp_stats_dynamic { - DWORD active_opens; - DWORD passive_opens; - DWORD attempt_fails; - DWORD est_rsts; - DWORD cur_est; - DWORD pad; /* ? */ + UINT active_opens; + UINT passive_opens; + UINT attempt_fails; + UINT est_rsts; + UINT cur_est; + UINT pad; /* ? */ ULONGLONG in_segs; ULONGLONG out_segs; - DWORD retrans_segs; - DWORD out_rsts; - DWORD in_errs; - DWORD num_conns; - DWORD unk[12]; + UINT retrans_segs; + UINT out_rsts; + UINT in_errs; + UINT num_conns; + UINT unk[12]; };
struct nsi_tcp_stats_static { - DWORD rto_algo; - DWORD rto_min; - DWORD rto_max; - DWORD max_conns; - DWORD unk; + UINT rto_algo; + UINT rto_min; + UINT rto_max; + UINT max_conns; + UINT unk; };
struct nsi_tcp_conn_key @@ -334,14 +334,14 @@ struct nsi_tcp_conn_key
struct nsi_tcp_conn_dynamic { - DWORD state; - DWORD unk[3]; + UINT state; + UINT unk[3]; };
struct nsi_tcp_conn_static { - DWORD unk[3]; - DWORD pid; + UINT unk[3]; + UINT pid; ULONGLONG create_time; ULONGLONG mod_info; }; @@ -353,11 +353,11 @@ struct nsi_tcp_conn_static struct nsi_udp_stats_dynamic { ULONGLONG in_dgrams; - DWORD no_ports; - DWORD in_errs; + UINT no_ports; + UINT in_errs; ULONGLONG out_dgrams; - DWORD num_addrs; - DWORD unk[5]; + UINT num_addrs; + UINT unk[5]; };
struct nsi_udp_endpoint_key @@ -367,11 +367,11 @@ struct nsi_udp_endpoint_key
struct nsi_udp_endpoint_static { - DWORD pid; - DWORD unk; + UINT pid; + UINT unk; ULONGLONG create_time; - DWORD flags; - DWORD unk2; + UINT flags; + UINT unk2; ULONGLONG mod_info; };
@@ -386,26 +386,26 @@ struct nsi_udp_endpoint_static struct nsiproxy_enumerate_all { NPI_MODULEID module; - DWORD first_arg; - DWORD second_arg; - DWORD table; - DWORD key_size; - DWORD rw_size; - DWORD dynamic_size; - DWORD static_size; - DWORD count; + UINT first_arg; + UINT second_arg; + UINT table; + UINT key_size; + UINT rw_size; + UINT dynamic_size; + UINT static_size; + UINT count; };
/* input for IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS */ struct nsiproxy_get_all_parameters { NPI_MODULEID module; - DWORD first_arg; - DWORD table; - DWORD key_size; - DWORD rw_size; - DWORD dynamic_size; - DWORD static_size; + UINT first_arg; + UINT table; + UINT key_size; + UINT rw_size; + UINT dynamic_size; + UINT static_size; BYTE key[1]; /* key_size */ };
@@ -413,11 +413,11 @@ struct nsiproxy_get_all_parameters struct nsiproxy_get_parameter { NPI_MODULEID module; - DWORD first_arg; - DWORD table; - DWORD key_size; - DWORD param_type; - DWORD data_offset; + UINT first_arg; + UINT table; + UINT key_size; + UINT param_type; + UINT data_offset; BYTE key[1]; /* key_size */ };
@@ -431,9 +431,9 @@ struct nsiproxy_icmp_echo BYTE ttl; BYTE tos; BYTE flags; - DWORD opt_size; - DWORD req_size; - DWORD timeout; + UINT opt_size; + UINT req_size; + UINT timeout; BYTE data[1]; /* ((opt_size + 3) & ~3) + req_size */ };
@@ -447,50 +447,50 @@ struct nsi_enumerate_all_ex { void *unknown[2]; const NPI_MODULEID *module; - DWORD_PTR table; - DWORD first_arg; - DWORD second_arg; + UINT_PTR table; + UINT first_arg; + UINT second_arg; void *key_data; - DWORD key_size; + UINT key_size; void *rw_data; - DWORD rw_size; + UINT rw_size; void *dynamic_data; - DWORD dynamic_size; + UINT dynamic_size; void *static_data; - DWORD static_size; - DWORD_PTR count; + UINT static_size; + UINT_PTR count; };
struct nsi_get_all_parameters_ex { void *unknown[2]; const NPI_MODULEID *module; - DWORD_PTR table; - DWORD first_arg; - DWORD unknown2; + UINT_PTR table; + UINT first_arg; + UINT unknown2; const void *key; - DWORD key_size; + UINT key_size; void *rw_data; - DWORD rw_size; + UINT rw_size; void *dynamic_data; - DWORD dynamic_size; + UINT dynamic_size; void *static_data; - DWORD static_size; + UINT static_size; };
struct nsi_get_parameter_ex { void *unknown[2]; const NPI_MODULEID *module; - DWORD_PTR table; - DWORD first_arg; - DWORD unknown2; + UINT_PTR table; + UINT first_arg; + UINT unknown2; const void *key; - DWORD key_size; - DWORD_PTR param_type; + UINT key_size; + UINT_PTR param_type; void *data; - DWORD data_size; - DWORD data_offset; + UINT data_size; + UINT data_offset; };
DWORD WINAPI NsiAllocateAndGetTable( DWORD unk, const NPI_MODULEID *module, DWORD table, void **key_data, DWORD key_size,
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/nsi/tests/Makefile.in | 1 dlls/nsi/tests/nsi.c | 196 ++++++++++++++++++++++---------------------- 2 files changed, 98 insertions(+), 99 deletions(-)
diff --git a/dlls/nsi/tests/Makefile.in b/dlls/nsi/tests/Makefile.in index f43da86076ce..981299351984 100644 --- a/dlls/nsi/tests/Makefile.in +++ b/dlls/nsi/tests/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES TESTDLL = nsi.dll IMPORTS = nsi uuid iphlpapi
diff --git a/dlls/nsi/tests/nsi.c b/dlls/nsi/tests/nsi.c index fc85d4ba8ffa..b6dd8f2416d8 100644 --- a/dlls/nsi/tests/nsi.c +++ b/dlls/nsi/tests/nsi.c @@ -62,19 +62,19 @@ static void test_nsi_api( void ) (void **)&stat_tbl, sizeof(*stat_tbl), &count, 0 ); if (!err) break; } - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); rw_size = rw_sizes[i];
for (i = 0; i < count; i++) { - winetest_push_context( "%d", i ); + winetest_push_context( "%ld", i ); rw = (struct nsi_ndis_ifinfo_rw *)((BYTE *)rw_tbl + i * rw_size); dyn = dyn_tbl + i; stat = stat_tbl + i;
err = NsiGetAllParameters( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, luid_tbl + i, sizeof(*luid_tbl), &get_rw, rw_size, &get_dyn, sizeof(get_dyn), &get_stat, sizeof(get_stat) ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); /* test a selection of members */ ok( IsEqualGUID( &get_rw.network_guid, &rw->network_guid ), "mismatch\n" ); ok( get_rw.alias.Length == rw->alias.Length, "mismatch\n" ); @@ -103,7 +103,7 @@ static void test_nsi_api( void ) get_all_params.static_size = sizeof(get_stat);
err = NsiGetAllParametersEx( &get_all_params ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); /* test a selection of members */ ok( IsEqualGUID( &get_rw.network_guid, &rw->network_guid ), "mismatch\n" ); ok( get_rw.alias.Length == rw->alias.Length, "mismatch\n" ); @@ -121,20 +121,20 @@ static void test_nsi_api( void ) err = NsiGetParameter( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, luid_tbl + i, sizeof(*luid_tbl), NSI_PARAM_TYPE_RW, &get_rw.alias, sizeof(get_rw.alias), FIELD_OFFSET(struct nsi_ndis_ifinfo_rw, alias) ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( get_rw.alias.Length == rw->alias.Length, "mismatch\n" ); ok( !memcmp( get_rw.alias.String, rw->alias.String, rw->alias.Length ), "mismatch\n" );
err = NsiGetParameter( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, luid_tbl + i, sizeof(*luid_tbl), NSI_PARAM_TYPE_STATIC, &get_stat.if_index, sizeof(get_stat.if_index), FIELD_OFFSET(struct nsi_ndis_ifinfo_static, if_index) ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( get_stat.if_index == stat->if_index, "mismatch\n" );
err = NsiGetParameter( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, luid_tbl + i, sizeof(*luid_tbl), NSI_PARAM_TYPE_STATIC, &get_stat.if_guid, sizeof(get_stat.if_guid), FIELD_OFFSET(struct nsi_ndis_ifinfo_static, if_guid) ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( IsEqualGUID( &get_stat.if_guid, &stat->if_guid ), "mismatch\n" );
memset( &get_rw, 0xcc, sizeof(get_rw) ); @@ -153,7 +153,7 @@ static void test_nsi_api( void ) get_param.data_size = sizeof(get_rw.alias); get_param.data_offset = FIELD_OFFSET(struct nsi_ndis_ifinfo_rw, alias); err = NsiGetParameterEx( &get_param ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( get_rw.alias.Length == rw->alias.Length, "mismatch\n" ); ok( !memcmp( get_rw.alias.String, rw->alias.String, rw->alias.Length ), "mismatch\n" );
@@ -162,7 +162,7 @@ static void test_nsi_api( void ) get_param.data_size = sizeof(get_stat.if_index); get_param.data_offset = FIELD_OFFSET(struct nsi_ndis_ifinfo_static, if_index); err = NsiGetParameterEx( &get_param ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( get_stat.if_index == stat->if_index, "mismatch\n" );
get_param.param_type = NSI_PARAM_TYPE_STATIC; @@ -170,7 +170,7 @@ static void test_nsi_api( void ) get_param.data_size = sizeof(get_stat.if_guid); get_param.data_offset = FIELD_OFFSET(struct nsi_ndis_ifinfo_static, if_guid); err = NsiGetParameterEx( &get_param ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( IsEqualGUID( &get_stat.if_guid, &stat->if_guid ), "mismatch\n" ); winetest_pop_context(); } @@ -179,7 +179,7 @@ static void test_nsi_api( void ) err = NsiEnumerateObjectsAllParameters( 1, 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, NULL, 0, NULL, 0, NULL, 0, NULL, 0, &enum_count ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( enum_count == count, "mismatch\n" );
enum_luid_tbl = malloc( count * sizeof(*enum_luid_tbl) ); @@ -191,12 +191,12 @@ static void test_nsi_api( void ) enum_luid_tbl, sizeof(*enum_luid_tbl), enum_rw_tbl, rw_size, enum_dyn_tbl, sizeof(*enum_dyn_tbl), enum_stat_tbl, sizeof(*enum_stat_tbl), &enum_count ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( enum_count == count, "mismatch\n" );
for (i = 0; i < count; i++) { - winetest_push_context( "%d", i ); + winetest_push_context( "%ld", i ); rw = (struct nsi_ndis_ifinfo_rw *)((BYTE *)rw_tbl + i * rw_size); enum_rw = (struct nsi_ndis_ifinfo_rw *)((BYTE *)enum_rw_tbl + i * rw_size); dyn = dyn_tbl + i; @@ -226,11 +226,11 @@ static void test_nsi_api( void ) enum_luid_tbl, sizeof(*enum_luid_tbl), enum_rw_tbl, rw_size, enum_dyn_tbl, sizeof(*enum_dyn_tbl), enum_stat_tbl, sizeof(*enum_stat_tbl), &enum_count ); - ok( err == ERROR_MORE_DATA, "got %d\n", err ); + ok( err == ERROR_MORE_DATA, "got %ld\n", err ); ok( enum_count == count - 1, "mismatch\n" );
for (i = 0; i < enum_count; i++) /* for simplicity just check the luids */ - ok( enum_luid_tbl[i].Value == luid_tbl[i].Value, "%d: mismatch\n", i ); + ok( enum_luid_tbl[i].Value == luid_tbl[i].Value, "%ld: mismatch\n", i ); }
memset( &enum_params, 0, sizeof(enum_params) ); @@ -249,7 +249,7 @@ static void test_nsi_api( void ) enum_params.count = count;
err = NsiEnumerateObjectsAllParametersEx( &enum_params ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( enum_params.count == count, "mismatch\n" );
free( enum_luid_tbl ); @@ -279,21 +279,21 @@ static void test_ndis_ifinfo( void ) (void **)&stat_tbl, sizeof(*stat_tbl), &count, 0 ); if (!err) break; } - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); if (err) return; rw_size = rw_sizes[i];
err = GetIfTable2( &table ); - ok( !err, "got %d\n", err ); - ok( table->NumEntries == count, "table entries %d count %d\n", table->NumEntries, count ); + ok( !err, "got %ld\n", err ); + ok( table->NumEntries == count, "table entries %ld count %ld\n", table->NumEntries, count );
/* Grab the dyn table again to provide an upper bound for the stats returned from GetIfTable2(). (The luids must be retrieved again otherwise NsiAllocateAndGetTable() fails). */ err = NsiAllocateAndGetTable( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, (void **)&luid_tbl_2, sizeof(*luid_tbl_2), NULL, 0, (void **)&dyn_tbl_2, sizeof(*dyn_tbl_2), NULL, 0, &count, 0 ); - ok( !err, "got %d\n", err ); - ok( table->NumEntries == count, "table entries %d count %d\n", table->NumEntries, count ); + ok( !err, "got %ld\n", err ); + ok( table->NumEntries == count, "table entries %ld count %ld\n", table->NumEntries, count );
for (i = 0; i < count; i++) { @@ -303,7 +303,7 @@ static void test_ndis_ifinfo( void ) struct nsi_ndis_ifinfo_dynamic *dyn = dyn_tbl + i, *dyn_2 = dyn_tbl_2 + i; struct nsi_ndis_ifinfo_static *stat = stat_tbl + i;
- winetest_push_context( "%d", i ); + winetest_push_context( "%ld", i ); ok( row->InterfaceLuid.Value == luid->Value, "mismatch\n" ); ok( row->InterfaceIndex == stat->if_index, "mismatch\n" ); ok( IsEqualGUID( &row->InterfaceGuid, &stat->if_guid ), "mismatch\n" ); @@ -367,25 +367,25 @@ static void test_ndis_ifinfo( void ) err = NsiGetAllParameters( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, luid_tbl, sizeof(*luid_tbl), &rw_get, rw_size, &dyn_get, sizeof(dyn_get), &stat_get, sizeof(stat_get) ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( IsEqualGUID( &stat_tbl[0].if_guid, &stat_get.if_guid ), "mismatch\n" );
err = NsiGetParameter( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, luid_tbl, sizeof(*luid_tbl), NSI_PARAM_TYPE_STATIC, &stat_get.if_guid, sizeof(stat_get.if_guid), FIELD_OFFSET(struct nsi_ndis_ifinfo_static, if_guid) ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); ok( IsEqualGUID( &stat_tbl[0].if_guid, &stat_get.if_guid ), "mismatch\n" );
luid_get.Value = ~0u; err = NsiGetAllParameters( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, &luid_get, sizeof(luid_get), &rw_get, rw_size, &dyn_get, sizeof(dyn_get), &stat_get, sizeof(stat_get) ); - ok( err == ERROR_FILE_NOT_FOUND, "got %d\n", err ); + ok( err == ERROR_FILE_NOT_FOUND, "got %ld\n", err );
err = NsiGetParameter( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, &luid_get, sizeof(luid_get), NSI_PARAM_TYPE_STATIC, &stat_get.if_guid, sizeof(stat_get.if_guid), FIELD_OFFSET(struct nsi_ndis_ifinfo_static, if_guid) ); - ok( err == ERROR_FILE_NOT_FOUND, "got %d\n", err ); + ok( err == ERROR_FILE_NOT_FOUND, "got %ld\n", err );
FreeMibTable( table ); NsiFreeTable( luid_tbl_2, NULL, dyn_tbl_2, NULL ); @@ -403,22 +403,22 @@ static void test_ndis_index_luid( void ) /* first get the luids */ err = NsiAllocateAndGetTable( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_IFINFO_TABLE, (void **)&luids, sizeof(*luids), NULL, 0, NULL, 0, NULL, 0, &count, 0 ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err );
for (i = 0; i < count; i++) { ConvertInterfaceLuidToIndex( luids + i, &index ); err = NsiGetParameter( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_INDEX_LUID_TABLE, &index, sizeof(index), NSI_PARAM_TYPE_STATIC, &luid, sizeof(luid), 0 ); - ok( !err, "got %d\n", err ); - ok( luid.Value == luids[i].Value, "%d: luid mismatch\n", i ); + ok( !err, "got %ld\n", err ); + ok( luid.Value == luids[i].Value, "%ld: luid mismatch\n", i ); } NsiFreeTable( luids, NULL, NULL, NULL );
index = ~0u; err = NsiGetParameter( 1, &NPI_MS_NDIS_MODULEID, NSI_NDIS_INDEX_LUID_TABLE, &index, sizeof(index), NSI_PARAM_TYPE_STATIC, &luid, sizeof(luid), 0 ); - ok( err == ERROR_FILE_NOT_FOUND, "got %d\n", err ); + ok( err == ERROR_FILE_NOT_FOUND, "got %ld\n", err ); }
static void test_ip_cmpt( int family ) @@ -440,17 +440,17 @@ static void test_ip_cmpt( int family ) err = NsiGetAllParameters( 1, mod, 2, &key, sizeof(key), &rw, rw_sizes[i], &dyn, sizeof(dyn), NULL, 0 ); if (!err) break; } - ok( !err, "got %x\n", err ); + ok( !err, "got %lx\n", err );
err = GetIpStatisticsEx( &table, family ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); if (err) goto err;
- ok( table.dwForwarding - 1 == rw.not_forwarding, "%x vs %x\n", table.dwForwarding, rw.not_forwarding ); - ok( table.dwDefaultTTL == rw.default_ttl, "%x vs %x\n", table.dwDefaultTTL, rw.default_ttl ); - ok( table.dwNumIf == dyn.num_ifs, "%x vs %x\n", table.dwNumIf, dyn.num_ifs ); - ok( table.dwNumAddr == dyn.num_addrs, "%x vs %x\n", table.dwNumAddr, dyn.num_addrs ); - ok( table.dwNumRoutes == dyn.num_routes, "%x vs %x\n", table.dwNumRoutes, dyn.num_routes ); + ok( table.dwForwarding - 1 == rw.not_forwarding, "%lx vs %x\n", table.dwForwarding, rw.not_forwarding ); + ok( table.dwDefaultTTL == rw.default_ttl, "%lx vs %x\n", table.dwDefaultTTL, rw.default_ttl ); + ok( table.dwNumIf == dyn.num_ifs, "%lx vs %x\n", table.dwNumIf, dyn.num_ifs ); + ok( table.dwNumAddr == dyn.num_addrs, "%lx vs %x\n", table.dwNumAddr, dyn.num_addrs ); + ok( table.dwNumRoutes == dyn.num_routes, "%lx vs %x\n", table.dwNumRoutes, dyn.num_routes );
err: winetest_pop_context(); @@ -466,15 +466,15 @@ static void test_ip_icmpstats( int family ) winetest_push_context( family == AF_INET ? "AF_INET" : "AF_INET6" );
err = NsiGetAllParameters( 1, mod, NSI_IP_ICMPSTATS_TABLE, NULL, 0, NULL, 0, &nsi_stats, sizeof(nsi_stats), NULL, 0 ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); if (err) goto err;
err = GetIcmpStatisticsEx( &table, family ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); if (err) goto err;
err = NsiGetAllParameters( 1, mod, NSI_IP_ICMPSTATS_TABLE, NULL, 0, NULL, 0, &nsi_stats2, sizeof(nsi_stats2), NULL, 0 ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err );
expect_bounded( "icmpInStats.dwMsgs", table.icmpInStats.dwMsgs, nsi_stats.in_msgs, nsi_stats2.in_msgs ); expect_bounded( "icmpInStats.dwErrors", table.icmpInStats.dwErrors, nsi_stats.in_errors, nsi_stats2.in_errors ); @@ -482,7 +482,7 @@ static void test_ip_icmpstats( int family ) expect_bounded( "icmpOutStats.dwErrors", table.icmpOutStats.dwErrors, nsi_stats.out_errors, nsi_stats2.out_errors ); for (i = 0; i < ARRAY_SIZE(nsi_stats.in_type_counts); i++) { - winetest_push_context( "%d", i ); + winetest_push_context( "%ld", i ); expect_bounded( "icmpInStats.rgdwTypeCount", table.icmpInStats.rgdwTypeCount[i], nsi_stats.in_type_counts[i], nsi_stats2.in_type_counts[i] ); expect_bounded( "icmpOutStats.rgdwTypeCount", table.icmpOutStats.rgdwTypeCount[i], nsi_stats.out_type_counts[i], nsi_stats2.out_type_counts[i] ); winetest_pop_context(); @@ -505,14 +505,14 @@ static void test_ip_ipstats( int family ) /* The table appears to consist of a single object without a key. The rw data does exist but isn't part of GetIpStatisticsEx() and isn't yet tested */ err = NsiGetAllParameters( 1, mod, NSI_IP_IPSTATS_TABLE, NULL, 0, NULL, 0, &dyn, sizeof(dyn), &stat, sizeof(stat) ); - ok( !err, "got %x\n", err ); + ok( !err, "got %lx\n", err ); if (err) goto err;
err = GetIpStatisticsEx( &table, family ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err );
err = NsiGetAllParameters( 1, mod, NSI_IP_IPSTATS_TABLE, NULL, 0, NULL, 0, &dyn2, sizeof(dyn2), NULL, 0 ); - ok( !err, "got %x\n", err ); + ok( !err, "got %lx\n", err );
/* dwForwarding and dwDefaultTTL come from the compartment table */ expect_bounded( "dwInReceives", table.dwInReceives, dyn.in_recv, dyn2.in_recv ); @@ -526,7 +526,7 @@ static void test_ip_ipstats( int family ) expect_bounded( "dwRoutingDiscards", table.dwRoutingDiscards, dyn.routing_discards, dyn2.routing_discards ); expect_bounded( "dwOutDiscards", table.dwOutDiscards, dyn.out_discards, dyn2.out_discards ); expect_bounded( "dwOutNoRoutes", table.dwOutNoRoutes, dyn.out_no_routes, dyn2.out_no_routes ); - ok( table.dwReasmTimeout == stat.reasm_timeout, "bad timeout %d != %d\n", table.dwReasmTimeout, stat.reasm_timeout ); + ok( table.dwReasmTimeout == stat.reasm_timeout, "bad timeout %ld != %d\n", table.dwReasmTimeout, stat.reasm_timeout ); expect_bounded( "dwReasmReqds", table.dwReasmReqds, dyn.reasm_reqds, dyn2.reasm_reqds ); expect_bounded( "dwReasmOks", table.dwReasmOks, dyn.reasm_oks, dyn2.reasm_oks ); expect_bounded( "dwReasmFails", table.dwReasmFails, dyn.reasm_fails, dyn2.reasm_fails ); @@ -561,12 +561,12 @@ static void test_ip_unicast( int family ) (void **)&stat_tbl, sizeof(*stat_tbl), &count, 0 ); if (!err) break; } - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); rw_size = rw_sizes[i];
err = GetUnicastIpAddressTable( family, &table ); - ok( !err, "got %d\n", err ); - ok( table->NumEntries == count, "table entries %d count %d\n", table->NumEntries, count ); + ok( !err, "got %ld\n", err ); + ok( table->NumEntries == count, "table entries %ld count %ld\n", table->NumEntries, count );
for (i = 0; i < count; i++) { @@ -574,7 +574,7 @@ static void test_ip_unicast( int family ) rw = (struct nsi_ip_unicast_rw *)((BYTE *)rw_tbl + i * rw_size); dyn = dyn_tbl + i; stat = stat_tbl + i; - winetest_push_context( "%d", i ); + winetest_push_context( "%ld", i );
ok( row->Address.si_family == family, "mismatch\n" );
@@ -606,7 +606,7 @@ static void test_ip_unicast( int family ) get_key.addr.s_addr = 0; err = NsiGetAllParameters( 1, &NPI_MS_IPV4_MODULEID, NSI_IP_UNICAST_TABLE, &get_key, sizeof(get_key), &get_rw, rw_size, &get_dyn, sizeof(get_dyn), &get_stat, sizeof(get_stat) ); - ok( err == ERROR_NOT_FOUND, "got %d\n", err ); + ok( err == ERROR_NOT_FOUND, "got %ld\n", err );
FreeMibTable( table ); NsiFreeTable( key_tbl, rw_tbl, dyn_tbl, stat_tbl ); @@ -632,22 +632,22 @@ static void test_ip_neighbour( int family ) (void **)&rw_tbl, sizeof(*rw), (void **)&dyn_tbl, sizeof(*dyn), NULL, 0, &count, 0 ); todo_wine_if( family == AF_INET6 ) - ok( !err, "got %x\n", err ); + ok( !err, "got %lx\n", err ); if (err) goto err;
err = GetIpNetTable2( family, &table ); - ok( !err, "got %x\n", err ); + ok( !err, "got %lx\n", err );
err = NsiAllocateAndGetTable( 1, mod, NSI_IP_NEIGHBOUR_TABLE, (void **)&key_tbl_2, key_size, NULL, 0, (void **)&dyn_tbl_2, sizeof(*dyn), NULL, 0, &count2, 0 ); - ok( !err, "got %x\n", err ); + ok( !err, "got %lx\n", err ); if (count == count2 && !memcmp( dyn_tbl, dyn_tbl_2, count * sizeof(*dyn) )) break; NsiFreeTable( key_tbl_2, NULL, dyn_tbl_2, NULL ); NsiFreeTable( key_tbl, rw_tbl, dyn_tbl, NULL ); }
- ok( count == table->NumEntries, "%d vs %d\n", count, table->NumEntries ); + ok( count == table->NumEntries, "%ld vs %ld\n", count, table->NumEntries );
for (i = 0; i < count; i++) { @@ -658,7 +658,7 @@ static void test_ip_neighbour( int family ) if (family == AF_INET) { key4 = key_tbl + i; - ok( key4->addr.s_addr == row->Address.Ipv4.sin_addr.s_addr, "%08x vs %08x\n", key4->addr.s_addr, + ok( key4->addr.s_addr == row->Address.Ipv4.sin_addr.s_addr, "%08lx vs %08lx\n", key4->addr.s_addr, row->Address.Ipv4.sin_addr.s_addr ); ok( key4->luid.Value == row->InterfaceLuid.Value, "%s vs %s\n", wine_dbgstr_longlong( key4->luid.Value ), wine_dbgstr_longlong( row->InterfaceLuid.Value ) ); @@ -677,7 +677,7 @@ static void test_ip_neighbour( int family ) ok( dyn->state == row->State, "%x vs %x\n", dyn->state, row->State ); ok( dyn->flags.is_router == row->IsRouter, "%x vs %x\n", dyn->flags.is_router, row->IsRouter ); ok( dyn->flags.is_unreachable == row->IsUnreachable, "%x vs %x\n", dyn->flags.is_unreachable, row->IsUnreachable ); - ok( dyn->time == row->ReachabilityTime.LastReachable, "%x vs %x\n", dyn->time, row->ReachabilityTime.LastReachable ); + ok( dyn->time == row->ReachabilityTime.LastReachable, "%x vs %lx\n", dyn->time, row->ReachabilityTime.LastReachable ); }
NsiFreeTable( key_tbl_2, NULL, dyn_tbl_2, NULL ); @@ -716,7 +716,7 @@ static void test_ip_forward( int family ) NULL, 0, &count, 0 ); if (!err) break; } - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); if (err) { winetest_pop_context(); return; } rw_size = rw_sizes[i]; NsiFreeTable( key_tbl, rw_tbl, NULL, NULL ); @@ -728,19 +728,19 @@ static void test_ip_forward( int family ) (void **)&stat_tbl, sizeof(*stat_tbl), &count, 0 ); if (!err) break; } - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); dyn_size = dyn_sizes[i];
err = GetIpForwardTable2( family, &table ); - ok( !err, "got %d\n", err ); - ok( table->NumEntries == count, "table entries %d count %d\n", table->NumEntries, count ); + ok( !err, "got %ld\n", err ); + ok( table->NumEntries == count, "table entries %ld count %ld\n", table->NumEntries, count );
for (i = 0; i < count; i++) { MIB_IPFORWARD_ROW2 *row = table->Table + i; rw = (struct nsi_ip_forward_rw *)((BYTE *)rw_tbl + i * rw_size); stat = stat_tbl + i; - winetest_push_context( "%d", i ); + winetest_push_context( "%ld", i );
ok( row->DestinationPrefix.Prefix.si_family == family, "mismatch\n" );
@@ -811,31 +811,31 @@ static void test_tcp_stats( int family )
err = NsiGetAllParameters( 1, &NPI_MS_TCP_MODULEID, NSI_TCP_STATS_TABLE, &key, sizeof(key), NULL, 0, &dyn, sizeof(dyn), &stat, sizeof(stat) ); - ok( !err, "got %x\n", err ); + ok( !err, "got %lx\n", err );
err = GetTcpStatisticsEx( &table, family ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err );
err = NsiGetAllParameters( 1, &NPI_MS_TCP_MODULEID, NSI_TCP_STATS_TABLE, &key, sizeof(key), NULL, 0, &dyn2, sizeof(dyn), NULL, 0 ); - ok( !err, "got %x\n", err ); + ok( !err, "got %lx\n", err );
- ok( table.dwRtoAlgorithm == stat.rto_algo, "%d vs %d\n", table.dwRtoAlgorithm, stat.rto_algo ); - ok( table.dwRtoMin == stat.rto_min, "%d vs %d\n", table.dwRtoMin, stat.rto_min ); - ok( table.dwRtoMax == stat.rto_max, "%d vs %d\n", table.dwRtoMax, stat.rto_max ); - ok( table.dwMaxConn == stat.max_conns, "%d vs %d\n", table.dwMaxConn, stat.max_conns ); + ok( table.dwRtoAlgorithm == stat.rto_algo, "%ld vs %d\n", table.dwRtoAlgorithm, stat.rto_algo ); + ok( table.dwRtoMin == stat.rto_min, "%ld vs %d\n", table.dwRtoMin, stat.rto_min ); + ok( table.dwRtoMax == stat.rto_max, "%ld vs %d\n", table.dwRtoMax, stat.rto_max ); + ok( table.dwMaxConn == stat.max_conns, "%ld vs %d\n", table.dwMaxConn, stat.max_conns );
- ok( unstable( table.dwActiveOpens == dyn.active_opens ), "%d vs %d\n", table.dwActiveOpens, dyn.active_opens ); - ok( unstable( table.dwPassiveOpens == dyn.passive_opens ), "%d vs %d\n", table.dwPassiveOpens, dyn.passive_opens ); + ok( unstable( table.dwActiveOpens == dyn.active_opens ), "%ld vs %d\n", table.dwActiveOpens, dyn.active_opens ); + ok( unstable( table.dwPassiveOpens == dyn.passive_opens ), "%ld vs %d\n", table.dwPassiveOpens, dyn.passive_opens ); expect_bounded( "dwAttemptFails", table.dwAttemptFails, dyn.attempt_fails, dyn2.attempt_fails ); expect_bounded( "dwEstabResets", table.dwEstabResets, dyn.est_rsts, dyn2.est_rsts ); - ok( unstable( table.dwCurrEstab == dyn.cur_est ), "%d vs %d\n", table.dwCurrEstab, dyn.cur_est ); + ok( unstable( table.dwCurrEstab == dyn.cur_est ), "%ld vs %d\n", table.dwCurrEstab, dyn.cur_est ); expect_bounded( "dwInSegs", table.dwInSegs, dyn.in_segs, dyn2.in_segs ); expect_bounded( "dwOutSegs", table.dwOutSegs, dyn.out_segs, dyn2.out_segs ); expect_bounded( "dwRetransSegs", table.dwRetransSegs, dyn.retrans_segs, dyn2.retrans_segs ); expect_bounded( "dwInErrs", table.dwInErrs, dyn.in_errs, dyn2.in_errs ); expect_bounded( "dwOutRsts", table.dwOutRsts, dyn.out_rsts, dyn2.out_rsts ); - ok( unstable( table.dwNumConns == dyn.num_conns ), "%d vs %d\n", table.dwNumConns, dyn.num_conns ); + ok( unstable( table.dwNumConns == dyn.num_conns ), "%ld vs %d\n", table.dwNumConns, dyn.num_conns );
winetest_pop_context(); } @@ -868,7 +868,7 @@ static void test_tcp_tables( int family, int table_type ) (void **)&dyn_tbl, dyn_sizes[i], (void **)&stat, sizeof(*stat), &count, 0 ); if (!err) break; } - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err ); dyn_size = dyn_sizes[i];
size = 0; @@ -877,7 +877,7 @@ static void test_tcp_tables( int family, int table_type ) table = malloc( size ); table6 = (MIB_TCP6TABLE_OWNER_MODULE *)table; err = GetExtendedTcpTable( table, &size, 0, family, table_type, 0 ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err );
row = table->table; row6 = table6->table; @@ -889,16 +889,16 @@ static void test_tcp_tables( int family, int table_type )
if (family == AF_INET) { - ok( unstable( row->dwLocalAddr == keys[i].local.Ipv4.sin_addr.s_addr ), "%08x vs %08x\n", + ok( unstable( row->dwLocalAddr == keys[i].local.Ipv4.sin_addr.s_addr ), "%08lx vs %08lx\n", row->dwLocalAddr, keys[i].local.Ipv4.sin_addr.s_addr ); - ok( unstable( row->dwLocalPort == keys[i].local.Ipv4.sin_port ), "%d vs %d\n", + ok( unstable( row->dwLocalPort == keys[i].local.Ipv4.sin_port ), "%ld vs %d\n", row->dwLocalPort, keys[i].local.Ipv4.sin_port ); - ok( unstable( row->dwRemoteAddr == keys[i].remote.Ipv4.sin_addr.s_addr ), "%08x vs %08x\n", + ok( unstable( row->dwRemoteAddr == keys[i].remote.Ipv4.sin_addr.s_addr ), "%08lx vs %08lx\n", row->dwRemoteAddr, keys[i].remote.Ipv4.sin_addr.s_addr ); - ok( unstable( row->dwRemotePort == keys[i].remote.Ipv4.sin_port ), "%d vs %d\n", + ok( unstable( row->dwRemotePort == keys[i].remote.Ipv4.sin_port ), "%ld vs %d\n", row->dwRemotePort, keys[i].remote.Ipv4.sin_port ); - ok( unstable( row->dwState == dyn->state ), "%x vs %x\n", row->dwState, dyn->state ); - ok( unstable( row->dwOwningPid == stat[i].pid ), "%x vs %x\n", row->dwOwningPid, stat[i].pid ); + ok( unstable( row->dwState == dyn->state ), "%lx vs %x\n", row->dwState, dyn->state ); + ok( unstable( row->dwOwningPid == stat[i].pid ), "%lx vs %x\n", row->dwOwningPid, stat[i].pid ); ok( unstable( row->liCreateTimestamp.QuadPart == stat[i].create_time ), "mismatch\n" ); ok( unstable( row->OwningModuleInfo[0] == stat[i].mod_info ), "mismatch\n"); row++; @@ -907,18 +907,18 @@ static void test_tcp_tables( int family, int table_type ) { ok( unstable( !memcmp( row6->ucLocalAddr, keys[i].local.Ipv6.sin6_addr.s6_addr, sizeof(IN6_ADDR) ) ), "mismatch\n" ); - ok( unstable( row6->dwLocalScopeId == keys[i].local.Ipv6.sin6_scope_id ), "%x vs %x\n", + ok( unstable( row6->dwLocalScopeId == keys[i].local.Ipv6.sin6_scope_id ), "%lx vs %lx\n", row6->dwLocalScopeId, keys[i].local.Ipv6.sin6_scope_id ); - ok( unstable( row6->dwLocalPort == keys[i].local.Ipv6.sin6_port ), "%d vs %d\n", + ok( unstable( row6->dwLocalPort == keys[i].local.Ipv6.sin6_port ), "%ld vs %d\n", row6->dwLocalPort, keys[i].local.Ipv6.sin6_port ); ok( unstable( !memcmp( row6->ucRemoteAddr, keys[i].remote.Ipv6.sin6_addr.s6_addr, sizeof(IN6_ADDR) ) ), "mismatch\n" ); - ok( unstable( row6->dwRemoteScopeId == keys[i].remote.Ipv6.sin6_scope_id ), "%x vs %x\n", + ok( unstable( row6->dwRemoteScopeId == keys[i].remote.Ipv6.sin6_scope_id ), "%lx vs %lx\n", row6->dwRemoteScopeId, keys[i].remote.Ipv6.sin6_scope_id ); - ok( unstable( row6->dwRemotePort == keys[i].remote.Ipv6.sin6_port ), "%d vs %d\n", + ok( unstable( row6->dwRemotePort == keys[i].remote.Ipv6.sin6_port ), "%ld vs %d\n", row6->dwRemotePort, keys[i].remote.Ipv6.sin6_port ); - ok( unstable( row6->dwState == dyn->state ), "%x vs %x\n", row6->dwState, dyn->state ); - ok( unstable( row6->dwOwningPid == stat[i].pid ), "%x vs %x\n", row6->dwOwningPid, stat[i].pid ); + ok( unstable( row6->dwState == dyn->state ), "%lx vs %x\n", row6->dwState, dyn->state ); + ok( unstable( row6->dwOwningPid == stat[i].pid ), "%lx vs %x\n", row6->dwOwningPid, stat[i].pid ); ok( unstable( row6->liCreateTimestamp.QuadPart == stat[i].create_time ), "mismatch\n" ); ok( unstable( row6->OwningModuleInfo[0] == stat[i].mod_info ), "mismatch\n"); row6++; @@ -941,20 +941,20 @@ static void test_udp_stats( int family )
err = NsiGetAllParameters( 1, &NPI_MS_UDP_MODULEID, NSI_UDP_STATS_TABLE, &key, sizeof(key), NULL, 0, &dyn, sizeof(dyn), NULL, 0 ); - ok( !err, "got %x\n", err ); + ok( !err, "got %lx\n", err );
err = GetUdpStatisticsEx( &table, family ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err );
err = NsiGetAllParameters( 1, &NPI_MS_UDP_MODULEID, NSI_UDP_STATS_TABLE, &key, sizeof(key), NULL, 0, &dyn2, sizeof(dyn2), NULL, 0 ); - ok( !err, "got %x\n", err ); + ok( !err, "got %lx\n", err );
expect_bounded( "dwInDatagrams", table.dwInDatagrams, dyn.in_dgrams, dyn2.in_dgrams ); expect_bounded( "dwNoPorts", table.dwNoPorts, dyn.no_ports, dyn2.no_ports ); expect_bounded( "dwInErrors", table.dwInErrors, dyn.in_errs, dyn2.in_errs ); expect_bounded( "dwOutDatagrams", table.dwOutDatagrams, dyn.out_dgrams, dyn2.out_dgrams ); - ok( unstable( table.dwNumAddrs == dyn.num_addrs ), "%d %d\n", table.dwNumAddrs, dyn.num_addrs ); + ok( unstable( table.dwNumAddrs == dyn.num_addrs ), "%ld %d\n", table.dwNumAddrs, dyn.num_addrs );
winetest_pop_context(); } @@ -973,7 +973,7 @@ static void test_udp_tables( int family )
err = NsiAllocateAndGetTable( 1, &NPI_MS_UDP_MODULEID, NSI_UDP_ENDPOINT_TABLE, (void **)&keys, sizeof(*keys), NULL, 0, NULL, 0, (void **)&stat, sizeof(*stat), &count, 0 ); - ok( !err, "got %x\n", err ); + ok( !err, "got %lx\n", err );
size = 0; err = GetExtendedUdpTable( NULL, &size, 0, family, UDP_TABLE_OWNER_MODULE, 0 ); @@ -981,7 +981,7 @@ static void test_udp_tables( int family ) table = malloc( size ); table6 = (MIB_UDP6TABLE_OWNER_MODULE *)table; err = GetExtendedUdpTable( table, &size, 0, family, UDP_TABLE_OWNER_MODULE, 0 ); - ok( !err, "got %d\n", err ); + ok( !err, "got %ld\n", err );
row = table->table; row6 = table6->table; @@ -992,11 +992,11 @@ static void test_udp_tables( int family )
if (family == AF_INET) { - ok( unstable( row->dwLocalAddr == keys[i].local.Ipv4.sin_addr.s_addr ), "%08x vs %08x\n", + ok( unstable( row->dwLocalAddr == keys[i].local.Ipv4.sin_addr.s_addr ), "%08lx vs %08lx\n", row->dwLocalAddr, keys[i].local.Ipv4.sin_addr.s_addr ); - ok( unstable( row->dwLocalPort == keys[i].local.Ipv4.sin_port ), "%d vs %d\n", + ok( unstable( row->dwLocalPort == keys[i].local.Ipv4.sin_port ), "%ld vs %d\n", row->dwLocalPort, keys[i].local.Ipv4.sin_port ); - ok( unstable( row->dwOwningPid == stat[i].pid ), "%x vs %x\n", row->dwOwningPid, stat[i].pid ); + ok( unstable( row->dwOwningPid == stat[i].pid ), "%lx vs %x\n", row->dwOwningPid, stat[i].pid ); ok( unstable( row->liCreateTimestamp.QuadPart == stat[i].create_time ), "mismatch\n" ); ok( unstable( row->dwFlags == stat[i].flags ), "%x vs %x\n", row->dwFlags, stat[i].flags ); ok( unstable( row->OwningModuleInfo[0] == stat[i].mod_info ), "mismatch\n"); @@ -1006,11 +1006,11 @@ static void test_udp_tables( int family ) { ok( unstable( !memcmp( row6->ucLocalAddr, keys[i].local.Ipv6.sin6_addr.s6_addr, sizeof(IN6_ADDR) ) ), "mismatch\n" ); - ok( unstable( row6->dwLocalScopeId == keys[i].local.Ipv6.sin6_scope_id ), "%x vs %x\n", + ok( unstable( row6->dwLocalScopeId == keys[i].local.Ipv6.sin6_scope_id ), "%lx vs %lx\n", row6->dwLocalScopeId, keys[i].local.Ipv6.sin6_scope_id ); - ok( unstable( row6->dwLocalPort == keys[i].local.Ipv6.sin6_port ), "%d vs %d\n", + ok( unstable( row6->dwLocalPort == keys[i].local.Ipv6.sin6_port ), "%ld vs %d\n", row6->dwLocalPort, keys[i].local.Ipv6.sin6_port ); - ok( unstable( row6->dwOwningPid == stat[i].pid ), "%x vs %x\n", row6->dwOwningPid, stat[i].pid ); + ok( unstable( row6->dwOwningPid == stat[i].pid ), "%lx vs %x\n", row6->dwOwningPid, stat[i].pid ); ok( unstable( row6->liCreateTimestamp.QuadPart == stat[i].create_time ), "mismatch\n" ); ok( unstable( row6->dwFlags == stat[i].flags ), "%x vs %x\n", row6->dwFlags, stat[i].flags ); ok( unstable( row6->OwningModuleInfo[0] == stat[i].mod_info ), "mismatch\n");
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/nsiproxy.sys/ip.c | 84 +++++++++++++++++----------------- dlls/nsiproxy.sys/ndis.c | 20 ++++---- dlls/nsiproxy.sys/nsiproxy_private.h | 18 ++++--- dlls/nsiproxy.sys/tcp.c | 32 ++++++------- dlls/nsiproxy.sys/udp.c | 16 +++--- dlls/nsiproxy.sys/unix_private.h | 36 +++++++-------- 6 files changed, 103 insertions(+), 103 deletions(-)
diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c index 3194dd155249..15c039858084 100644 --- a/dlls/nsiproxy.sys/ip.c +++ b/dlls/nsiproxy.sys/ip.c @@ -151,10 +151,10 @@ static NTSTATUS read_sysctl_int( const char *file, int *val ) } #endif
-static NTSTATUS ip_cmpt_get_all_parameters( DWORD fam, const DWORD *key, DWORD key_size, - struct nsi_ip_cmpt_rw *rw_data, DWORD rw_size, - struct nsi_ip_cmpt_dynamic *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size ) +static NTSTATUS ip_cmpt_get_all_parameters( UINT fam, const UINT *key, UINT key_size, + struct nsi_ip_cmpt_rw *rw_data, UINT rw_size, + struct nsi_ip_cmpt_dynamic *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size ) { const NPI_MODULEID *ip_mod = (fam == AF_INET) ? &NPI_MS_IPV4_MODULEID : &NPI_MS_IPV6_MODULEID; struct nsi_ip_cmpt_rw rw; @@ -219,8 +219,8 @@ static NTSTATUS ip_cmpt_get_all_parameters( DWORD fam, const DWORD *key, DWORD k return STATUS_SUCCESS; }
-static NTSTATUS ipv4_cmpt_get_all_parameters( const void *key, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size ) +static NTSTATUS ipv4_cmpt_get_all_parameters( const void *key, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size ) { TRACE( "%p %d %p %d %p %d %p %d\n", key, key_size, rw_data, rw_size, dynamic_data, dynamic_size, static_data, static_size ); @@ -228,8 +228,8 @@ static NTSTATUS ipv4_cmpt_get_all_parameters( const void *key, DWORD key_size, v dynamic_data, dynamic_size, static_data, static_size ); }
-static NTSTATUS ipv6_cmpt_get_all_parameters( const void *key, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size ) +static NTSTATUS ipv6_cmpt_get_all_parameters( const void *key, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size ) { TRACE( "%p %d %p %d %p %d %p %d\n", key, key_size, rw_data, rw_size, dynamic_data, dynamic_size, static_data, static_size ); @@ -237,8 +237,8 @@ static NTSTATUS ipv6_cmpt_get_all_parameters( const void *key, DWORD key_size, v dynamic_data, dynamic_size, static_data, static_size ); }
-static NTSTATUS ipv4_icmpstats_get_all_parameters( const void *key, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size ) +static NTSTATUS ipv4_icmpstats_get_all_parameters( const void *key, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size ) { struct nsi_ip_icmpstats_dynamic dyn;
@@ -352,8 +352,8 @@ static NTSTATUS ipv4_icmpstats_get_all_parameters( const void *key, DWORD key_si #endif }
-static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size ) +static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size ) { struct nsi_ip_icmpstats_dynamic dyn;
@@ -478,8 +478,8 @@ static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, DWORD key_si #endif }
-static NTSTATUS ipv4_ipstats_get_all_parameters( const void *key, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size ) +static NTSTATUS ipv4_ipstats_get_all_parameters( const void *key, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size ) { struct nsi_ip_ipstats_dynamic dyn; struct nsi_ip_ipstats_static stat; @@ -584,8 +584,8 @@ static NTSTATUS ipv4_ipstats_get_all_parameters( const void *key, DWORD key_size #endif }
-static NTSTATUS ipv6_ipstats_get_all_parameters( const void *key, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size ) +static NTSTATUS ipv6_ipstats_get_all_parameters( const void *key, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size ) { struct nsi_ip_ipstats_dynamic dyn; struct nsi_ip_ipstats_static stat; @@ -719,9 +719,9 @@ static void unicast_fill_entry( struct ifaddrs *entry, void *key, struct nsi_ip_ if (stat) stat->creation_time = get_boot_time(); }
-static NTSTATUS ip_unicast_enumerate_all( int family, void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS ip_unicast_enumerate_all( int family, void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ) { DWORD num = 0; NTSTATUS status = STATUS_SUCCESS; @@ -756,25 +756,25 @@ static NTSTATUS ip_unicast_enumerate_all( int family, void *key_data, DWORD key_ return status; }
-static NTSTATUS ipv4_unicast_enumerate_all( void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS ipv4_unicast_enumerate_all( void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ) { return ip_unicast_enumerate_all( AF_INET, key_data, key_size, rw_data, rw_size, dynamic_data, dynamic_size, static_data, static_size, count ); }
-static NTSTATUS ipv6_unicast_enumerate_all( void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS ipv6_unicast_enumerate_all( void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ) { return ip_unicast_enumerate_all( AF_INET6, key_data, key_size, rw_data, rw_size, dynamic_data, dynamic_size, static_data, static_size, count ); }
-static NTSTATUS ip_unicast_get_all_parameters( const void *key, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size ) +static NTSTATUS ip_unicast_get_all_parameters( const void *key, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size ) { int family = (key_size == sizeof(struct nsi_ipv4_unicast_key)) ? AF_INET : AF_INET6; NTSTATUS status = STATUS_NOT_FOUND; @@ -812,7 +812,7 @@ static NTSTATUS ip_unicast_get_all_parameters( const void *key, DWORD key_size, struct ipv4_neighbour_data { NET_LUID luid; - DWORD if_index; + UINT if_index; struct in_addr addr; BYTE phys_addr[IF_MAX_PHYS_ADDRESS_LENGTH]; DWORD state; @@ -850,9 +850,9 @@ static void ipv4_neighbour_fill_entry( struct ipv4_neighbour_data *entry, struct } }
-static NTSTATUS ipv4_neighbour_enumerate_all( void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS ipv4_neighbour_enumerate_all( void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ) { DWORD num = 0; NTSTATUS status = STATUS_SUCCESS; @@ -992,9 +992,9 @@ static NTSTATUS ipv4_neighbour_enumerate_all( void *key_data, DWORD key_size, vo return status; }
-static NTSTATUS ipv6_neighbour_enumerate_all( void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS ipv6_neighbour_enumerate_all( void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ) { FIXME( "not implemented\n" ); return STATUS_NOT_IMPLEMENTED; @@ -1003,7 +1003,7 @@ static NTSTATUS ipv6_neighbour_enumerate_all( void *key_data, DWORD key_size, vo struct ipv4_route_data { NET_LUID luid; - DWORD if_index; + UINT if_index; struct in_addr prefix; DWORD prefix_len; struct in_addr next_hop; @@ -1056,9 +1056,9 @@ static void ipv4_forward_fill_entry( struct ipv4_route_data *entry, struct nsi_i } }
-static NTSTATUS ipv4_forward_enumerate_all( void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS ipv4_forward_enumerate_all( void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ) { DWORD num = 0; NTSTATUS status = STATUS_SUCCESS; @@ -1235,9 +1235,9 @@ static NTSTATUS ipv4_forward_enumerate_all( void *key_data, DWORD key_size, void return status; }
-static NTSTATUS ipv6_forward_enumerate_all( void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS ipv6_forward_enumerate_all( void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ) { FIXME( "not implemented\n" ); *count = 0; diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c index 036e8f1eb0cb..34d20b4be7fe 100644 --- a/dlls/nsiproxy.sys/ndis.c +++ b/dlls/nsiproxy.sys/ndis.c @@ -446,9 +446,9 @@ static void ifinfo_fill_entry( struct if_entry *entry, NET_LUID *key, struct nsi } }
-static NTSTATUS ifinfo_enumerate_all( void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS ifinfo_enumerate_all( void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ) { struct if_entry *entry; DWORD num = 0; @@ -483,9 +483,9 @@ static NTSTATUS ifinfo_enumerate_all( void *key_data, DWORD key_size, void *rw_d return status; }
-static NTSTATUS ifinfo_get_all_parameters( const void *key, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size ) +static NTSTATUS ifinfo_get_all_parameters( const void *key, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size ) { struct if_entry *entry; NTSTATUS status = STATUS_OBJECT_NAME_NOT_FOUND; @@ -547,8 +547,8 @@ static NTSTATUS ifinfo_get_static_parameter( struct if_entry *entry, void *data, return STATUS_INVALID_PARAMETER; }
-static NTSTATUS ifinfo_get_parameter( const void *key, DWORD key_size, DWORD param_type, - void *data, DWORD data_size, DWORD data_offset ) +static NTSTATUS ifinfo_get_parameter( const void *key, UINT key_size, UINT param_type, + void *data, UINT data_size, UINT data_offset ) { struct if_entry *entry; NTSTATUS status = STATUS_OBJECT_NAME_NOT_FOUND; @@ -578,8 +578,8 @@ static NTSTATUS ifinfo_get_parameter( const void *key, DWORD key_size, DWORD par return status; }
-static NTSTATUS index_luid_get_parameter( const void *key, DWORD key_size, DWORD param_type, - void *data, DWORD data_size, DWORD data_offset ) +static NTSTATUS index_luid_get_parameter( const void *key, UINT key_size, UINT param_type, + void *data, UINT data_size, UINT data_offset ) { struct if_entry *entry; NTSTATUS status = STATUS_OBJECT_NAME_NOT_FOUND; diff --git a/dlls/nsiproxy.sys/nsiproxy_private.h b/dlls/nsiproxy.sys/nsiproxy_private.h index bdea1c6cf2ef..4bd269a06914 100644 --- a/dlls/nsiproxy.sys/nsiproxy_private.h +++ b/dlls/nsiproxy.sys/nsiproxy_private.h @@ -30,7 +30,7 @@ struct icmp_send_echo_params { SOCKADDR_INET *dst; void *request, *reply; - DWORD request_size, reply_len; + UINT request_size, reply_len; BYTE bits, ttl, tos; HANDLE handle; }; @@ -38,27 +38,27 @@ struct icmp_send_echo_params /* output for IOCTL_NSIPROXY_WINE_ICMP_ECHO - cf. ICMP_ECHO_REPLY */ struct icmp_echo_reply_32 { - ULONG addr; - ULONG status; - ULONG round_trip_time; + UINT addr; + UINT status; + UINT round_trip_time; USHORT data_size; USHORT num_of_pkts; - ULONG data_ptr; + UINT data_ptr; struct { BYTE ttl; BYTE tos; BYTE flags; BYTE options_size; - ULONG options_ptr; + UINT options_ptr; } opts; };
struct icmp_echo_reply_64 { - ULONG addr; - ULONG status; - ULONG round_trip_time; + UINT addr; + UINT status; + UINT round_trip_time; USHORT data_size; USHORT num_of_pkts; ULONGLONG data_ptr; diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c index 491ac797100f..95f99c06f98f 100644 --- a/dlls/nsiproxy.sys/tcp.c +++ b/dlls/nsiproxy.sys/tcp.c @@ -111,8 +111,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(nsi);
-static NTSTATUS tcp_stats_get_all_parameters( const void *key, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size ) +static NTSTATUS tcp_stats_get_all_parameters( const void *key, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size ) { struct nsi_tcp_stats_dynamic dyn; struct nsi_tcp_stats_static stat; @@ -322,7 +322,7 @@ failed: return NULL; }
-DWORD find_ipv6_addr_scope( const IN6_ADDR *addr, const struct ipv6_addr_scope *table, unsigned int size ) +UINT find_ipv6_addr_scope( const IN6_ADDR *addr, const struct ipv6_addr_scope *table, unsigned int size ) { const BYTE multicast_scope_mask = 0x0F; const BYTE multicast_scope_shift = 0; @@ -514,10 +514,10 @@ unsigned int find_owning_pid( struct pid_map *map, unsigned int num_entries, UIN #endif }
-static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key *key_data, DWORD key_size, - void *rw, DWORD rw_size, - struct nsi_tcp_conn_dynamic *dynamic_data, DWORD dynamic_size, - struct nsi_tcp_conn_static *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS tcp_conns_enumerate_all( UINT filter, struct nsi_tcp_conn_key *key_data, UINT key_size, + void *rw, UINT rw_size, + struct nsi_tcp_conn_dynamic *dynamic_data, UINT dynamic_size, + struct nsi_tcp_conn_static *static_data, UINT static_size, UINT_PTR *count ) { DWORD num = 0; NTSTATUS status = STATUS_SUCCESS; @@ -741,9 +741,9 @@ static NTSTATUS tcp_conns_enumerate_all( DWORD filter, struct nsi_tcp_conn_key * return status; }
-static NTSTATUS tcp_all_enumerate_all( void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS tcp_all_enumerate_all( void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ) { TRACE( "%p %d %p %d %p %d %p %d %p\n", key_data, key_size, rw_data, rw_size, dynamic_data, dynamic_size, static_data, static_size, count ); @@ -752,9 +752,9 @@ static NTSTATUS tcp_all_enumerate_all( void *key_data, DWORD key_size, void *rw_ dynamic_data, dynamic_size, static_data, static_size, count ); }
-static NTSTATUS tcp_estab_enumerate_all( void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS tcp_estab_enumerate_all( void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ) { TRACE( "%p %d %p %d %p %d %p %d %p\n", key_data, key_size, rw_data, rw_size, dynamic_data, dynamic_size, static_data, static_size, count ); @@ -763,9 +763,9 @@ static NTSTATUS tcp_estab_enumerate_all( void *key_data, DWORD key_size, void *r dynamic_data, dynamic_size, static_data, static_size, count ); }
-static NTSTATUS tcp_listen_enumerate_all( void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS tcp_listen_enumerate_all( void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ) { TRACE( "%p %d %p %d %p %d %p %d %p\n", key_data, key_size, rw_data, rw_size, dynamic_data, dynamic_size, static_data, static_size, count ); diff --git a/dlls/nsiproxy.sys/udp.c b/dlls/nsiproxy.sys/udp.c index fe05bc875cf1..1bcbb2532bd0 100644 --- a/dlls/nsiproxy.sys/udp.c +++ b/dlls/nsiproxy.sys/udp.c @@ -83,9 +83,9 @@
WINE_DEFAULT_DEBUG_CHANNEL(nsi);
-static DWORD udp_num_addrs( USHORT family ) +static UINT udp_num_addrs( USHORT family ) { - DWORD endpoint_count = 0; + UINT endpoint_count = 0;
nsi_enumerate_all( 1, 0, &NPI_MS_UDP_MODULEID, NSI_UDP_ENDPOINT_TABLE, NULL, 0, NULL, 0, NULL, 0, NULL, 0, &endpoint_count ); @@ -93,8 +93,8 @@ static DWORD udp_num_addrs( USHORT family ) return endpoint_count; }
-static NTSTATUS udp_stats_get_all_parameters( const void *key, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size ) +static NTSTATUS udp_stats_get_all_parameters( const void *key, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size ) { struct nsi_udp_stats_dynamic dyn; const USHORT *family = key; @@ -145,7 +145,7 @@ static NTSTATUS udp_stats_get_all_parameters( const void *key, DWORD key_size, v struct { const char *name; - DWORD *elem; + UINT *elem; } udp_stat_list[] = { { "Udp6InDatagrams", &in_dgrams }, @@ -202,9 +202,9 @@ static NTSTATUS udp_stats_get_all_parameters( const void *key, DWORD key_size, v return STATUS_NOT_SUPPORTED; }
-static NTSTATUS udp_endpoint_enumerate_all( void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ) +static NTSTATUS udp_endpoint_enumerate_all( void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ) { DWORD num = 0; NTSTATUS status = STATUS_SUCCESS; diff --git a/dlls/nsiproxy.sys/unix_private.h b/dlls/nsiproxy.sys/unix_private.h index ffb48cc73804..8ab56f6d9a30 100644 --- a/dlls/nsiproxy.sys/unix_private.h +++ b/dlls/nsiproxy.sys/unix_private.h @@ -22,10 +22,10 @@ NTSTATUS nsi_enumerate_all_ex( struct nsi_enumerate_all_ex *params ) DECLSPEC_HI NTSTATUS nsi_get_all_parameters_ex( struct nsi_get_all_parameters_ex *params ) DECLSPEC_HIDDEN; NTSTATUS nsi_get_parameter_ex( struct nsi_get_parameter_ex *params ) DECLSPEC_HIDDEN;
-static inline NTSTATUS nsi_enumerate_all( DWORD unk, DWORD unk2, const NPI_MODULEID *module, DWORD table, - void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size, - DWORD *count ) +static inline NTSTATUS nsi_enumerate_all( UINT unk, UINT unk2, const NPI_MODULEID *module, UINT table, + void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size, + UINT *count ) { struct nsi_enumerate_all_ex params; NTSTATUS status; @@ -54,7 +54,7 @@ static inline NTSTATUS nsi_enumerate_all( DWORD unk, DWORD unk2, const NPI_MODUL BOOL convert_luid_to_unix_name( const NET_LUID *luid, const char **unix_name ) DECLSPEC_HIDDEN; BOOL convert_unix_name_to_luid( const char *unix_name, NET_LUID *luid ) DECLSPEC_HIDDEN;
-static inline BOOL convert_luid_to_index( const NET_LUID *luid, DWORD *index ) +static inline BOOL convert_luid_to_index( const NET_LUID *luid, UINT *index ) { struct nsi_get_parameter_ex params; params.unknown[0] = 0; @@ -73,7 +73,7 @@ static inline BOOL convert_luid_to_index( const NET_LUID *luid, DWORD *index ) return !nsi_get_parameter_ex( ¶ms ); }
-static inline BOOL convert_index_to_luid( DWORD index, NET_LUID *luid ) +static inline BOOL convert_index_to_luid( UINT index, NET_LUID *luid ) { struct nsi_get_parameter_ex params; params.unknown[0] = 0; @@ -95,11 +95,11 @@ static inline BOOL convert_index_to_luid( DWORD index, NET_LUID *luid ) struct ipv6_addr_scope { IN6_ADDR addr; - DWORD scope; + UINT scope; };
struct ipv6_addr_scope *get_ipv6_addr_scope_table( unsigned int *size ) DECLSPEC_HIDDEN; -DWORD find_ipv6_addr_scope( const IN6_ADDR *addr, const struct ipv6_addr_scope *table, unsigned int size ) DECLSPEC_HIDDEN; +UINT find_ipv6_addr_scope( const IN6_ADDR *addr, const struct ipv6_addr_scope *table, unsigned int size ) DECLSPEC_HIDDEN;
struct pid_map { @@ -112,16 +112,16 @@ unsigned int find_owning_pid( struct pid_map *map, unsigned int num_entries, UIN
struct module_table { - DWORD table; - DWORD sizes[4]; - NTSTATUS (*enumerate_all)( void *key_data, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size, DWORD_PTR *count ); - NTSTATUS (*get_all_parameters)( const void *key, DWORD key_size, void *rw_data, DWORD rw_size, - void *dynamic_data, DWORD dynamic_size, - void *static_data, DWORD static_size ); - NTSTATUS (*get_parameter)( const void *key, DWORD key_size, DWORD param_type, - void *data, DWORD data_size, DWORD data_offset ); + UINT table; + UINT sizes[4]; + NTSTATUS (*enumerate_all)( void *key_data, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size, UINT_PTR *count ); + NTSTATUS (*get_all_parameters)( const void *key, UINT key_size, void *rw_data, UINT rw_size, + void *dynamic_data, UINT dynamic_size, + void *static_data, UINT static_size ); + NTSTATUS (*get_parameter)( const void *key, UINT key_size, UINT param_type, + void *data, UINT data_size, UINT data_offset ); };
struct module
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/nsiproxy.sys/device.c | 6 ++--- dlls/nsiproxy.sys/icmp_echo.c | 2 +- dlls/nsiproxy.sys/ip.c | 50 +++++++++++++++++++++-------------------- dlls/nsiproxy.sys/ndis.c | 30 ++++++++++++------------- dlls/nsiproxy.sys/nsi.c | 4 ++- dlls/nsiproxy.sys/tcp.c | 10 ++++---- dlls/nsiproxy.sys/udp.c | 6 ++--- 7 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/dlls/nsiproxy.sys/device.c b/dlls/nsiproxy.sys/device.c index 9e0a1d1f6a13..cc9b00d33590 100644 --- a/dlls/nsiproxy.sys/device.c +++ b/dlls/nsiproxy.sys/device.c @@ -79,7 +79,7 @@ static NTSTATUS nsiproxy_enumerate_all( IRP *irp )
if (in_len != sizeof(*in)) return STATUS_INVALID_PARAMETER;
- if (out_len < sizeof(DWORD) + (in->key_size + in->rw_size + in->dynamic_size + in->static_size) * in->count) + if (out_len < sizeof(UINT) + (in->key_size + in->rw_size + in->dynamic_size + in->static_size) * in->count) return STATUS_INVALID_PARAMETER;
enum_all.unknown[0] = 0; @@ -88,7 +88,7 @@ static NTSTATUS nsiproxy_enumerate_all( IRP *irp ) enum_all.second_arg = in->second_arg; enum_all.module = &in->module; enum_all.table = in->table; - enum_all.key_data = (BYTE *)out + sizeof(DWORD); + enum_all.key_data = (BYTE *)out + sizeof(UINT); enum_all.key_size = in->key_size; enum_all.rw_data = (BYTE *)enum_all.key_data + in->key_size * in->count; enum_all.rw_size = in->rw_size; @@ -102,7 +102,7 @@ static NTSTATUS nsiproxy_enumerate_all( IRP *irp ) if (status == STATUS_SUCCESS || status == STATUS_BUFFER_OVERFLOW) { irp->IoStatus.Information = out_len; - *(DWORD *)out = enum_all.count; + *(UINT *)out = enum_all.count; } else irp->IoStatus.Information = 0;
diff --git a/dlls/nsiproxy.sys/icmp_echo.c b/dlls/nsiproxy.sys/icmp_echo.c index 5f2b776745a9..c3ce841c003e 100644 --- a/dlls/nsiproxy.sys/icmp_echo.c +++ b/dlls/nsiproxy.sys/icmp_echo.c @@ -666,7 +666,7 @@ NTSTATUS icmp_send_echo( void *args ) return params->handle ? STATUS_PENDING : STATUS_NO_MEMORY; }
-static int get_timeout( LARGE_INTEGER start, DWORD timeout ) +static int get_timeout( LARGE_INTEGER start, UINT timeout ) { LARGE_INTEGER now, end;
diff --git a/dlls/nsiproxy.sys/ip.c b/dlls/nsiproxy.sys/ip.c index 15c039858084..b8fff704f385 100644 --- a/dlls/nsiproxy.sys/ip.c +++ b/dlls/nsiproxy.sys/ip.c @@ -99,7 +99,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(nsi);
-static inline DWORD nsi_popcount( DWORD m ) +static inline UINT nsi_popcount( UINT m ) { #ifdef HAVE___BUILTIN_POPCOUNT return __builtin_popcount( m ); @@ -110,19 +110,19 @@ static inline DWORD nsi_popcount( DWORD m ) #endif }
-static DWORD mask_v4_to_prefix( struct in_addr *addr ) +static UINT mask_v4_to_prefix( struct in_addr *addr ) { return nsi_popcount( addr->s_addr ); }
-static DWORD mask_v6_to_prefix( struct in6_addr *addr ) +static UINT mask_v6_to_prefix( struct in6_addr *addr ) { - DWORD ret; + UINT ret;
- ret = nsi_popcount( *(DWORD *)addr->s6_addr ); - ret += nsi_popcount( *(DWORD *)(addr->s6_addr + 4) ); - ret += nsi_popcount( *(DWORD *)(addr->s6_addr + 8) ); - ret += nsi_popcount( *(DWORD *)(addr->s6_addr + 12) ); + ret = nsi_popcount( *(UINT *)addr->s6_addr ); + ret += nsi_popcount( *(UINT *)(addr->s6_addr + 4) ); + ret += nsi_popcount( *(UINT *)(addr->s6_addr + 8) ); + ret += nsi_popcount( *(UINT *)(addr->s6_addr + 12) ); return ret; }
@@ -159,7 +159,7 @@ static NTSTATUS ip_cmpt_get_all_parameters( UINT fam, const UINT *key, UINT key_ const NPI_MODULEID *ip_mod = (fam == AF_INET) ? &NPI_MS_IPV4_MODULEID : &NPI_MS_IPV6_MODULEID; struct nsi_ip_cmpt_rw rw; struct nsi_ip_cmpt_dynamic dyn; - DWORD count; + UINT count;
memset( &rw, 0, sizeof(rw) ); memset( &dyn, 0, sizeof(dyn) ); @@ -367,7 +367,7 @@ static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, UINT key_siz struct data { const char *name; - DWORD pos; + UINT pos; }; static const struct data in_list[] = { @@ -406,7 +406,7 @@ static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, UINT key_siz { "Icmp6OutMLDv2Reports", ICMP6_V2_MEMBERSHIP_REPORT }, }; char buf[512], *ptr, *value; - DWORD res, i; + UINT res, i; FILE *fp;
if (!(fp = fopen( "/proc/net/snmp6", "r" ))) return STATUS_NOT_SUPPORTED; @@ -506,7 +506,7 @@ static NTSTATUS ipv4_ipstats_get_all_parameters( const void *key, UINT key_size, if (!(ptr = fgets( buf, sizeof(buf), fp ))) break; if (!ascii_strncasecmp( buf, hdr, sizeof(hdr) - 1 )) { - DWORD in_recv, in_hdr_errs, fwd_dgrams, in_delivers, out_reqs; + UINT in_recv, in_hdr_errs, fwd_dgrams, in_delivers, out_reqs; ptr += sizeof(hdr); sscanf( ptr, "%*u %*u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u", &in_recv, @@ -625,7 +625,7 @@ static NTSTATUS ipv6_ipstats_get_all_parameters( const void *key, UINT key_size, }; NTSTATUS status = STATUS_NOT_SUPPORTED; char buf[512], *ptr, *value; - DWORD i; + UINT i; FILE *fp;
if (!(fp = fopen( "/proc/net/snmp6", "r" ))) return STATUS_NOT_SUPPORTED; @@ -665,7 +665,7 @@ static void unicast_fill_entry( struct ifaddrs *entry, void *key, struct nsi_ip_ { struct nsi_ipv6_unicast_key placeholder, *key6 = key; struct nsi_ipv4_unicast_key *key4 = key; - DWORD scope_id = 0; + UINT scope_id = 0;
if (!key) { @@ -723,7 +723,7 @@ static NTSTATUS ip_unicast_enumerate_all( int family, void *key_data, UINT key_s void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size, UINT_PTR *count ) { - DWORD num = 0; + UINT num = 0; NTSTATUS status = STATUS_SUCCESS; BOOL want_data = key_size || rw_size || dynamic_size || static_size; struct ifaddrs *addrs, *entry; @@ -815,7 +815,7 @@ struct ipv4_neighbour_data UINT if_index; struct in_addr addr; BYTE phys_addr[IF_MAX_PHYS_ADDRESS_LENGTH]; - DWORD state; + UINT state; USHORT phys_addr_len; BOOL is_router; BOOL is_unreachable; @@ -854,7 +854,7 @@ static NTSTATUS ipv4_neighbour_enumerate_all( void *key_data, UINT key_size, voi void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size, UINT_PTR *count ) { - DWORD num = 0; + UINT num = 0; NTSTATUS status = STATUS_SUCCESS; BOOL want_data = key_size || rw_size || dynamic_size || static_size; struct ipv4_neighbour_data entry; @@ -865,7 +865,7 @@ static NTSTATUS ipv4_neighbour_enumerate_all( void *key_data, UINT key_size, voi #ifdef __linux__ { char buf[512], *ptr; - DWORD atf_flags; + UINT atf_flags; FILE *fp;
if (!(fp = fopen( "/proc/net/arp", "r" ))) return STATUS_NOT_SUPPORTED; @@ -1005,10 +1005,10 @@ struct ipv4_route_data NET_LUID luid; UINT if_index; struct in_addr prefix; - DWORD prefix_len; + UINT prefix_len; struct in_addr next_hop; - DWORD metric; - DWORD protocol; + UINT metric; + UINT protocol; BYTE loopback; };
@@ -1060,7 +1060,7 @@ static NTSTATUS ipv4_forward_enumerate_all( void *key_data, UINT key_size, void void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size, UINT_PTR *count ) { - DWORD num = 0; + UINT num = 0; NTSTATUS status = STATUS_SUCCESS; BOOL want_data = key_size || rw_size || dynamic_size || static_size; struct ipv4_route_data entry; @@ -1072,7 +1072,7 @@ static NTSTATUS ipv4_forward_enumerate_all( void *key_data, UINT key_size, void { char buf[512], *ptr; struct in_addr mask; - DWORD rtf_flags; + UINT rtf_flags; FILE *fp;
if (!(fp = fopen( "/proc/net/route", "r" ))) return STATUS_NOT_SUPPORTED; @@ -1249,7 +1249,7 @@ static struct module_table ipv4_tables[] = { NSI_IP_COMPARTMENT_TABLE, { - sizeof(DWORD), sizeof(struct nsi_ip_cmpt_rw), + sizeof(UINT), sizeof(struct nsi_ip_cmpt_rw), sizeof(struct nsi_ip_cmpt_dynamic), 0 }, NULL, @@ -1314,7 +1314,7 @@ static struct module_table ipv6_tables[] = { NSI_IP_COMPARTMENT_TABLE, { - sizeof(DWORD), sizeof(struct nsi_ip_cmpt_rw), + sizeof(UINT), sizeof(struct nsi_ip_cmpt_rw), sizeof(struct nsi_ip_cmpt_dynamic), 0 }, NULL, diff --git a/dlls/nsiproxy.sys/ndis.c b/dlls/nsiproxy.sys/ndis.c index 34d20b4be7fe..ba4933ff16b9 100644 --- a/dlls/nsiproxy.sys/ndis.c +++ b/dlls/nsiproxy.sys/ndis.c @@ -95,14 +95,14 @@ struct if_entry WCHAR *if_name; char if_unix_name[IFNAMSIZ]; IF_PHYSICAL_ADDRESS if_phys_addr; - DWORD if_index; - DWORD if_type; + UINT if_index; + UINT if_type; };
static struct list if_list = LIST_INIT( if_list ); static pthread_mutex_t if_list_lock = PTHREAD_MUTEX_INITIALIZER;
-static struct if_entry *find_entry_from_index( DWORD index ) +static struct if_entry *find_entry_from_index( UINT index ) { struct if_entry *entry;
@@ -123,7 +123,7 @@ static struct if_entry *find_entry_from_luid( const NET_LUID *luid ) }
#if defined (SIOCGIFHWADDR) && defined (HAVE_STRUCT_IFREQ_IFR_HWADDR) -static NTSTATUS if_get_physical( const char *name, DWORD *type, IF_PHYSICAL_ADDRESS *phys_addr ) +static NTSTATUS if_get_physical( const char *name, UINT *type, IF_PHYSICAL_ADDRESS *phys_addr ) { int fd, size, i; struct ifreq ifr; @@ -132,7 +132,7 @@ static NTSTATUS if_get_physical( const char *name, DWORD *type, IF_PHYSICAL_ADDR { unsigned short ifi_type; IFTYPE mib_type; - DWORD addr_len; + UINT addr_len; } types[] = { { ARPHRD_LOOPBACK, MIB_IF_TYPE_LOOPBACK, 0 }, @@ -177,7 +177,7 @@ err:
#elif defined (HAVE_SYS_SYSCTL_H) && defined (HAVE_NET_IF_DL_H)
-static NTSTATUS if_get_physical( const char *name, DWORD *type, IF_PHYSICAL_ADDRESS *phys_addr ) +static NTSTATUS if_get_physical( const char *name, UINT *type, IF_PHYSICAL_ADDRESS *phys_addr ) { struct if_msghdr *ifm; struct sockaddr_dl *sdl; @@ -245,7 +245,7 @@ static NTSTATUS if_get_physical( const char *name, DWORD *type, IF_PHYSICAL_ADDR static WCHAR *strdupAtoW( const char *str ) { WCHAR *ret = NULL; - DWORD len; + SIZE_T len;
if (!str) return ret; len = strlen( str ) + 1; @@ -254,7 +254,7 @@ static WCHAR *strdupAtoW( const char *str ) return ret; }
-static struct if_entry *add_entry( DWORD index, char *name ) +static struct if_entry *add_entry( UINT index, char *name ) { struct if_entry *entry; int name_len = strlen( name ); @@ -451,7 +451,7 @@ static NTSTATUS ifinfo_enumerate_all( void *key_data, UINT key_size, void *rw_da void *static_data, UINT static_size, UINT_PTR *count ) { struct if_entry *entry; - DWORD num = 0; + UINT num = 0; NTSTATUS status = STATUS_SUCCESS; BOOL want_data = key_size || rw_size || dynamic_size || static_size;
@@ -509,7 +509,7 @@ static NTSTATUS ifinfo_get_all_parameters( const void *key, UINT key_size, void return status; }
-static NTSTATUS ifinfo_get_rw_parameter( struct if_entry *entry, void *data, DWORD data_size, DWORD data_offset ) +static NTSTATUS ifinfo_get_rw_parameter( struct if_entry *entry, void *data, UINT data_size, UINT data_offset ) { switch (data_offset) { @@ -527,13 +527,13 @@ static NTSTATUS ifinfo_get_rw_parameter( struct if_entry *entry, void *data, DWO return STATUS_INVALID_PARAMETER; }
-static NTSTATUS ifinfo_get_static_parameter( struct if_entry *entry, void *data, DWORD data_size, DWORD data_offset ) +static NTSTATUS ifinfo_get_static_parameter( struct if_entry *entry, void *data, UINT data_size, UINT data_offset ) { switch (data_offset) { case FIELD_OFFSET( struct nsi_ndis_ifinfo_static, if_index ): - if (data_size != sizeof(DWORD)) return STATUS_INVALID_PARAMETER; - *(DWORD *)data = entry->if_index; + if (data_size != sizeof(UINT)) return STATUS_INVALID_PARAMETER; + *(UINT *)data = entry->if_index; return STATUS_SUCCESS;
case FIELD_OFFSET( struct nsi_ndis_ifinfo_static, if_guid ): @@ -593,7 +593,7 @@ static NTSTATUS index_luid_get_parameter( const void *key, UINT key_size, UINT p
update_if_table();
- entry = find_entry_from_index( *(DWORD *)key ); + entry = find_entry_from_index( *(UINT *)key ); if (entry) { *(NET_LUID *)data = entry->if_luid; @@ -660,7 +660,7 @@ static const struct module_table tables[] = { NSI_NDIS_INDEX_LUID_TABLE, { - sizeof(DWORD), 0, + sizeof(UINT), 0, 0, sizeof(NET_LUID) }, NULL, diff --git a/dlls/nsiproxy.sys/nsi.c b/dlls/nsiproxy.sys/nsi.c index fa997d2fe360..b9b04e635455 100644 --- a/dlls/nsiproxy.sys/nsi.c +++ b/dlls/nsiproxy.sys/nsi.c @@ -49,7 +49,7 @@ static const struct module *modules[] = &udp_module, };
-static const struct module_table *get_module_table( const NPI_MODULEID *id, DWORD table ) +static const struct module_table *get_module_table( const NPI_MODULEID *id, UINT table ) { const struct module_table *entry; int i; @@ -65,7 +65,7 @@ static const struct module_table *get_module_table( const NPI_MODULEID *id, DWOR NTSTATUS nsi_enumerate_all_ex( struct nsi_enumerate_all_ex *params ) { const struct module_table *entry = get_module_table( params->module, params->table ); - DWORD sizes[4] = { params->key_size, params->rw_size, params->dynamic_size, params->static_size }; + UINT sizes[4] = { params->key_size, params->rw_size, params->dynamic_size, params->static_size }; void *data[4] = { params->key_data, params->rw_data, params->dynamic_data, params->static_data }; int i;
diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c index 95f99c06f98f..8e2d7e749a79 100644 --- a/dlls/nsiproxy.sys/tcp.c +++ b/dlls/nsiproxy.sys/tcp.c @@ -143,7 +143,7 @@ static NTSTATUS tcp_stats_get_all_parameters( const void *key, UINT key_size, vo if (!(ptr = fgets( buf, sizeof(buf), fp ))) break; if (!ascii_strncasecmp( buf, hdr, sizeof(hdr) - 1 )) { - DWORD in_segs, out_segs; + UINT in_segs, out_segs; ptr += sizeof(hdr); sscanf( ptr, "%u %u %u %u %u %u %u %u %u %u %u %u %u %u", &stat.rto_algo, @@ -248,7 +248,7 @@ struct ipv6_addr_scope *get_ipv6_addr_scope_table( unsigned int *size ) while ((ptr = fgets( buf, sizeof(buf), fp ))) { WORD a[8]; - DWORD scope; + UINT scope; struct ipv6_addr_scope *entry; unsigned int i;
@@ -519,7 +519,7 @@ static NTSTATUS tcp_conns_enumerate_all( UINT filter, struct nsi_tcp_conn_key *k struct nsi_tcp_conn_dynamic *dynamic_data, UINT dynamic_size, struct nsi_tcp_conn_static *static_data, UINT static_size, UINT_PTR *count ) { - DWORD num = 0; + UINT num = 0; NTSTATUS status = STATUS_SUCCESS; BOOL want_data = key_size || rw_size || dynamic_size || static_size; struct nsi_tcp_conn_key key; @@ -586,8 +586,8 @@ static NTSTATUS tcp_conns_enumerate_all( UINT filter, struct nsi_tcp_conn_key *k ptr = fgets( buf, sizeof(buf), fp ); while ((ptr = fgets( buf, sizeof(buf), fp ))) { - DWORD *local_addr = (DWORD *)&key.local.Ipv6.sin6_addr; - DWORD *remote_addr = (DWORD *)&key.remote.Ipv6.sin6_addr; + UINT *local_addr = (UINT *)&key.local.Ipv6.sin6_addr; + UINT *remote_addr = (UINT *)&key.remote.Ipv6.sin6_addr;
if (sscanf( ptr, "%*u: %8x%8x%8x%8x:%hx %8x%8x%8x%8x:%hx %x %*s %*s %*s %*s %*s %*s %*s %d", local_addr, local_addr + 1, local_addr + 2, local_addr + 3, &key.local.Ipv6.sin6_port, diff --git a/dlls/nsiproxy.sys/udp.c b/dlls/nsiproxy.sys/udp.c index 1bcbb2532bd0..0ba2f835e44d 100644 --- a/dlls/nsiproxy.sys/udp.c +++ b/dlls/nsiproxy.sys/udp.c @@ -154,7 +154,7 @@ static NTSTATUS udp_stats_get_all_parameters( const void *key, UINT key_size, vo { "Udp6OutDatagrams", &out_dgrams }, }; char buf[512], *ptr, *value; - DWORD res, i; + UINT res, i; FILE *fp;
if (!(fp = fopen( "/proc/net/snmp6", "r" ))) return STATUS_NOT_SUPPORTED; @@ -206,7 +206,7 @@ static NTSTATUS udp_endpoint_enumerate_all( void *key_data, UINT key_size, void void *dynamic_data, UINT dynamic_size, void *static_data, UINT static_size, UINT_PTR *count ) { - DWORD num = 0; + UINT num = 0; NTSTATUS status = STATUS_SUCCESS; BOOL want_data = key_size || rw_size || dynamic_size || static_size; struct nsi_udp_endpoint_key key, *key_out = key_data; @@ -266,7 +266,7 @@ static NTSTATUS udp_endpoint_enumerate_all( void *key_data, UINT key_size, void ptr = fgets( buf, sizeof(buf), fp ); while ((ptr = fgets( buf, sizeof(buf), fp ))) { - DWORD *local_addr = (DWORD *)&key.local.Ipv6.sin6_addr; + UINT *local_addr = (UINT *)&key.local.Ipv6.sin6_addr;
if (sscanf( ptr, "%*u: %8x%8x%8x%8x:%hx %*s %*s %*s %*s %*s %*s %*s %d", local_addr, local_addr + 1, local_addr + 2, local_addr + 3,
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/nsiproxy.sys/tcp.c | 7 +++++-- dlls/nsiproxy.sys/udp.c | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c index 8e2d7e749a79..0dbee8418b94 100644 --- a/dlls/nsiproxy.sys/tcp.c +++ b/dlls/nsiproxy.sys/tcp.c @@ -534,6 +534,7 @@ static NTSTATUS tcp_conns_enumerate_all( UINT filter, struct nsi_tcp_conn_key *k FILE *fp; char buf[512], *ptr; int inode; + UINT laddr, raddr;
if (!(fp = fopen( "/proc/net/tcp", "r" ))) return ERROR_NOT_SUPPORTED;
@@ -547,15 +548,17 @@ static NTSTATUS tcp_conns_enumerate_all( UINT filter, struct nsi_tcp_conn_key *k while ((ptr = fgets( buf, sizeof(buf), fp ))) { if (sscanf( ptr, "%*x: %x:%hx %x:%hx %x %*s %*s %*s %*s %*s %d", - &key.local.Ipv4.sin_addr.WS_s_addr, &key.local.Ipv4.sin_port, - &key.remote.Ipv4.sin_addr.WS_s_addr, &key.remote.Ipv4.sin_port, + &laddr, &key.local.Ipv4.sin_port, + &raddr, &key.remote.Ipv4.sin_port, &dyn.state, &inode ) != 6) continue; dyn.state = tcp_state_to_mib_state( dyn.state ); if (filter && filter != dyn.state ) continue;
key.local.Ipv4.sin_family = key.remote.Ipv4.sin_family = WS_AF_INET; + key.local.Ipv4.sin_addr.WS_s_addr = laddr; key.local.Ipv4.sin_port = htons( key.local.Ipv4.sin_port ); + key.remote.Ipv4.sin_addr.WS_s_addr = raddr; key.remote.Ipv4.sin_port = htons( key.remote.Ipv4.sin_port );
if (num < *count) diff --git a/dlls/nsiproxy.sys/udp.c b/dlls/nsiproxy.sys/udp.c index 0ba2f835e44d..b5896b07b401 100644 --- a/dlls/nsiproxy.sys/udp.c +++ b/dlls/nsiproxy.sys/udp.c @@ -214,6 +214,7 @@ static NTSTATUS udp_endpoint_enumerate_all( void *key_data, UINT key_size, void struct ipv6_addr_scope *addr_scopes = NULL; unsigned int addr_scopes_size = 0, pid_map_size = 0; struct pid_map *pid_map = NULL; + UINT addr;
TRACE( "%p %d %p %d %p %d %p %d %p\n", key_data, key_size, rw_data, rw_size, dynamic_data, dynamic_size, static_data, static_size, count ); @@ -235,10 +236,11 @@ static NTSTATUS udp_endpoint_enumerate_all( void *key_data, UINT key_size, void while ((ptr = fgets( buf, sizeof(buf), fp ))) { if (sscanf( ptr, "%*u: %x:%hx %*s %*s %*s %*s %*s %*s %*s %d", - &key.local.Ipv4.sin_addr.WS_s_addr, &key.local.Ipv4.sin_port, &inode ) != 3) + &addr, &key.local.Ipv4.sin_port, &inode ) != 3) continue;
key.local.Ipv4.sin_family = WS_AF_INET; + key.local.Ipv4.sin_addr.WS_s_addr = addr; key.local.Ipv4.sin_port = htons( key.local.Ipv4.sin_port );
stat.pid = find_owning_pid( pid_map, pid_map_size, inode );
On Sat, Apr 23, 2022 at 09:33:05AM +0200, Eric Pouech wrote:
Signed-off-by: Eric Pouech eric.pouech@gmail.com
dlls/nsiproxy.sys/tcp.c | 7 +++++-- dlls/nsiproxy.sys/udp.c | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c index 8e2d7e749a79..0dbee8418b94 100644 --- a/dlls/nsiproxy.sys/tcp.c +++ b/dlls/nsiproxy.sys/tcp.c @@ -534,6 +534,7 @@ static NTSTATUS tcp_conns_enumerate_all( UINT filter, struct nsi_tcp_conn_key *k FILE *fp; char buf[512], *ptr; int inode;
UINT laddr, raddr; if (!(fp = fopen( "/proc/net/tcp", "r" ))) return ERROR_NOT_SUPPORTED;
@@ -547,15 +548,17 @@ static NTSTATUS tcp_conns_enumerate_all( UINT filter, struct nsi_tcp_conn_key *k while ((ptr = fgets( buf, sizeof(buf), fp ))) { if (sscanf( ptr, "%*x: %x:%hx %x:%hx %x %*s %*s %*s %*s %*s %d",
&key.local.Ipv4.sin_addr.WS_s_addr, &key.local.Ipv4.sin_port,
&key.remote.Ipv4.sin_addr.WS_s_addr, &key.remote.Ipv4.sin_port,
&laddr, &key.local.Ipv4.sin_port,
&raddr, &key.remote.Ipv4.sin_port, &dyn.state, &inode ) != 6) continue; dyn.state = tcp_state_to_mib_state( dyn.state ); if (filter && filter != dyn.state ) continue; key.local.Ipv4.sin_family = key.remote.Ipv4.sin_family = WS_AF_INET;
key.local.Ipv4.sin_addr.WS_s_addr = laddr; key.local.Ipv4.sin_port = htons( key.local.Ipv4.sin_port );
key.remote.Ipv4.sin_addr.WS_s_addr = raddr; key.remote.Ipv4.sin_port = htons( key.remote.Ipv4.sin_port );
Isn't this just hiding the fact that IN_ADDR contains a ULONG, so its size changes? Likewise for SOCKADDR_IN6.
Huw.
On Mon, Apr 25, 2022 at 08:31:45AM +0100, Huw Davies wrote:
On Sat, Apr 23, 2022 at 09:33:05AM +0200, Eric Pouech wrote: Isn't this just hiding the fact that IN_ADDR contains a ULONG, so its size changes? Likewise for SOCKADDR_IN6.
Scratch that. With __LP64__, ULONG is always unsigned int.
Sorry for the noise. Huw.
On Mon, Apr 25, 2022 at 09:15:01AM +0100, Huw Davies wrote:
On Mon, Apr 25, 2022 at 08:31:45AM +0100, Huw Davies wrote:
On Sat, Apr 23, 2022 at 09:33:05AM +0200, Eric Pouech wrote: Isn't this just hiding the fact that IN_ADDR contains a ULONG, so its size changes? Likewise for SOCKADDR_IN6.
Scratch that. With __LP64__, ULONG is always unsigned int.
Sorry for the noise.
Just to continue the noise: This patch is giving an unused variable warning on macOS. I'll send in v2 (with fixups to the commit msgs too).
Huw.
Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- dlls/nsiproxy.sys/Makefile.in | 1 - dlls/nsiproxy.sys/device.c | 10 +++++----- dlls/nsiproxy.sys/tcp.c | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/nsiproxy.sys/Makefile.in b/dlls/nsiproxy.sys/Makefile.in index 3b83a4ddaacb..87f7e165ef4a 100644 --- a/dlls/nsiproxy.sys/Makefile.in +++ b/dlls/nsiproxy.sys/Makefile.in @@ -1,4 +1,3 @@ -EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = nsiproxy.sys UNIXLIB = nsiproxy.so IMPORTS = ntoskrnl diff --git a/dlls/nsiproxy.sys/device.c b/dlls/nsiproxy.sys/device.c index cc9b00d33590..d3845829a85a 100644 --- a/dlls/nsiproxy.sys/device.c +++ b/dlls/nsiproxy.sys/device.c @@ -266,7 +266,7 @@ static NTSTATUS WINAPI nsi_ioctl( DEVICE_OBJECT *device, IRP *irp ) IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp ); NTSTATUS status;
- TRACE( "ioctl %x insize %u outsize %u\n", + TRACE( "ioctl %lx insize %lu outsize %lu\n", irpsp->Parameters.DeviceIoControl.IoControlCode, irpsp->Parameters.DeviceIoControl.InputBufferLength, irpsp->Parameters.DeviceIoControl.OutputBufferLength ); @@ -290,7 +290,7 @@ static NTSTATUS WINAPI nsi_ioctl( DEVICE_OBJECT *device, IRP *irp ) break;
default: - FIXME( "ioctl %x not supported\n", irpsp->Parameters.DeviceIoControl.IoControlCode ); + FIXME( "ioctl %lx not supported\n", irpsp->Parameters.DeviceIoControl.IoControlCode ); status = STATUS_NOT_SUPPORTED; break; } @@ -316,7 +316,7 @@ static int add_device( DRIVER_OBJECT *driver ) status = IoCreateSymbolicLink( &link, &name ); if (status) { - FIXME( "failed to create device error %x\n", status ); + FIXME( "failed to create device error %lx\n", status ); return 0; }
@@ -341,7 +341,7 @@ static DWORD WINAPI listen_thread_proc( void *arg ) params.reply_len = irpsp->Parameters.DeviceIoControl.OutputBufferLength;
status = nsiproxy_call( icmp_listen, ¶ms ); - TRACE( "icmp_listen rets %08x\n", status ); + TRACE( "icmp_listen rets %08lx\n", status );
EnterCriticalSection( &nsiproxy_cs );
@@ -375,7 +375,7 @@ static void handle_queued_send_echo( IRP *irp ) params.dst = &in->dst;
status = nsiproxy_call( icmp_send_echo, ¶ms ); - TRACE( "icmp_send_echo rets %08x\n", status ); + TRACE( "icmp_send_echo rets %08lx\n", status );
if (status != STATUS_PENDING) { diff --git a/dlls/nsiproxy.sys/tcp.c b/dlls/nsiproxy.sys/tcp.c index 0dbee8418b94..5734c4d9ee04 100644 --- a/dlls/nsiproxy.sys/tcp.c +++ b/dlls/nsiproxy.sys/tcp.c @@ -404,7 +404,7 @@ unsigned int find_owning_pid( struct pid_map *map, unsigned int num_entries, UIN unsigned int i, len_socket; char socket[32];
- sprintf( socket, "socket:[%lu]", inode ); + sprintf( socket, "socket:[%zu]", inode ); len_socket = strlen( socket ); for (i = 0; i < num_entries; i++) {