* PROJECT: ReactOS kernel
* FILE: ntoskrnl/rtl/capture.c
* PURPOSE: Helper routines for system calls.
- *
+ *
* PROGRAMMERS: David Welch (welch@cwcom.net)
*/
{
UNICODE_STRING Src;
NTSTATUS Status = STATUS_SUCCESS;
-
+
ASSERT(Dest != NULL);
-
+
/*
* Copy the source string structure to kernel space.
*/
-
+
if(CurrentMode == UserMode)
{
RtlZeroMemory(&Src, sizeof(Src));
-
+
_SEH_TRY
{
ProbeForRead(UnsafeSrc,
Status = _SEH_GetExceptionCode();
}
_SEH_END;
-
+
if(!NT_SUCCESS(Status))
{
return Status;
/* capture the string even though it is considered to be valid */
Src = *UnsafeSrc;
}
-
+
/*
* Initialize the destination string.
*/
Status = _SEH_GetExceptionCode();
}
_SEH_END;
-
+
if(!NT_SUCCESS(Status))
{
ExFreePool(Dest->Buffer);
Dest->MaximumLength = 0;
Dest->Buffer = NULL;
}
-
+
return Status;
}