ReactOS 0.4.16-dev-1946-g52006dd
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 269 of file netsh.c.

271{
272 DPRINT("FreeQuotedString(%S)\n", pszQuotedString);
273 HeapFree(GetProcessHeap(), 0, pszQuotedString);
274}
#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 278 of file netsh.c.

280{
281 DPRINT("FreeString(%S)\n", pszString);
282 LocalFree(pszString);
283}
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 287 of file netsh.c.

289{
290 LPWSTR pszQuotedString;
291
292 DPRINT("MakeQuotedString(%S)\n", pszString);
293
294 pszQuotedString = HeapAlloc(GetProcessHeap(), 0, (wcslen(pszString) + 3) * sizeof(WCHAR));
295 if (pszQuotedString == NULL)
296 return NULL;
297
298 swprintf(pszQuotedString, L"\"%s\"", pszString);
299
300 return pszQuotedString;
301}
#define NULL
Definition: types.h:112
#define HeapAlloc
Definition: compat.h:733
#define swprintf
Definition: precomp.h:40
#define L(x)
Definition: resources.c:13
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
__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 305 of file netsh.c.

309{
310 LPWSTR pszInBuffer, pszOutBuffer = NULL;
312 va_list ap;
313
314 DPRINT("MakeString(%p %lu ...)\n", hModule, dwMsgId);
315
316 va_start(ap, dwMsgId);
317
318 pszInBuffer = HeapAlloc(GetProcessHeap(), 0, HUGE_BUFFER_SIZE * sizeof(WCHAR));
319 if (pszInBuffer == NULL)
320 return NULL;
321
322 dwLength = LoadStringW(hModule, dwMsgId, pszInBuffer, HUGE_BUFFER_SIZE);
323 if (dwLength > 0)
324 goto done;
325
327 pszInBuffer,
328 0,
329 0,
330 (LPWSTR)&pszOutBuffer,
331 0,
332 &ap);
333
334done:
335 if (pszInBuffer)
336 HeapFree(GetProcessHeap(), 0, pszInBuffer);
337
338 return pszOutBuffer;
339}
char * va_list
Definition: acmsvcex.h:78
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define HUGE_BUFFER_SIZE
Definition: precomp.h:38
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
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
Definition: string.c:1220
unsigned long DWORD
Definition: ntddk_ex.h:95
HMODULE hModule
Definition: netsh.c:17
#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

◆ NsGetFriendlyNameFromIfName()

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

Definition at line 385 of file netsh.c.

390{
391 UNICODE_STRING UnicodeIfName;
394 DWORD ret;
395
396 DPRINT("NsGetFriendlyNameFromIfName(%lx %S %p %p)\n",
397 dwUnknown1, pszIfName, pszFriendlyName, pdwFriendlyName);
398
399 RtlInitUnicodeString(&UnicodeIfName, pszIfName);
400 Status = RtlGUIDFromString(&UnicodeIfName,
402 if (!NT_SUCCESS(Status))
403 {
404 DPRINT1("RtlGUIDFromString failed 0x%08lx\n", Status);
406 }
407
409 pszFriendlyName,
410 pdwFriendlyName,
411 0, 0);
412 if (ret != ERROR_SUCCESS)
413 {
414 DPRINT1("NhGetInterfaceNameFromDeviceGuid() failed %lu\n", ret);
415 }
416
417 return ret;
418}
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
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING, GUID *)
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
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)
static const GUID InterfaceGuid
Definition: wlanapi.c:25