mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[NETAPI32] Add the NetpAllocStrFromWStr helper function
This commit is contained in:
parent
3d5c682cd8
commit
61ac4f1ee9
3 changed files with 38 additions and 1 deletions
|
@ -167,6 +167,38 @@ NetpAllocAnsiStrFromWStr(
|
|||
}
|
||||
|
||||
|
||||
PSTR
|
||||
WINAPI
|
||||
NetpAllocStrFromWStr(
|
||||
_In_ PWSTR InString)
|
||||
{
|
||||
UNICODE_STRING UnicodeString;
|
||||
OEM_STRING OemString;
|
||||
ULONG Size;
|
||||
NET_API_STATUS NetStatus;
|
||||
NTSTATUS Status;
|
||||
|
||||
RtlInitUnicodeString(&UnicodeString, InString);
|
||||
|
||||
Size = RtlUnicodeStringToOemSize(&UnicodeString);
|
||||
NetStatus = NetApiBufferAllocate(Size,
|
||||
(PVOID*)&OemString.Buffer);
|
||||
if (NetStatus != NERR_Success)
|
||||
return NULL;
|
||||
|
||||
Status = RtlUnicodeStringToOemString(&OemString,
|
||||
&UnicodeString,
|
||||
FALSE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
NetApiBufferFree(OemString.Buffer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return OemString.Buffer;
|
||||
}
|
||||
|
||||
|
||||
PWSTR
|
||||
WINAPI
|
||||
NetpAllocWStrFromAnsiStr(
|
||||
|
|
|
@ -69,6 +69,11 @@ WINAPI
|
|||
NetpAllocAnsiStrFromWStr(
|
||||
_In_ PWSTR InString);
|
||||
|
||||
PSTR
|
||||
WINAPI
|
||||
NetpAllocStrFromWStr(
|
||||
_In_ PWSTR InString);
|
||||
|
||||
PWSTR
|
||||
WINAPI
|
||||
NetpAllocWStrFromAnsiStr(
|
||||
|
|
|
@ -268,7 +268,7 @@
|
|||
@ stub NetpAddTlnFtinfoEntry
|
||||
@ stub NetpAllocConfigName
|
||||
@ stub NetpAllocFtinfoEntry
|
||||
@ stub NetpAllocStrFromWStr
|
||||
@ stdcall NetpAllocStrFromWStr(wstr)
|
||||
@ stdcall NetpAllocWStrFromStr(str)
|
||||
@ stdcall NetpAllocWStrFromWStr(wstr)
|
||||
@ stub NetpApiStatusToNtStatus
|
||||
|
|
Loading…
Reference in a new issue