mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[IPCONFIG] Revert changes that were not meant to be published yet
This commit is contained in:
parent
789edebfac
commit
f63310b056
1 changed files with 65 additions and 92 deletions
|
@ -34,59 +34,6 @@
|
||||||
HINSTANCE hInstance;
|
HINSTANCE hInstance;
|
||||||
HANDLE ProcessHeap;
|
HANDLE ProcessHeap;
|
||||||
|
|
||||||
BOOL
|
|
||||||
DoNamesMatch(
|
|
||||||
_In_ LPWSTR pszName,
|
|
||||||
_In_ LPTSTR pszPattern)
|
|
||||||
{
|
|
||||||
if (pszPattern == NULL)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
// if (_wcsicmp(pszName, pszPattern) == 0)
|
|
||||||
// return TRUE;
|
|
||||||
#if 0
|
|
||||||
for (;;)
|
|
||||||
{
|
|
||||||
if (*pszPattern == L'*')
|
|
||||||
{
|
|
||||||
pszPattern++;
|
|
||||||
if (*pszPattern == L'\0')
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
while (towlower(*pszName) != towlower(*pszPattern))
|
|
||||||
{
|
|
||||||
if (*pszName == L'\0')
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
pszName++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (*pszPattern == L'?')
|
|
||||||
{
|
|
||||||
pszPattern++;
|
|
||||||
|
|
||||||
if (*pszName == L'\0')
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
pszName++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (*pszName == L'\0' && *pszPattern == L'\0')
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
if (towlower(*pszName) != towlower(*pszPattern))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
pszName++;
|
|
||||||
pszPattern++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
int LoadStringAndOem(HINSTANCE hInst,
|
int LoadStringAndOem(HINSTANCE hInst,
|
||||||
UINT uID,
|
UINT uID,
|
||||||
LPTSTR szNode,
|
LPTSTR szNode,
|
||||||
|
@ -660,6 +607,10 @@ VOID Release(LPTSTR Index)
|
||||||
IP_ADAPTER_INDEX_MAP AdapterInfo;
|
IP_ADAPTER_INDEX_MAP AdapterInfo;
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
DWORD i;
|
DWORD i;
|
||||||
|
|
||||||
|
/* if interface is not given, query GetInterfaceInfo */
|
||||||
|
if (Index == NULL)
|
||||||
|
{
|
||||||
PIP_INTERFACE_INFO pInfo = NULL;
|
PIP_INTERFACE_INFO pInfo = NULL;
|
||||||
ULONG ulOutBufLen = 0;
|
ULONG ulOutBufLen = 0;
|
||||||
|
|
||||||
|
@ -672,8 +623,6 @@ VOID Release(LPTSTR Index)
|
||||||
if (GetInterfaceInfo(pInfo, &ulOutBufLen) == NO_ERROR )
|
if (GetInterfaceInfo(pInfo, &ulOutBufLen) == NO_ERROR )
|
||||||
{
|
{
|
||||||
for (i = 0; i < pInfo->NumAdapters; i++)
|
for (i = 0; i < pInfo->NumAdapters; i++)
|
||||||
{
|
|
||||||
if (DoNamesMatch(pInfo->Adapter[i].Name, Index))
|
|
||||||
{
|
{
|
||||||
CopyMemory(&AdapterInfo, &pInfo->Adapter[i], sizeof(IP_ADAPTER_INDEX_MAP));
|
CopyMemory(&AdapterInfo, &pInfo->Adapter[i], sizeof(IP_ADAPTER_INDEX_MAP));
|
||||||
_tprintf(_T("name - %ls\n"), pInfo->Adapter[i].Name);
|
_tprintf(_T("name - %ls\n"), pInfo->Adapter[i].Name);
|
||||||
|
@ -685,7 +634,6 @@ VOID Release(LPTSTR Index)
|
||||||
DoFormatMessage(ret);
|
DoFormatMessage(ret);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
HeapFree(ProcessHeap, 0, pInfo);
|
HeapFree(ProcessHeap, 0, pInfo);
|
||||||
}
|
}
|
||||||
|
@ -701,14 +649,31 @@ VOID Release(LPTSTR Index)
|
||||||
DoFormatMessage(0);
|
DoFormatMessage(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
;
|
||||||
|
/* FIXME:
|
||||||
|
* we need to be able to release connections by name with support for globbing
|
||||||
|
* i.e. ipconfig /release Eth* will release all cards starting with Eth...
|
||||||
|
* ipconfig /release *con* will release all cards with 'con' in their name
|
||||||
|
*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VOID Renew(LPTSTR Index)
|
VOID Renew(LPTSTR Index)
|
||||||
{
|
{
|
||||||
IP_ADAPTER_INDEX_MAP AdapterInfo;
|
IP_ADAPTER_INDEX_MAP AdapterInfo;
|
||||||
|
DWORD i;
|
||||||
|
|
||||||
|
/* if interface is not given, query GetInterfaceInfo */
|
||||||
|
if (Index == NULL)
|
||||||
|
{
|
||||||
PIP_INTERFACE_INFO pInfo;
|
PIP_INTERFACE_INFO pInfo;
|
||||||
ULONG ulOutBufLen = 0;
|
ULONG ulOutBufLen = 0;
|
||||||
DWORD i;
|
|
||||||
|
|
||||||
pInfo = (IP_INTERFACE_INFO *)HeapAlloc(ProcessHeap, 0, sizeof(IP_INTERFACE_INFO));
|
pInfo = (IP_INTERFACE_INFO *)HeapAlloc(ProcessHeap, 0, sizeof(IP_INTERFACE_INFO));
|
||||||
if (pInfo == NULL)
|
if (pInfo == NULL)
|
||||||
|
@ -734,8 +699,6 @@ VOID Renew(LPTSTR Index)
|
||||||
if (GetInterfaceInfo(pInfo, &ulOutBufLen) == NO_ERROR)
|
if (GetInterfaceInfo(pInfo, &ulOutBufLen) == NO_ERROR)
|
||||||
{
|
{
|
||||||
for (i = 0; i < pInfo->NumAdapters; i++)
|
for (i = 0; i < pInfo->NumAdapters; i++)
|
||||||
{
|
|
||||||
if (DoNamesMatch(pInfo->Adapter[i].Name, Index))
|
|
||||||
{
|
{
|
||||||
CopyMemory(&AdapterInfo, &pInfo->Adapter[i], sizeof(IP_ADAPTER_INDEX_MAP));
|
CopyMemory(&AdapterInfo, &pInfo->Adapter[i], sizeof(IP_ADAPTER_INDEX_MAP));
|
||||||
_tprintf(_T("name - %ls\n"), pInfo->Adapter[i].Name);
|
_tprintf(_T("name - %ls\n"), pInfo->Adapter[i].Name);
|
||||||
|
@ -748,7 +711,6 @@ VOID Renew(LPTSTR Index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_tprintf(_T("\nGetInterfaceInfo failed : "));
|
_tprintf(_T("\nGetInterfaceInfo failed : "));
|
||||||
|
@ -756,6 +718,16 @@ VOID Renew(LPTSTR Index)
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapFree(ProcessHeap, 0, pInfo);
|
HeapFree(ProcessHeap, 0, pInfo);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
;
|
||||||
|
/* FIXME:
|
||||||
|
* we need to be able to renew connections by name with support for globbing
|
||||||
|
* i.e. ipconfig /renew Eth* will renew all cards starting with Eth...
|
||||||
|
* ipconfig /renew *con* will renew all cards with 'con' in their name
|
||||||
|
*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
@ -1018,9 +990,10 @@ int main(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
case 3: /* Process all the options that can have 1 parameter */
|
case 3: /* Process all the options that can have 1 parameter */
|
||||||
if (DoRelease)
|
if (DoRelease)
|
||||||
Release(argv[2]);
|
_tprintf(_T("\nSorry /release [adapter] is not implemented yet\n"));
|
||||||
|
//Release(argv[2]);
|
||||||
else if (DoRenew)
|
else if (DoRenew)
|
||||||
Renew(argv[2]);
|
_tprintf(_T("\nSorry /renew [adapter] is not implemented yet\n"));
|
||||||
else if (DoShowclassid)
|
else if (DoShowclassid)
|
||||||
_tprintf(_T("\nSorry /showclassid adapter is not implemented yet\n"));
|
_tprintf(_T("\nSorry /showclassid adapter is not implemented yet\n"));
|
||||||
else if (DoSetclassid)
|
else if (DoSetclassid)
|
||||||
|
|
Loading…
Reference in a new issue