mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:12:59 +00:00
[NETAPI32] Implement DsGetSiteNameA
Also add the NetpAllocAnsiStrFromWStr helper function.
This commit is contained in:
parent
0b129da05c
commit
3d5c682cd8
3 changed files with 74 additions and 4 deletions
|
@ -135,6 +135,38 @@ NetUnregisterDomainNameChangeNotification(
|
|||
}
|
||||
|
||||
|
||||
PSTR
|
||||
WINAPI
|
||||
NetpAllocAnsiStrFromWStr(
|
||||
_In_ PWSTR InString)
|
||||
{
|
||||
UNICODE_STRING UnicodeString;
|
||||
ANSI_STRING AnsiString;
|
||||
ULONG Size;
|
||||
NET_API_STATUS NetStatus;
|
||||
NTSTATUS Status;
|
||||
|
||||
RtlInitUnicodeString(&UnicodeString, InString);
|
||||
|
||||
Size = RtlUnicodeStringToAnsiSize(&UnicodeString);
|
||||
NetStatus = NetApiBufferAllocate(Size,
|
||||
(PVOID*)&AnsiString.Buffer);
|
||||
if (NetStatus != NERR_Success)
|
||||
return NULL;
|
||||
|
||||
Status = RtlUnicodeStringToAnsiString(&AnsiString,
|
||||
&UnicodeString,
|
||||
FALSE);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
NetApiBufferFree(AnsiString.Buffer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return AnsiString.Buffer;
|
||||
}
|
||||
|
||||
|
||||
PWSTR
|
||||
WINAPI
|
||||
NetpAllocWStrFromAnsiStr(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue