Skip to content

Commit

Permalink
netprofm: Fix connection_GetAdapterId returning incorrect network ada…
Browse files Browse the repository at this point in the history
…pter GUID.
  • Loading branch information
besentv committed Feb 6, 2021
1 parent 4f1b297 commit a717949
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dlls/netprofm/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MODULE = netprofm.dll
IMPORTS = iphlpapi
IMPORTS = iphlpapi ole32

EXTRADLLFLAGS = -mno-cygwin

Expand Down
14 changes: 11 additions & 3 deletions dlls/netprofm/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -1586,10 +1586,15 @@ static HRESULT WINAPI connection_GetAdapterId(
GUID *pgdAdapterId )
{
struct connection *connection = impl_from_INetworkConnection( iface );

FIXME( "%p, %p\n", iface, pgdAdapterId );
LPOLESTR adapterIdStr;

*pgdAdapterId = connection->id;

/*Debug*/
StringFromCLSID(pgdAdapterId, &adapterIdStr);
FIXME("Iface: %p, AdapterId %ls\n", iface, adapterIdStr);
heap_free(adapterIdStr);

return S_OK;
}

Expand Down Expand Up @@ -1737,7 +1742,10 @@ static void init_networks( struct list_manager *mgr )
struct network *network;
struct connection *connection;

id.Data1 = aa->u.s.IfIndex;
/*Convert adapter name (GUID string) to GUID struct*/
OLECHAR adapterGuidString[39];
MultiByteToWideChar(CP_ACP, 0, aa->AdapterName, -1, adapterGuidString, 39);
if(CLSIDFromString(adapterGuidString, &id)) goto done;

/* assume a one-to-one mapping between networks and connections */
if (!(network = create_network( &id ))) goto done;
Expand Down

0 comments on commit a717949

Please sign in to comment.