Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/nsi/nsi.c | 23 +++++++++++++++++++++++ dlls/nsi/nsi.spec | 2 +- dlls/nsi/tests/nsi.c | 30 ++++++++++++++++++++++++++++++ include/wine/nsi.h | 18 ++++++++++++++++++ 4 files changed, 72 insertions(+), 1 deletion(-)
diff --git a/dlls/nsi/nsi.c b/dlls/nsi/nsi.c index 1ed0cfad916..4e55721475b 100644 --- a/dlls/nsi/nsi.c +++ b/dlls/nsi/nsi.c @@ -84,8 +84,31 @@ DWORD WINAPI NsiGetAllParameters( DWORD unk, const NPI_MODULEID *module, DWORD t void *rw_data, DWORD rw_size, void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size ) { + struct nsi_get_all_parameters_ex params; + FIXME( "%d %p %d %p %d %p %d %p %d %p %d: stub\n", unk, module, table, key, key_size, rw_data, rw_size, dynamic_data, dynamic_size, static_data, static_size ); + + params.unknown[0] = 0; + params.unknown[1] = 0; + params.module = module; + params.table = table; + params.first_arg = unk; + params.unknown2 = 0; + params.key = key; + params.key_size = key_size; + params.rw_data = rw_data; + params.rw_size = rw_size; + params.dynamic_data = dynamic_data; + params.dynamic_size = dynamic_size; + params.static_data = static_data; + params.static_size = static_size; + + return NsiGetAllParametersEx( ¶ms ); +} + +DWORD WINAPI NsiGetAllParametersEx( struct nsi_get_all_parameters_ex *params ) +{ return ERROR_CALL_NOT_IMPLEMENTED; }
diff --git a/dlls/nsi/nsi.spec b/dlls/nsi/nsi.spec index 912a5e8d052..376d25438aa 100644 --- a/dlls/nsi/nsi.spec +++ b/dlls/nsi/nsi.spec @@ -9,7 +9,7 @@ @ stub NsiFreePersistentDataWithMaskTable @ stdcall NsiFreeTable(ptr ptr ptr ptr) @ stdcall NsiGetAllParameters(long ptr long ptr long ptr long ptr long ptr long) -@ stub NsiGetAllParametersEx +@ stdcall NsiGetAllParametersEx(ptr) @ stub NsiGetAllPersistentParametersWithMask @ stub NsiObjectSecurity @ stdcall NsiGetParameter(long ptr long ptr long long ptr long long) diff --git a/dlls/nsi/tests/nsi.c b/dlls/nsi/tests/nsi.c index 5e2ea71646c..7c2c57b9548 100644 --- a/dlls/nsi/tests/nsi.c +++ b/dlls/nsi/tests/nsi.c @@ -40,6 +40,7 @@ static void test_nsi_api( void ) struct nsi_ndis_ifinfo_rw *rw_tbl, *rw, get_rw, *enum_rw_tbl, *enum_rw; struct nsi_ndis_ifinfo_dynamic *dyn_tbl, *dyn, get_dyn, *enum_dyn_tbl, *enum_dyn; struct nsi_ndis_ifinfo_static *stat_tbl, *stat, get_stat, *enum_stat_tbl, *enum_stat; + struct nsi_get_all_parameters_ex get_all_params; struct nsi_enumerate_all_ex enum_params; DWORD err, count, i, rw_size, enum_count; NET_LUID *luid_tbl, *enum_luid_tbl; @@ -81,6 +82,35 @@ todo_wine memset( &get_dyn, 0xcc, sizeof(get_dyn) ); memset( &get_stat, 0xcc, sizeof(get_stat) );
+ memset( &get_all_params, 0, sizeof(get_all_params) ); + get_all_params.first_arg = 1; + get_all_params.module = &NPI_MS_NDIS_MODULEID; + get_all_params.table = NSI_NDIS_IFINFO_TABLE; + get_all_params.key = luid_tbl + i; + get_all_params.key_size = sizeof(*luid_tbl); + get_all_params.rw_data = &get_rw; + get_all_params.rw_size = rw_size; + get_all_params.dynamic_data = &get_dyn; + get_all_params.dynamic_size = sizeof(get_dyn); + get_all_params.static_data = &get_stat; + get_all_params.static_size = sizeof(get_stat); + + err = NsiGetAllParametersEx( &get_all_params ); + ok( !err, "got %d\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" ); + ok( !memcmp( get_rw.alias.String, rw->alias.String, rw->alias.Length ), "mismatch\n" ); + ok( get_rw.phys_addr.Length == rw->phys_addr.Length, "mismatch\n" ); + ok( !memcmp( get_rw.phys_addr.Address, rw->phys_addr.Address, IF_MAX_PHYS_ADDRESS_LENGTH ), "mismatch\n" ); + ok( get_dyn.oper_status == dyn->oper_status, "mismatch\n" ); + ok( get_stat.if_index == stat->if_index, "mismatch\n" ); + ok( IsEqualGUID( &get_stat.if_guid, &stat->if_guid ), "mismatch\n" ); + + memset( &get_rw, 0xcc, sizeof(get_rw) ); + memset( &get_dyn, 0xcc, sizeof(get_dyn) ); + memset( &get_stat, 0xcc, sizeof(get_stat) ); + 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) ); diff --git a/include/wine/nsi.h b/include/wine/nsi.h index 999b8a57810..81d221324e9 100644 --- a/include/wine/nsi.h +++ b/include/wine/nsi.h @@ -116,6 +116,23 @@ struct nsi_enumerate_all_ex DWORD_PTR count; };
+struct nsi_get_all_parameters_ex +{ + void *unknown[2]; + const NPI_MODULEID *module; + DWORD_PTR table; + DWORD first_arg; + DWORD unknown2; + const void *key; + DWORD key_size; + void *rw_data; + DWORD rw_size; + void *dynamic_data; + DWORD dynamic_size; + void *static_data; + DWORD static_size; +}; + DWORD WINAPI NsiAllocateAndGetTable( DWORD unk, 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, DWORD unk2 ); @@ -128,6 +145,7 @@ void WINAPI NsiFreeTable( void *key_data, void *rw_data, void *dynamic_data, voi DWORD WINAPI NsiGetAllParameters( DWORD unk, const NPI_MODULEID *module, DWORD table, const void *key, DWORD key_size, void *rw_data, DWORD rw_size, void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size ); +DWORD WINAPI NsiGetAllParametersEx( struct nsi_get_all_parameters_ex *params ); DWORD WINAPI NsiGetParameter( DWORD unk, const NPI_MODULEID *module, DWORD table, const void *key, DWORD key_size, DWORD param_type, void *data, DWORD data_size, DWORD data_offset );