tap: Add checking bind on Windows8
authorMunkyu Im <munkyu.im@samsung.com>
Fri, 16 Jan 2015 09:12:34 +0000 (18:12 +0900)
committerminkee.lee <minkee.lee@samsung.com>
Sat, 2 May 2015 07:19:25 +0000 (16:19 +0900)
It's changed to check binding list of network bridge from windows8.
Registry key has been changed.

Change-Id: I8ef3687cf069a5a494f248689fcd5b67791b6fca
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
common-project/src/org/tizen/emulator/manager/tool/TapUtil.java

index 4e67433..d015947 100644 (file)
@@ -271,6 +271,7 @@ public class TapUtil {
                                                        if (subKey2.equals(key)) {
                                                                String tapName = Advapi32Util.registryGetStringValue(root,  topKey + "\\" + subKey + "\\" + key, value);
                                                                if (tapName != null) {
+                                                                       EMLogger.getLogger().warning("tapname added: " + tapName);
                                                                        tapNameList.add(tapName);
                                                                }
                                                        }
@@ -353,8 +354,12 @@ public class TapUtil {
                                                }
                                        }
                                }
-
-                               topKey = "SYSTEM\\CurrentControlSet\\services\\Bridge\\Linkage";
+                               EMLogger.getLogger().warning("found tapid: " + foundTapId);
+                               if (System.getProperty("os.name").startsWith("Windows 8")) {
+                                       topKey = "SYSTEM\\CurrentControlSet\\services\\NdisImPlatform\\Linkage";
+                               } else {
+                                       topKey = "SYSTEM\\CurrentControlSet\\services\\Bridge\\Linkage";
+                               }
                                value = "Route";
                                String valueArr[] = Advapi32Util.registryGetStringArray(root,  topKey, value);
                                for (String str : valueArr) {
@@ -365,7 +370,7 @@ public class TapUtil {
                                }
 
                        } catch (Win32Exception e) {
-
+                               EMLogger.getLogger().warning("Failed to check if tap exists in bridge or not" + e.getMessage());
                        } finally {
                                if (regKey != null) {
                                        Advapi32Util.registryCloseKey(regKey.getValue());
@@ -490,7 +495,7 @@ public class TapUtil {
                                        bridgeId = arr[arr.length - 1];
                                }
                        } catch (Win32Exception e) {
-
+                               EMLogger.getLogger().warning("Failed to getBridgeId(): " + e.getMessage());
                        }
                }
                return bridgeId;