* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-/* $Id$
+/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/drivesup.c
/* FUNCTIONS ****************************************************************/
NTSTATUS
-GetSourcePaths(PUNICODE_STRING SourcePath,
- PUNICODE_STRING SourceRootPath,
- PUNICODE_STRING SourceRootDir)
+GetSourcePaths(
+ PUNICODE_STRING SourcePath,
+ PUNICODE_STRING SourceRootPath,
+ PUNICODE_STRING SourceRootDir)
{
- OBJECT_ATTRIBUTES ObjectAttributes;
- UNICODE_STRING LinkName;
- UNICODE_STRING SourceName;
- WCHAR SourceBuffer[MAX_PATH] = {L'\0'};
- HANDLE Handle;
- NTSTATUS Status;
- ULONG Length;
- PWCHAR Ptr;
-
- RtlInitUnicodeString(&LinkName,
- L"\\SystemRoot");
-
- InitializeObjectAttributes(&ObjectAttributes,
- &LinkName,
- OBJ_CASE_INSENSITIVE,
- NULL,
- NULL);
-
- Status = NtOpenSymbolicLinkObject(&Handle,
- SYMBOLIC_LINK_ALL_ACCESS,
- &ObjectAttributes);
- if (!NT_SUCCESS(Status))
- return(Status);
-
- SourceName.Length = 0;
- SourceName.MaximumLength = MAX_PATH * sizeof(WCHAR);
- SourceName.Buffer = SourceBuffer;
-
- Status = NtQuerySymbolicLinkObject(Handle,
- &SourceName,
- &Length);
- NtClose(Handle);
-
- if (NT_SUCCESS(Status))
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ UNICODE_STRING LinkName;
+ UNICODE_STRING SourceName;
+ WCHAR SourceBuffer[MAX_PATH] = {L'\0'};
+ HANDLE Handle;
+ NTSTATUS Status;
+ ULONG Length;
+ PWCHAR Ptr;
+
+ RtlInitUnicodeString(&LinkName,
+ L"\\SystemRoot");
+
+ InitializeObjectAttributes(&ObjectAttributes,
+ &LinkName,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
+
+ Status = NtOpenSymbolicLinkObject(&Handle,
+ SYMBOLIC_LINK_ALL_ACCESS,
+ &ObjectAttributes);
+ if (!NT_SUCCESS(Status))
+ return Status;
+
+ SourceName.Length = 0;
+ SourceName.MaximumLength = MAX_PATH * sizeof(WCHAR);
+ SourceName.Buffer = SourceBuffer;
+
+ Status = NtQuerySymbolicLinkObject(Handle,
+ &SourceName,
+ &Length);
+ NtClose(Handle);
+
+ if (NT_SUCCESS(Status))
{
- RtlCreateUnicodeString(SourcePath,
- SourceName.Buffer);
-
- /* strip trailing directory */
- Ptr = wcsrchr(SourceName.Buffer, L'\\');
- if (Ptr)
- {
- RtlCreateUnicodeString(SourceRootDir, Ptr);
- *Ptr = 0;
- }
- else
- RtlCreateUnicodeString(SourceRootDir, L"");
-
- RtlCreateUnicodeString(SourceRootPath,
- SourceName.Buffer);
+ RtlCreateUnicodeString(SourcePath,
+ SourceName.Buffer);
+
+ /* strip trailing directory */
+ Ptr = wcsrchr(SourceName.Buffer, L'\\');
+ if (Ptr)
+ {
+ RtlCreateUnicodeString(SourceRootDir, Ptr);
+ *Ptr = 0;
+ }
+ else
+ RtlCreateUnicodeString(SourceRootDir, L"");
+
+ RtlCreateUnicodeString(SourceRootPath,
+ SourceName.Buffer);
}
- NtClose(Handle);
+ NtClose(Handle);
- return(STATUS_SUCCESS);
+ return STATUS_SUCCESS;
}
-
/* EOF */