Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/nsi/nsi.c | 20 ++++++++++++++++++++ dlls/nsi/nsi.spec | 2 +- dlls/nsi/tests/nsi.c | 37 +++++++++++++++++++++++++++++++++++++ include/wine/nsi.h | 16 ++++++++++++++++ 4 files changed, 74 insertions(+), 1 deletion(-)
diff --git a/dlls/nsi/nsi.c b/dlls/nsi/nsi.c index 4e55721475b..d3292af9ee3 100644 --- a/dlls/nsi/nsi.c +++ b/dlls/nsi/nsi.c @@ -115,7 +115,27 @@ 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 ) { + struct nsi_get_parameter_ex params; + FIXME( "%d %p %d %p %d %d %p %d %d: stub\n", unk, module, table, key, key_size, param_type, data, data_size, data_offset ); + + 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.param_type = param_type; + params.data = data; + params.data_size = data_size; + params.data_offset = data_offset; + return NsiGetParameterEx( ¶ms ); +} + +DWORD WINAPI NsiGetParameterEx( struct nsi_get_parameter_ex *params ) +{ return ERROR_CALL_NOT_IMPLEMENTED; } diff --git a/dlls/nsi/nsi.spec b/dlls/nsi/nsi.spec index 376d25438aa..ba326572fb8 100644 --- a/dlls/nsi/nsi.spec +++ b/dlls/nsi/nsi.spec @@ -13,7 +13,7 @@ @ stub NsiGetAllPersistentParametersWithMask @ stub NsiObjectSecurity @ stdcall NsiGetParameter(long ptr long ptr long long ptr long long) -@ stub NsiGetParameterEx +@ stdcall NsiGetParameterEx(ptr) @ stub NsiRegisterChangeNotification @ stub NsiRegisterChangeNotificationEx @ stub NsiRequestChangeNotification diff --git a/dlls/nsi/tests/nsi.c b/dlls/nsi/tests/nsi.c index 7c2c57b9548..51b149e9f65 100644 --- a/dlls/nsi/tests/nsi.c +++ b/dlls/nsi/tests/nsi.c @@ -41,6 +41,7 @@ static void test_nsi_api( void ) 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_get_parameter_ex get_param; struct nsi_enumerate_all_ex enum_params; DWORD err, count, i, rw_size, enum_count; NET_LUID *luid_tbl, *enum_luid_tbl; @@ -129,6 +130,42 @@ todo_wine FIELD_OFFSET(struct nsi_ndis_ifinfo_static, if_guid) ); ok( !err, "got %d\n", err ); 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) ); + + memset( &get_param, 0, sizeof(get_param) ); + get_param.first_arg = 1; + get_param.module = &NPI_MS_NDIS_MODULEID; + get_param.table = NSI_NDIS_IFINFO_TABLE; + get_param.key = luid_tbl + i; + get_param.key_size = sizeof(*luid_tbl); + + get_param.param_type = NSI_PARAM_TYPE_RW; + get_param.data = &get_rw.alias; + 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( get_rw.alias.Length == rw->alias.Length, "mismatch\n" ); + ok( !memcmp( get_rw.alias.String, rw->alias.String, rw->alias.Length ), "mismatch\n" ); + + get_param.param_type = NSI_PARAM_TYPE_STATIC; + get_param.data = &get_stat.if_index; + 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( get_stat.if_index == stat->if_index, "mismatch\n" ); + + get_param.param_type = NSI_PARAM_TYPE_STATIC; + get_param.data = &get_stat.if_guid; + 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( IsEqualGUID( &get_stat.if_guid, &stat->if_guid ), "mismatch\n" ); winetest_pop_context(); }
diff --git a/include/wine/nsi.h b/include/wine/nsi.h index 81d221324e9..31ece41d22f 100644 --- a/include/wine/nsi.h +++ b/include/wine/nsi.h @@ -133,6 +133,21 @@ struct nsi_get_all_parameters_ex DWORD static_size; };
+struct nsi_get_parameter_ex +{ + void *unknown[2]; + const NPI_MODULEID *module; + DWORD_PTR table; + DWORD first_arg; + DWORD unknown2; + const void *key; + DWORD key_size; + DWORD_PTR param_type; + void *data; + DWORD data_size; + DWORD data_offset; +}; + 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 ); @@ -148,5 +163,6 @@ DWORD WINAPI NsiGetAllParameters( DWORD unk, const NPI_MODULEID *module, DWORD t 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 ); +DWORD WINAPI NsiGetParameterEx( struct nsi_get_parameter_ex *params );
#endif /* __WINE_NSI_H */