mirror of
https://github.com/reactos/reactos.git
synced 2024-08-01 09:01:13 +00:00
Display more meaningful failure messages
svn path=/trunk/; revision=19257
This commit is contained in:
parent
5c322795a8
commit
3edc7dd1e7
|
@ -32,6 +32,7 @@
|
||||||
#define _UNICODE
|
#define _UNICODE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LPCTSTR GetNodeTypeName(UINT NodeType)
|
LPCTSTR GetNodeTypeName(UINT NodeType)
|
||||||
{
|
{
|
||||||
switch (NodeType) {
|
switch (NodeType) {
|
||||||
|
@ -104,6 +105,8 @@ INT ShowInfo(BOOL bAll)
|
||||||
ULONG netOutBufLen;
|
ULONG netOutBufLen;
|
||||||
PIP_ADDR_STRING pIPAddr = NULL;
|
PIP_ADDR_STRING pIPAddr = NULL;
|
||||||
|
|
||||||
|
DWORD ErrRet = 0;
|
||||||
|
|
||||||
/* assign memory for call to GetNetworkParams */
|
/* assign memory for call to GetNetworkParams */
|
||||||
pFixedInfo = (FIXED_INFO *) GlobalAlloc( GPTR, sizeof( FIXED_INFO ) );
|
pFixedInfo = (FIXED_INFO *) GlobalAlloc( GPTR, sizeof( FIXED_INFO ) );
|
||||||
netOutBufLen = sizeof(FIXED_INFO);
|
netOutBufLen = sizeof(FIXED_INFO);
|
||||||
|
@ -126,15 +129,17 @@ INT ShowInfo(BOOL bAll)
|
||||||
pAdapterInfo = (IP_ADAPTER_INFO *) malloc (adaptOutBufLen);
|
pAdapterInfo = (IP_ADAPTER_INFO *) malloc (adaptOutBufLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! GetAdaptersInfo(pAdapterInfo, &adaptOutBufLen) == NO_ERROR)
|
if ((ErrRet = GetAdaptersInfo(pAdapterInfo, &adaptOutBufLen)) != NO_ERROR)
|
||||||
{
|
{
|
||||||
_tprintf(_T("GetAdaptersInfo failed %lu\n"), GetLastError());
|
_tprintf(_T("GetAdaptersInfo failed : "));
|
||||||
|
DoFormatMessage(ErrRet);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! GetNetworkParams(pFixedInfo, &netOutBufLen) == NO_ERROR)
|
if ((ErrRet = GetNetworkParams(pFixedInfo, &netOutBufLen)) != NO_ERROR)
|
||||||
{
|
{
|
||||||
_tprintf(_T("GetNetworkParams failed %lu\n"), GetLastError());
|
_tprintf(_T("GetNetworkParams failed : "));
|
||||||
|
DoFormatMessage(ErrRet);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue