Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arnaud Véron
slapos.package
Commits
9b2d05d2
Commit
9b2d05d2
authored
Jul 09, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return 1 when ipwin failed
parent
59224dd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
37 deletions
+37
-37
windows/ipwin/ipwin/ipwin.cpp
windows/ipwin/ipwin/ipwin.cpp
+37
-37
No files found.
windows/ipwin/ipwin/ipwin.cpp
View file @
9b2d05d2
...
@@ -44,7 +44,7 @@ HRESULT SlaposNetCfgGetNetworkInterfaceGuid(IN LPCWSTR pHwid,
...
@@ -44,7 +44,7 @@ HRESULT SlaposNetCfgGetNetworkInterfaceGuid(IN LPCWSTR pHwid,
);
);
void
usage
()
void
usage
()
{
{
printf
(
"Usage: ipwin [command] [options]
\n\n
\
printf
(
"Usage: ipwin [command] [options]
\n\n
\
Get guid of interface:
\n
\
Get guid of interface:
\n
\
ipwin guid HWID CONNECTION-NAME
\n\n
\
ipwin guid HWID CONNECTION-NAME
\n\n
\
For example,
\n
\
For example,
\n
\
...
@@ -70,51 +70,51 @@ Exit status:\n\
...
@@ -70,51 +70,51 @@ Exit status:\n\
int
_tmain
(
int
argc
,
TCHAR
*
argv
[])
int
_tmain
(
int
argc
,
TCHAR
*
argv
[])
{
{
GUID
guid
;
GUID
guid
;
BSTR
pErrMsg
[
1024
]
=
{
0
};
BSTR
pErrMsg
[
1024
]
=
{
0
};
BSTR
pGUID
[
512
]
=
{
0
};
BSTR
pGUID
[
512
]
=
{
0
};
HRESULT
hr
=
CoInitialize
(
NULL
);
HRESULT
hr
=
CoInitialize
(
NULL
);
if
(
argc
==
1
)
{
if
(
argc
==
1
)
{
usage
();
}
else
if
(
wcscmp
(
argv
[
1
],
L"install"
)
==
0
)
{
if
(
argc
!=
5
)
{
usage
();
usage
();
hr
=
E_FAIL
;
}
}
else
if
(
wcscmp
(
argv
[
1
],
L"install"
)
==
0
)
{
else
if
(
argc
!=
5
)
{
hr
=
SlaposNetCfgWinCreateNetworkInterface
(
argv
[
2
],
TRUE
,
argv
[
3
],
argv
[
4
],
&
guid
,
pErrMsg
);
usage
();
}
hr
=
E_FAIL
;
else
if
(
wcscmp
(
argv
[
1
],
L"remove"
)
==
0
)
{
}
if
(
argc
!=
4
)
{
else
usage
();
hr
=
SlaposNetCfgWinCreateNetworkInterface
(
argv
[
2
],
TRUE
,
argv
[
3
],
argv
[
4
],
&
guid
,
pErrMsg
);
hr
=
E_FAIL
;
}
else
if
(
wcscmp
(
argv
[
1
],
L"remove"
)
==
0
)
{
if
(
argc
!=
4
)
{
usage
();
hr
=
E_FAIL
;
}
else
{
hr
=
SlaposNetCfgGetNetworkInterfaceGuid
(
argv
[
2
],
argv
[
3
],
pGUID
,
pErrMsg
);
if
(
hr
==
S_OK
)
{
hr
=
SlaposNetCfgWinRemoveNetworkInterface
(
argv
[
2
],
(
LPCSTR
)
pGUID
,
pErrMsg
);
}
}
}
}
else
if
(
wcscmp
(
argv
[
1
],
L"guid"
)
==
0
)
{
else
{
if
(
argc
!=
4
)
{
hr
=
SlaposNetCfgGetNetworkInterfaceGuid
(
argv
[
2
],
argv
[
3
],
pGUID
,
pErrMsg
);
usage
();
if
(
hr
==
S_OK
)
{
hr
=
E_FAIL
;
hr
=
SlaposNetCfgWinRemoveNetworkInterface
(
argv
[
2
],
(
LPCSTR
)
pGUID
,
pErrMsg
);
}
else
{
hr
=
SlaposNetCfgGetNetworkInterfaceGuid
(
argv
[
2
],
argv
[
3
],
pGUID
,
pErrMsg
);
printf
(
"%s
\n
"
,
hr
==
S_OK
?
pGUID
:
pErrMsg
);
}
}
}
}
else
if
(
wcscmp
(
argv
[
1
],
L"test"
)
==
0
)
{
}
else
if
(
wcscmp
(
argv
[
1
],
L"guid"
)
==
0
)
{
if
(
argc
!=
4
)
{
usage
();
hr
=
E_FAIL
;
}
}
else
{
else
{
usage
();
hr
=
SlaposNetCfgGetNetworkInterfaceGuid
(
argv
[
2
],
argv
[
3
],
pGUID
,
pErrMsg
);
printf
(
"%s
\n
"
,
hr
==
S_OK
?
pGUID
:
pErrMsg
);
}
}
}
else
if
(
wcscmp
(
argv
[
1
],
L"test"
)
==
0
)
{
}
else
{
usage
();
}
CoUninitialize
();
CoUninitialize
();
return
hr
;
return
hr
==
S_OK
?
0
:
1
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment