Skip to content

Commit bfee65f

Browse files
committed
[NETSH] Implement MakeQuotedString() and FreeQuotedString()
These functions are used by WinXPs ifmon.dll.
1 parent 78a7372 commit bfee65f

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

base/applications/network/netsh/netsh.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,32 @@ wmain(
194194
return result;
195195
}
196196

197+
VOID
198+
WINAPI
199+
FreeQuotedString(
200+
_In_ LPWSTR pszQuotedString)
201+
{
202+
DPRINT("FreeQuotedString(%S)\n", pszQuotedString);
203+
HeapFree(GetProcessHeap(), 0, pszQuotedString);
204+
}
205+
206+
LPWSTR
207+
WINAPI
208+
MakeQuotedString(
209+
_In_ LPWSTR pszString)
210+
{
211+
LPWSTR pszQuotedString;
212+
213+
DPRINT("MakeQuotedString(%S)\n", pszString);
214+
215+
pszQuotedString = HeapAlloc(GetProcessHeap(), 0, (wcslen(pszString) + 3) * sizeof(WCHAR));
216+
if (pszQuotedString == NULL)
217+
return NULL;
218+
219+
swprintf(pszQuotedString, L"\"%s\"", pszQuotedString);
220+
221+
return pszQuotedString;
222+
}
197223

198224
DWORD
199225
WINAPI

base/applications/network/netsh/netsh.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
@ stub ConvertStringToGuid
33
@ stub DisplayMessageM
44
@ stub DisplayMessageToConsole
5-
@ stub FreeQuotedString
5+
@ stdcall FreeQuotedString(wstr)
66
@ stub FreeString
77
@ stub GenericMonitor
88
@ stub GetEnumString
99
@ stub GetHostMachineInfo
1010
@ stub InitializeConsole
11-
@ stub MakeQuotedString
11+
@ stdcall MakeQuotedString(wstr)
1212
@ stub MakeString
1313
@ stub MatchCmdLine
1414
@ stdcall MatchEnumTag(ptr wstr long ptr ptr)

sdk/include/reactos/netsh_undoc.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
#ifndef __NETSH_UNDOC_H__
22
#define __NETSH_UNDOC_H__
33

4+
VOID
5+
WINAPI
6+
FreeQuotedString(
7+
_In_ LPWSTR pszQuotedString);
8+
9+
LPWSTR
10+
WINAPI
11+
MakeQuotedString(
12+
_In_ LPWSTR pszString);
13+
414
DWORD
515
WINAPI
616
NsGetFriendlyNameFromIfName(

0 commit comments

Comments
 (0)