forked from xt-sys/exectos
Implement RtlCopyString() and RtlCopyWideString() routines
This commit is contained in:
parent
015faa53a0
commit
83a976dd3a
@ -110,6 +110,18 @@ RtlCopyMemory(OUT PVOID Destination,
|
|||||||
IN PCVOID Source,
|
IN PCVOID Source,
|
||||||
IN SIZE_T Length);
|
IN SIZE_T Length);
|
||||||
|
|
||||||
|
XTAPI
|
||||||
|
VOID
|
||||||
|
RtlCopyString(IN PCHAR Destination,
|
||||||
|
IN PCCHAR Source,
|
||||||
|
IN ULONG Length);
|
||||||
|
|
||||||
|
XTAPI
|
||||||
|
VOID
|
||||||
|
RtlCopyWideString(IN PWCHAR Destination,
|
||||||
|
IN CONST PWCHAR Source,
|
||||||
|
IN ULONG Length);
|
||||||
|
|
||||||
XTAPI
|
XTAPI
|
||||||
LARGE_INTEGER
|
LARGE_INTEGER
|
||||||
RtlDivideLargeInteger(IN LARGE_INTEGER Dividend,
|
RtlDivideLargeInteger(IN LARGE_INTEGER Dividend,
|
||||||
|
@ -187,6 +187,48 @@ RtlConcatenateString(OUT PCHAR Destination,
|
|||||||
return DestString;
|
return DestString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies a 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 string to copy.
|
||||||
|
*
|
||||||
|
* @return This routine does not return any value.
|
||||||
|
*
|
||||||
|
* @since XT 1.0
|
||||||
|
*/
|
||||||
|
XTAPI
|
||||||
|
VOID
|
||||||
|
RtlCopyString(IN PCHAR Destination,
|
||||||
|
IN PCCHAR 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] == '\0')
|
||||||
|
{
|
||||||
|
/* End of source string reached */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Make sure the destination string is terminated properly */
|
||||||
|
Destination[Index] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverses a characters order in a string. It modifies the original, input variable.
|
* Reverses a characters order in a string. It modifies the original, input variable.
|
||||||
*
|
*
|
||||||
|
@ -187,6 +187,49 @@ RtlConcatenateWideString(OUT PWCHAR Destination,
|
|||||||
return DestString;
|
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.
|
* Formats a wide string according to the given printf-alike format string.
|
||||||
*
|
*
|
||||||
|
@ -41,6 +41,8 @@
|
|||||||
@ stdcall RtlConvertToLargeInteger32(long)
|
@ stdcall RtlConvertToLargeInteger32(long)
|
||||||
@ stdcall RtlConvertToLargeIntegerUnsigned32(long)
|
@ stdcall RtlConvertToLargeIntegerUnsigned32(long)
|
||||||
@ stdcall RtlCopyMemory(ptr ptr long)
|
@ stdcall RtlCopyMemory(ptr ptr long)
|
||||||
|
@ stdcall RtlCopyString(ptr ptr long)
|
||||||
|
@ stdcall RtlCopyWideString(ptr ptr long)
|
||||||
@ stdcall RtlDivideLargeInteger(long long long ptr)
|
@ stdcall RtlDivideLargeInteger(long long long ptr)
|
||||||
@ stdcall RtlMoveMemory(ptr ptr long)
|
@ stdcall RtlMoveMemory(ptr ptr long)
|
||||||
@ stdcall RtlMultiplyLargeInteger(long long long)
|
@ stdcall RtlMultiplyLargeInteger(long long long)
|
||||||
|
Loading…
Reference in New Issue
Block a user