Skip to content

Commit

Permalink
1.1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
liuqx0717 committed Oct 17, 2017
1 parent b7a54fe commit be338f9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# wifishare

开启、管理wifi热点,以及查看常用网卡信息。


![ScreenCapture1](/ScreenCapture1.png)

![ScreenCapture2](/ScreenCapture2.png)


[Downloads](https://github.com/liuqx0717/wifishare/releases)
Binary file modified wifishare/wifishare.rc
Binary file not shown.
7 changes: 6 additions & 1 deletion wifishare/wifishareCommonLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ namespace lqx {
AdaptersInfo[AdaptersInfoCount].Name.SetString(NetConnectionInfo->Name);
AdaptersInfo[AdaptersInfoCount].DeviceName.SetString(NetConnectionInfo->DeviceName);
AdaptersInfo[AdaptersInfoCount].Status = NetConnectionInfo->Status;
AdaptersInfo[AdaptersInfoCount].guid = NetConnectionInfo->guid;
AdaptersInfo[AdaptersInfoCount].SharingType = *SharingType;
}
AdaptersInfoCount++;
Expand All @@ -146,13 +147,17 @@ namespace lqx {
bool ret = lqx::GetAdaptersInfo([&AdaptersInfoCount, &AdaptersInfo](PIP_ADAPTER_ADDRESSES pIpAdapterInfo) {
wchar_t str[256];
DWORD strsize = 256;
NET_LUID luid;

bool foundIPv4 = false;
bool foundIPv6 = false;
INT ret;

for (size_t i = 0; i < AdaptersInfoCount; i++) {
if (!AdaptersInfo[i].DeviceName.Compare(pIpAdapterInfo->Description)) {
if (ConvertInterfaceGuidToLuid(&AdaptersInfo[i].guid, &luid) != NO_ERROR) {
throw L"ConvertInterfaceGuidToLuid调用失败。";
}
if(pIpAdapterInfo->Luid.Value==luid.Value){
foundIPv4 = false;
foundIPv6 = false;

Expand Down
5 changes: 3 additions & 2 deletions wifishare/wifishareCommonLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
namespace lqx {

struct ADAPTER_INFO {
CString Name;
CString DeviceName;
CStringW Name;
CStringW DeviceName;
GUID guid;
NETCON_STATUS Status;
CString IPv4;
CString IPv6;
Expand Down
1 change: 1 addition & 0 deletions wifishare/wifishareKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ namespace lqx {
NetConnectionInfo.DeviceName = pNP->pszwDeviceName;
NetConnectionInfo.Name = pNP->pszwName;
NetConnectionInfo.Status = pNP->Status;
NetConnectionInfo.guid = pNP->guidId;


hr = pNSM->get_INetSharingConfigurationForINetConnection(pNC, &pNSC);
Expand Down
1 change: 1 addition & 0 deletions wifishare/wifishareKernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ namespace lqx {
struct _NetConnectionInfo {
wchar_t *Name; //网络连接名,比如“本地连接”(注意编码)
wchar_t *DeviceName;//网络连接名,比如"Realtek PCIe GBE Family Controller"(注意编码)
GUID guid;
NETCON_STATUS Status; //当前网卡的状态
};

Expand Down

0 comments on commit be338f9

Please sign in to comment.