ReactOS 0.4.16-dev-2522-g97cc325
netsh_undoc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

VOID WINAPI FreeQuotedString (_In_ LPWSTR pszQuotedString)
 
VOID WINAPI FreeString (_In_ LPWSTR pszString)
 
LPWSTR WINAPI MakeQuotedString (_In_ LPWSTR pszString)
 
LPWSTR CDECL MakeString (_In_ HANDLE hModule, _In_ DWORD dwMsgId,...)
 
DWORD WINAPI NsGetFriendlyNameFromIfName (_In_ DWORD dwParam1, _In_ PWSTR pszIfName, _Inout_ PWSTR pszFriendlyName, _Inout_ PDWORD pdwFriendlyName)
 

Function Documentation

◆ FreeQuotedString()

VOID WINAPI FreeQuotedString ( _In_ LPWSTR  pszQuotedString)

Definition at line 270 of file netsh.c.

272{
273 DPRINT("FreeQuotedString(%S)\n", pszQuotedString);
274 HeapFree(GetProcessHeap(), 0, pszQuotedString);
275}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
#define DPRINT
Definition: sndvol32.h:73

◆ FreeString()

VOID WINAPI FreeString ( _In_ LPWSTR  pszString)

Definition at line 279 of file netsh.c.

281{
282 DPRINT("FreeString(%S)\n", pszString);
283 LocalFree(pszString);
284}
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594

Referenced by CreateProcessInternalW(), IKsFilterFactory_fnInitialize(), and LoadLibraryExW().

◆ MakeQuotedString()

LPWSTR WINAPI MakeQuotedString ( _In_ LPWSTR  pszString)

Definition at line 288 of file netsh.c.

290{
291 LPWSTR pszQuotedString;
292
293 DPRINT("MakeQuotedString(%S)\n", pszString);
294
295 pszQuotedString = HeapAlloc(GetProcessHeap(), 0, (wcslen(pszString) + 3) * sizeof(WCHAR));
296 if (pszQuotedString == NULL)
297 return NULL;
298
299 swprintf(pszQuotedString, L"\"%s\"", pszString);
300
301 return pszQuotedString;
302}
#define NULL
Definition: types.h:112
#define HeapAlloc
Definition: compat.h:733
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
#define swprintf
Definition: precomp.h:40
#define L(x)
Definition: resources.c:13
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ MakeString()

LPWSTR CDECL MakeString ( _In_ HANDLE  hModule,
_In_ DWORD  dwMsgId,
  ... 
)

Definition at line 306 of file netsh.c.

310{
311 LPCWSTR pszStr;
312 LPWSTR pszInBuffer, pszOutBuffer = NULL;
314 va_list ap;
315
316 DPRINT("MakeString(%p %lu ...)\n", hModule, dwMsgId);
317
318 dwLength = LoadStringW(hModule, dwMsgId, (LPWSTR)&pszStr, 0);
319 if (dwLength == 0)
320 return NULL;
321
322 /* Allocate and copy the resource string, NUL-terminated */
323 pszInBuffer = HeapAlloc(GetProcessHeap(), 0, (dwLength + 1) * sizeof(WCHAR));
324 if (pszInBuffer == NULL)
325 return NULL;
326 CopyMemory(pszInBuffer, pszStr, dwLength * sizeof(WCHAR));
327 pszInBuffer[dwLength] = UNICODE_NULL;
328
329 va_start(ap, dwMsgId);
331 pszInBuffer,
332 0,
333 0,
334 (LPWSTR)&pszOutBuffer,
335 0,
336 &ap);
337 va_end(ap);
338
339 HeapFree(GetProcessHeap(), 0, pszInBuffer);
340
341 return pszOutBuffer;
342}
HMODULE hModule
Definition: animate.c:44
static DWORD DWORD * dwLength
Definition: fusion.c:86
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define va_end(v)
Definition: stdarg.h:28
#define va_start(v, l)
Definition: stdarg.h:26
char * va_list
Definition: vadefs.h:50
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CopyMemory
Definition: minwinbase.h:29
#define UNICODE_NULL
#define LoadStringW
Definition: utils.h:64
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:398
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:396
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ NsGetFriendlyNameFromIfName()

DWORD WINAPI NsGetFriendlyNameFromIfName ( _In_ DWORD  dwParam1,
_In_ PWSTR  pszIfName,
_Inout_ PWSTR  pszFriendlyName,
_Inout_ PDWORD  pdwFriendlyName 
)

Definition at line 388 of file netsh.c.

393{
394 UNICODE_STRING UnicodeIfName;
397 DWORD ret;
398
399 DPRINT("NsGetFriendlyNameFromIfName(%lx %S %p %p)\n",
400 dwUnknown1, pszIfName, pszFriendlyName, pdwFriendlyName);
401
402 RtlInitUnicodeString(&UnicodeIfName, pszIfName);
403 Status = RtlGUIDFromString(&UnicodeIfName,
405 if (!NT_SUCCESS(Status))
406 {
407 DPRINT1("RtlGUIDFromString failed 0x%08lx\n", Status);
409 }
410
412 pszFriendlyName,
413 pdwFriendlyName,
414 0, 0);
415 if (ret != ERROR_SUCCESS)
416 {
417 DPRINT1("NhGetInterfaceNameFromDeviceGuid() failed %lu\n", ret);
418 }
419
420 return ret;
421}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
return ret
Definition: mutex.c:146
Status
Definition: gdiplustypes.h:25
DWORD WINAPI NhGetInterfaceNameFromDeviceGuid(_In_ const GUID *pInterfaceGUID, _Out_writes_bytes_to_(*pOutBufLen, *pOutBufLen) PWCHAR pInterfaceName, _Inout_ PULONG pOutBufLen, DWORD dwUnknown4, DWORD dwUnknown5)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
static const GUID InterfaceGuid
Definition: wlanapi.c:25