-/* $Id: volume.c,v 1.26 2002/09/08 10:22:42 chorns Exp $
+/* $Id: volume.c,v 1.27 2002/12/06 17:33:16 ekohl Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
#define MAX_DOS_DRIVES 26
-HANDLE InternalOpenDirW(PWCHAR DirName, BOOLEAN Write)
-{
- UNICODE_STRING NtPathU;
- OBJECT_ATTRIBUTES ObjectAttributes;
- NTSTATUS errCode;
- IO_STATUS_BLOCK IoStatusBlock;
- HANDLE hFile;
- if (!RtlDosPathNameToNtPathName_U ((LPWSTR)DirName,
- &NtPathU,
- NULL,
- NULL))
+static HANDLE
+InternalOpenDirW(LPCWSTR DirName,
+ BOOLEAN Write)
+{
+ UNICODE_STRING NtPathU;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ NTSTATUS errCode;
+ IO_STATUS_BLOCK IoStatusBlock;
+ HANDLE hFile;
+
+ if (!RtlDosPathNameToNtPathName_U((LPWSTR)DirName,
+ &NtPathU,
+ NULL,
+ NULL))
{
DPRINT("Invalid path\n");
SetLastError(ERROR_BAD_PATHNAME);
return hFile;
}
+
DWORD STDCALL
GetLogicalDriveStringsA(DWORD nBufferLength,
LPSTR lpBuffer)
GetCurrentDirectoryW (MAX_PATH, RootPathName);
RootPathName[3] = 0;
}
-
- if (INVALID_HANDLE_VALUE == (hFile = InternalOpenDirW((PWCHAR)lpRootPathName, FALSE)))
+
+ hFile = InternalOpenDirW(lpRootPathName, FALSE);
+ if (INVALID_HANDLE_VALUE == hFile)
{
- return FALSE;
+ return FALSE;
}
-
errCode = NtQueryVolumeInformationFile(hFile,
&IoStatusBlock,
GetCurrentDirectoryW (MAX_PATH, RootPathName);
RootPathName[3] = 0;
}
-
- if (INVALID_HANDLE_VALUE == (hFile = InternalOpenDirW(lpDirectoryName, FALSE)))
+
+ hFile = InternalOpenDirW(lpDirectoryName, FALSE);
+ if (INVALID_HANDLE_VALUE == hFile)
{
return FALSE;
}
DPRINT("FileFsVolume %p\n", FileFsVolume);
DPRINT("FileFsAttribute %p\n", FileFsAttribute);
- hFile = InternalOpenDirW(lpRootPathName, FALSE);
- if (hFile == INVALID_HANDLE_VALUE)
- {
- return FALSE;
- }
+ hFile = InternalOpenDirW(lpRootPathName, FALSE);
+ if (hFile == INVALID_HANDLE_VALUE)
+ {
+ return FALSE;
+ }
DPRINT("hFile: %x\n", hFile);
errCode = NtQueryVolumeInformationFile(hFile,
LabelInfo->VolumeLabelLength = LabelLength;
wcscpy(LabelInfo->VolumeLabel,
lpVolumeName);
-
- if (INVALID_HANDLE_VALUE == (hFile = InternalOpenDirW(lpRootPathName, TRUE)))
+
+ hFile = InternalOpenDirW(lpRootPathName, TRUE);
+ if (INVALID_HANDLE_VALUE == hFile)
{
return FALSE;
}