Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
79c12f15
Commit
79c12f15
authored
Jul 07, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Jul 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Implement ConvertInterfaceLuidToAlias().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e62eadad
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
1 deletion
+37
-1
iphlpapi.spec
dlls/iphlpapi/iphlpapi.spec
+1
-1
iphlpapi_main.c
dlls/iphlpapi/iphlpapi_main.c
+24
-0
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+11
-0
netioapi.h
include/netioapi.h
+1
-0
No files found.
dlls/iphlpapi/iphlpapi.spec
View file @
79c12f15
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
@ stdcall ConvertInterfaceAliasToLuid( ptr ptr )
@ stdcall ConvertInterfaceAliasToLuid( ptr ptr )
@ stdcall ConvertInterfaceGuidToLuid( ptr ptr )
@ stdcall ConvertInterfaceGuidToLuid( ptr ptr )
@ stdcall ConvertInterfaceIndexToLuid( long ptr )
@ stdcall ConvertInterfaceIndexToLuid( long ptr )
#@ stub ConvertInterfaceLuidToAlias
@ stdcall ConvertInterfaceLuidToAlias( ptr ptr long )
@ stdcall ConvertInterfaceLuidToGuid( ptr ptr )
@ stdcall ConvertInterfaceLuidToGuid( ptr ptr )
@ stdcall ConvertInterfaceLuidToIndex( ptr ptr )
@ stdcall ConvertInterfaceLuidToIndex( ptr ptr )
@ stdcall ConvertInterfaceLuidToNameA( ptr ptr long )
@ stdcall ConvertInterfaceLuidToNameA( ptr ptr long )
...
...
dlls/iphlpapi/iphlpapi_main.c
View file @
79c12f15
...
@@ -3242,6 +3242,30 @@ DWORD WINAPI ConvertInterfaceIndexToLuid(NET_IFINDEX index, NET_LUID *luid)
...
@@ -3242,6 +3242,30 @@ DWORD WINAPI ConvertInterfaceIndexToLuid(NET_IFINDEX index, NET_LUID *luid)
}
}
/******************************************************************
/******************************************************************
* ConvertInterfaceLuidToAlias (IPHLPAPI.@)
*/
DWORD
WINAPI
ConvertInterfaceLuidToAlias
(
const
NET_LUID
*
luid
,
WCHAR
*
alias
,
SIZE_T
len
)
{
DWORD
err
;
IF_COUNTED_STRING
name
;
TRACE
(
"(%p %p %u)
\n
"
,
luid
,
alias
,
(
DWORD
)
len
);
if
(
!
luid
||
!
alias
)
return
ERROR_INVALID_PARAMETER
;
err
=
NsiGetParameter
(
1
,
&
NPI_MS_NDIS_MODULEID
,
NSI_NDIS_IFINFO_TABLE
,
luid
,
sizeof
(
*
luid
),
NSI_PARAM_TYPE_RW
,
&
name
,
sizeof
(
name
),
FIELD_OFFSET
(
struct
nsi_ndis_ifinfo_rw
,
alias
)
);
if
(
err
)
return
err
;
if
(
len
<=
name
.
Length
/
sizeof
(
WCHAR
))
return
ERROR_NOT_ENOUGH_MEMORY
;
memcpy
(
alias
,
name
.
String
,
name
.
Length
);
alias
[
name
.
Length
/
sizeof
(
WCHAR
)]
=
'\0'
;
return
err
;
}
/******************************************************************
* ConvertInterfaceLuidToGuid (IPHLPAPI.@)
* ConvertInterfaceLuidToGuid (IPHLPAPI.@)
*/
*/
DWORD
WINAPI
ConvertInterfaceLuidToGuid
(
const
NET_LUID
*
luid
,
GUID
*
guid
)
DWORD
WINAPI
ConvertInterfaceLuidToGuid
(
const
NET_LUID
*
luid
,
GUID
*
guid
)
...
...
dlls/iphlpapi/tests/iphlpapi.c
View file @
79c12f15
...
@@ -1625,6 +1625,7 @@ static void test_interface_identifier_conversion(void)
...
@@ -1625,6 +1625,7 @@ static void test_interface_identifier_conversion(void)
GUID
guid
;
GUID
guid
;
SIZE_T
len
;
SIZE_T
len
;
WCHAR
nameW
[
IF_MAX_STRING_SIZE
+
1
];
WCHAR
nameW
[
IF_MAX_STRING_SIZE
+
1
];
WCHAR
alias
[
IF_MAX_STRING_SIZE
+
1
];
char
nameA
[
IF_MAX_STRING_SIZE
+
1
],
*
name
;
char
nameA
[
IF_MAX_STRING_SIZE
+
1
],
*
name
;
NET_IFINDEX
index
;
NET_IFINDEX
index
;
MIB_IF_TABLE2
*
table
;
MIB_IF_TABLE2
*
table
;
...
@@ -1779,6 +1780,16 @@ static void test_interface_identifier_conversion(void)
...
@@ -1779,6 +1780,16 @@ static void test_interface_identifier_conversion(void)
ok
(
!
ret
,
"got %u
\n
"
,
ret
);
ok
(
!
ret
,
"got %u
\n
"
,
ret
);
ok
(
luid
.
Value
==
row
->
InterfaceLuid
.
Value
,
"mismatch
\n
"
);
ok
(
luid
.
Value
==
row
->
InterfaceLuid
.
Value
,
"mismatch
\n
"
);
/* ConvertInterfaceAliasToLuid */
ret
=
ConvertInterfaceAliasToLuid
(
row
->
Alias
,
&
luid
);
ok
(
!
ret
,
"got %u
\n
"
,
ret
);
ok
(
luid
.
Value
==
row
->
InterfaceLuid
.
Value
,
"mismatch
\n
"
);
/* ConvertInterfaceLuidToAlias */
ret
=
ConvertInterfaceLuidToAlias
(
&
row
->
InterfaceLuid
,
alias
,
ARRAY_SIZE
(
alias
)
);
ok
(
!
ret
,
"got %u
\n
"
,
ret
);
ok
(
!
wcscmp
(
alias
,
row
->
Alias
),
"got %s vs %s
\n
"
,
wine_dbgstr_w
(
alias
),
wine_dbgstr_w
(
row
->
Alias
)
);
index
=
if_nametoindex
(
NULL
);
index
=
if_nametoindex
(
NULL
);
ok
(
!
index
,
"Got unexpected index %u
\n
"
,
index
);
ok
(
!
index
,
"Got unexpected index %u
\n
"
,
index
);
index
=
if_nametoindex
(
nameA
);
index
=
if_nametoindex
(
nameA
);
...
...
include/netioapi.h
View file @
79c12f15
...
@@ -241,6 +241,7 @@ typedef VOID (WINAPI *PIPFORWARD_CHANGE_CALLBACK)(VOID*,MIB_IPFORWARD_ROW2*,MIB_
...
@@ -241,6 +241,7 @@ typedef VOID (WINAPI *PIPFORWARD_CHANGE_CALLBACK)(VOID*,MIB_IPFORWARD_ROW2*,MIB_
DWORD
WINAPI
ConvertInterfaceAliasToLuid
(
const
WCHAR
*
,
NET_LUID
*
);
DWORD
WINAPI
ConvertInterfaceAliasToLuid
(
const
WCHAR
*
,
NET_LUID
*
);
DWORD
WINAPI
ConvertInterfaceGuidToLuid
(
const
GUID
*
,
NET_LUID
*
);
DWORD
WINAPI
ConvertInterfaceGuidToLuid
(
const
GUID
*
,
NET_LUID
*
);
DWORD
WINAPI
ConvertInterfaceIndexToLuid
(
NET_IFINDEX
,
NET_LUID
*
);
DWORD
WINAPI
ConvertInterfaceIndexToLuid
(
NET_IFINDEX
,
NET_LUID
*
);
DWORD
WINAPI
ConvertInterfaceLuidToAlias
(
const
NET_LUID
*
,
WCHAR
*
,
SIZE_T
);
DWORD
WINAPI
ConvertInterfaceLuidToGuid
(
const
NET_LUID
*
,
GUID
*
);
DWORD
WINAPI
ConvertInterfaceLuidToGuid
(
const
NET_LUID
*
,
GUID
*
);
DWORD
WINAPI
ConvertInterfaceLuidToIndex
(
const
NET_LUID
*
,
NET_IFINDEX
*
);
DWORD
WINAPI
ConvertInterfaceLuidToIndex
(
const
NET_LUID
*
,
NET_IFINDEX
*
);
DWORD
WINAPI
ConvertInterfaceLuidToNameA
(
const
NET_LUID
*
,
char
*
,
SIZE_T
);
DWORD
WINAPI
ConvertInterfaceLuidToNameA
(
const
NET_LUID
*
,
char
*
,
SIZE_T
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment