ReactOS 0.4.17-dev-243-g1369312
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 MatchTagsInCmdLine (_In_ HANDLE hModule, _Inout_ LPWSTR *ppwcArguments, _In_ DWORD dwCurrentIndex, _In_ DWORD dwArgCount, _In_ TAG_TYPE *pttTags, _In_ DWORD dwTagCount, _Out_ DWORD *pdwTagType)
 
DWORD WINAPI NsGetFriendlyNameFromIfName (_In_ DWORD dwParam1, _In_ PWSTR pszIfName, _Inout_ PWSTR pszFriendlyName, _Inout_ PDWORD pdwFriendlyName)
 
DWORD WINAPI NsGetIfNameFromFriendlyName (_In_ DWORD dwUnknown1, _In_ PWSTR pszFriendlyName, _Inout_ PWSTR pszIfName, _Inout_ PDWORD pdwIfName)
 

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 L(x)
Definition: resources.c:13
#define _swprintf(buf, format,...)
Definition: sprintf.c:56
short WCHAR
Definition: pedump.c:58
uint16_t * LPWSTR
Definition: typedefs.h:56

◆ 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
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#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

◆ MatchTagsInCmdLine()

DWORD WINAPI MatchTagsInCmdLine ( _In_ HANDLE  hModule,
_Inout_ LPWSTR ppwcArguments,
_In_ DWORD  dwCurrentIndex,
_In_ DWORD  dwArgCount,
_In_ TAG_TYPE pttTags,
_In_ DWORD  dwTagCount,
_Out_ DWORD pdwTagType 
)

Definition at line 375 of file netsh.c.

383{
384 PWSTR pszEqual;
385 DWORD i, j, dwTagLength;
386
387 DPRINT1("MatchTagsInCmdLine(%p %p %lu %lu %p %lu %p)\n",
389 pttTags, dwTagCount, pdwTagType);
390
391 for (i = dwCurrentIndex; i < dwArgCount; i++)
392 {
393 DPRINT("Argument %lu: %S\n", i, ppwcArguments[i]);
394 pdwTagType[i - dwCurrentIndex] = (DWORD)-1;
395
396 /* Skip arguments that do not have a tag */
397 pszEqual = wcschr(ppwcArguments[i], L'=');
398 if (pszEqual == NULL)
399 continue;
400
401 dwTagLength = pszEqual - ppwcArguments[i];
402 DPRINT("Tag length %lu\n", dwTagLength);
403 DPRINT("Value length %lu\n", wcslen(pszEqual + 1));
404
405 pdwTagType[i - dwCurrentIndex] = (DWORD)-1;
406 for (j = 0; j < dwTagCount; j++)
407 {
408 DPRINT("Test tag %S -- %S\n", pttTags[j].pwszTag, ppwcArguments[i]);
409 if ((wcslen(pttTags[j].pwszTag) == dwTagLength) &&
410 (_wcsnicmp(ppwcArguments[i], pttTags[j].pwszTag, dwTagLength) == 0))
411 {
412 DPRINT("Found tag %S\n", pttTags[j].pwszTag);
413 pttTags[j].bPresent = TRUE;
414 pdwTagType[i - dwCurrentIndex] = j;
415
416 /* Remove the tag name from the argument */
417 wcscpy(ppwcArguments[i], pszEqual + 1);
418 }
419 }
420 }
421
422 return 0;
423}
#define DPRINT1
Definition: precomp.h:8
#define TRUE
Definition: types.h:120
#define wcschr
Definition: compat.h:17
_ACRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t)
Definition: wcs.c:195
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
_In_ LPWSTR * ppwcArguments
Definition: netsh.h:114
_In_ LPWSTR _In_ DWORD dwArgCount
Definition: netsh.h:115
_In_ LPWSTR _In_ DWORD dwCurrentIndex
Definition: netsh.h:139
#define DWORD
Definition: nt_native.h:44
wcscpy
uint16_t * PWSTR
Definition: typedefs.h:56

Referenced by IpSetAddress().

◆ NsGetFriendlyNameFromIfName()

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

Definition at line 441 of file netsh.c.

446{
447 UNICODE_STRING UnicodeIfName;
450 DWORD ret;
451
452 DPRINT("NsGetFriendlyNameFromIfName(%lx %S %p %p)\n",
453 dwUnknown1, pszIfName, pszFriendlyName, pdwFriendlyName);
454
455 RtlInitUnicodeString(&UnicodeIfName, pszIfName);
456 Status = RtlGUIDFromString(&UnicodeIfName,
458 if (!NT_SUCCESS(Status))
459 {
460 DPRINT1("RtlGUIDFromString failed 0x%08lx\n", Status);
462 }
463
465 pszFriendlyName,
466 pdwFriendlyName,
467 0, 0);
468 if (ret != ERROR_SUCCESS)
469 {
470 DPRINT1("NhGetInterfaceNameFromDeviceGuid() failed %lu\n", ret);
471 }
472
473 return ret;
474}
LONG NTSTATUS
Definition: precomp.h:26
#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:24
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

◆ NsGetIfNameFromFriendlyName()

DWORD WINAPI NsGetIfNameFromFriendlyName ( _In_ DWORD  dwUnknown1,
_In_ PWSTR  pszFriendlyName,
_Inout_ PWSTR  pszIfName,
_Inout_ PDWORD  pdwIfName 
)

Definition at line 478 of file netsh.c.

483{
484 DPRINT1("NsGetIfNameFromFriendlyName(%lx %S %p %p)\n",
485 dwUnknown1, pszFriendlyName, pszIfName, pdwIfName);
486 return 0;
487}