[NETSH] Implement MakeQuotedString() and FreeQuotedString()

These functions are used by WinXPs ifmon.dll.
This commit is contained in:
Eric Kohl
2025-10-17 15:12:44 +02:00
parent 78a73720cc
commit bfee65f62c
3 changed files with 38 additions and 2 deletions

View File

@@ -194,6 +194,32 @@ done:
return result; return result;
} }
VOID
WINAPI
FreeQuotedString(
_In_ LPWSTR pszQuotedString)
{
DPRINT("FreeQuotedString(%S)\n", pszQuotedString);
HeapFree(GetProcessHeap(), 0, pszQuotedString);
}
LPWSTR
WINAPI
MakeQuotedString(
_In_ LPWSTR pszString)
{
LPWSTR pszQuotedString;
DPRINT("MakeQuotedString(%S)\n", pszString);
pszQuotedString = HeapAlloc(GetProcessHeap(), 0, (wcslen(pszString) + 3) * sizeof(WCHAR));
if (pszQuotedString == NULL)
return NULL;
swprintf(pszQuotedString, L"\"%s\"", pszQuotedString);
return pszQuotedString;
}
DWORD DWORD
WINAPI WINAPI

View File

@@ -2,13 +2,13 @@
@ stub ConvertStringToGuid @ stub ConvertStringToGuid
@ stub DisplayMessageM @ stub DisplayMessageM
@ stub DisplayMessageToConsole @ stub DisplayMessageToConsole
@ stub FreeQuotedString @ stdcall FreeQuotedString(wstr)
@ stub FreeString @ stub FreeString
@ stub GenericMonitor @ stub GenericMonitor
@ stub GetEnumString @ stub GetEnumString
@ stub GetHostMachineInfo @ stub GetHostMachineInfo
@ stub InitializeConsole @ stub InitializeConsole
@ stub MakeQuotedString @ stdcall MakeQuotedString(wstr)
@ stub MakeString @ stub MakeString
@ stub MatchCmdLine @ stub MatchCmdLine
@ stdcall MatchEnumTag(ptr wstr long ptr ptr) @ stdcall MatchEnumTag(ptr wstr long ptr ptr)

View File

@@ -1,6 +1,16 @@
#ifndef __NETSH_UNDOC_H__ #ifndef __NETSH_UNDOC_H__
#define __NETSH_UNDOC_H__ #define __NETSH_UNDOC_H__
VOID
WINAPI
FreeQuotedString(
_In_ LPWSTR pszQuotedString);
LPWSTR
WINAPI
MakeQuotedString(
_In_ LPWSTR pszString);
DWORD DWORD
WINAPI WINAPI
NsGetFriendlyNameFromIfName( NsGetFriendlyNameFromIfName(