Implement RtlCopyString() and RtlCopyWideString() routines
This commit is contained in:
@@ -187,6 +187,49 @@ RtlConcatenateWideString(OUT PWCHAR Destination,
|
||||
return DestString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies a wide string from a buffer into another buffer, ensuring that the destination string is NULL-terminated.
|
||||
*
|
||||
* @param Destination
|
||||
* Supplies a pointer to the destination buffer.
|
||||
*
|
||||
* @param Source
|
||||
* Supplies a pointer to the source buffer.
|
||||
*
|
||||
* @param Length
|
||||
* Supplies the length of the wide string to copy.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
|
||||
XTAPI
|
||||
VOID
|
||||
RtlCopyWideString(IN PWCHAR Destination,
|
||||
IN CONST PWCHAR Source,
|
||||
IN ULONG Length)
|
||||
{
|
||||
ULONG Index;
|
||||
|
||||
/* Copy characters */
|
||||
for(Index = 0; Index < Length; Index++)
|
||||
{
|
||||
/* Copy source character */
|
||||
Destination[Index] = Source[Index];
|
||||
|
||||
/* Check if NULL terminated character found */
|
||||
if(Source[Index] == L'\0')
|
||||
{
|
||||
/* End of source string reached */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure the destination string is terminated properly */
|
||||
Destination[Index] = L'\0';
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a wide string according to the given printf-alike format string.
|
||||
*
|
||||
|
Reference in New Issue
Block a user