AllocADsStr function (adshlp.h)

The AllocADsStr function allocates memory for and copies a specified string.

Syntax

LPWSTR AllocADsStr(
  [in] LPCWSTR pStr
);

Parameters

[in] pStr

Type: LPWSTR

Pointer to a null-terminated Unicode string to be copied.

Return value

Type: LPWSTR

When successful, the function returns a non-NULL pointer to the allocated memory. The string in pStr is copied to this buffer and null-terminated. The caller must free this memory when it is no longer required by passing the returned pointer to FreeADsStr.

Returns NULL if not successful. Call ADsGetLastError to obtain the extended error status. For more information about error code values, see ADSI Error Codes.

Remarks

For more information and a code example that shows how to use the AllocADsStr function, see ReallocADsStr.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header adshlp.h
Library Activeds.lib
DLL Activeds.dll

See also

ADSI Functions

ADsGetLastError

FreeADsStr

ReallocADsStr