Platform SDK: Active Directory, ADSI, and Directory Services

ReallocADsStr

The ReallocADsStr function makes a "deep" copy of an existing string.

BOOL ReallocADsStr(
  LPWSTR *ppStr, 
  LPWSTR pStr
);

Parameters

ppStr
Pointer to the destination string.
pStr
Source string.

Return Values

The function returns TRUE if the operation is successful, otherwise FALSE.

Remarks

Use this function to make a deep copy of a string. For example:

LPWSTR theSrc = L"This is my string.";
LPWSTR the Dest;
if (ReallocADsStr(&theDest,theSrc) {
    printf("Copy of %S is  %S\", theSrc, theDest);
}
else {
    printf("Out of Memory.");
}

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
  Windows 95/98: Requires Windows 95 or later (with DSClient).
  Header: Declared in Adshlp.h.
  Library: Included as a resource in ActiveDs.dll.

See Also

ADSI Functions, AllocADsStr, FreeADsStr