Last change
on this file since 21333 was 21333, checked in by vboxsync, 16 years ago |
Net[Flt,Adp]/win: export to OSE, disabled by default
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.0 KB
|
Line | |
---|
1 | /* $Id: NetAdpUninstall.cpp 21333 2009-07-07 14:39:32Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * NetAdpUninstall - VBoxNetAdp uninstaller command line tool
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
8 | *
|
---|
9 | * Sun Microsystems, Inc. confidential
|
---|
10 | * All rights reserved
|
---|
11 | */
|
---|
12 |
|
---|
13 | #include <vbox/WinNetConfig.h>
|
---|
14 | #include <stdio.h>
|
---|
15 |
|
---|
16 | static VOID winNetCfgLogger (LPCWSTR szString)
|
---|
17 | {
|
---|
18 | wprintf(L"%s", szString);
|
---|
19 | }
|
---|
20 |
|
---|
21 | static int UninstallNetAdp()
|
---|
22 | {
|
---|
23 | int r = 0;
|
---|
24 | VBoxNetCfgWinSetLogging(winNetCfgLogger);
|
---|
25 |
|
---|
26 | printf("uninstalling all Host-Only interfaces..\n");
|
---|
27 |
|
---|
28 | HRESULT hr = CoInitialize(NULL);
|
---|
29 | if(hr == S_OK)
|
---|
30 | {
|
---|
31 | hr = VBoxNetCfgWinRemoveAllNetDevicesOfId(L"sun_VBoxNetAdp");
|
---|
32 | if(hr == S_OK)
|
---|
33 | {
|
---|
34 | printf("uninstalled successfully\n");
|
---|
35 | }
|
---|
36 | else
|
---|
37 | {
|
---|
38 | printf("uninstall failed, hr = 0x%x\n", hr);
|
---|
39 | }
|
---|
40 |
|
---|
41 | CoUninitialize();
|
---|
42 | }
|
---|
43 | else
|
---|
44 | {
|
---|
45 | wprintf(L"Error initializing COM (0x%x)\n", hr);
|
---|
46 | r = 1;
|
---|
47 | }
|
---|
48 |
|
---|
49 | VBoxNetCfgWinSetLogging(NULL);
|
---|
50 |
|
---|
51 | return r;
|
---|
52 | }
|
---|
53 |
|
---|
54 | int __cdecl main(int argc, char **argv)
|
---|
55 | {
|
---|
56 | return UninstallNetAdp();
|
---|
57 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.