Changeset 57192 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt/win/tools/VBoxNetAdpInstall.cpp
- Timestamp:
- Aug 5, 2015 12:51:17 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/tools/VBoxNetAdpInstall.cpp
r56293 r57192 19 19 #include <VBox/VBoxDrvCfg-win.h> 20 20 #include <stdio.h> 21 22 21 #include <devguid.h> 22 23 #define VBOX_NETADP_APP_NAME L"NetAdpInstall" 23 24 24 25 #define VBOX_NETADP_HWID L"sun_VBoxNetAdp" … … 41 42 if (SUCCEEDED(hr)) 42 43 { 43 printf("adding host-only interface..\n");44 wprintf(L"adding host-only interface..\n"); 44 45 45 46 DWORD dwErr = ERROR_SUCCESS; … … 51 52 if (dwErr == ERROR_SUCCESS) 52 53 { 54 INetCfg *pnc; 55 LPWSTR lpszLockedBy = NULL; 56 hr = VBoxNetCfgWinQueryINetCfg(&pnc, TRUE, VBOX_NETADP_APP_NAME, 10000, &lpszLockedBy); 57 if(hr == S_OK) 58 { 59 60 hr = VBoxNetCfgWinNetAdpInstall(pnc, MpInf); 61 62 if(hr == S_OK) 63 { 64 wprintf(L"installed successfully\n"); 65 } 66 else 67 { 68 wprintf(L"error installing VBoxNetAdp (0x%x)\n", hr); 69 } 70 71 VBoxNetCfgWinReleaseINetCfg(pnc, TRUE); 72 } 73 else 74 wprintf(L"VBoxNetCfgWinQueryINetCfg failed: hr = 0x%x\n", hr); 75 /* 53 76 hr = VBoxDrvCfgInfInstall(MpInf); 54 77 if (FAILED(hr)) … … 65 88 if (SUCCEEDED(hr)) 66 89 { 67 / *ip returned by VBoxNetCfgWinGenHostOnlyNetworkNetworkIp is a network ip,68 * i.e. 192.168.xxx.0, assign 192.168.xxx.1 for the hostonly adapter */90 // ip returned by VBoxNetCfgWinGenHostOnlyNetworkNetworkIp is a network ip, 91 // i.e. 192.168.xxx.0, assign 192.168.xxx.1 for the hostonly adapter 69 92 ip = ip | (1 << 24); 70 93 hr = VBoxNetCfgWinEnableStaticIpConfig(&guid, ip, mask); … … 81 104 else 82 105 printf("VBoxNetCfgWinCreateHostOnlyNetworkInterface failed: hr = 0x%x\n", hr); 83 } 84 else 85 { 86 printf("GetFullPathNameW failed: winEr = %d\n", dwErr); 106 */ 107 } 108 else 109 { 110 wprintf(L"GetFullPathNameW failed: winEr = %d\n", dwErr); 87 111 hr = HRESULT_FROM_WIN32(dwErr); 88 112 … … 91 115 } 92 116 else 93 printf("Error initializing COM (0x%x)\n", hr);117 wprintf(L"Error initializing COM (0x%x)\n", hr); 94 118 95 119 VBoxNetCfgWinSetLogging(NULL);
Note:
See TracChangeset
for help on using the changeset viewer.