From 072f75a0f0c457978341df360dddeed7f4445d0b Mon Sep 17 00:00:00 2001 From: pathoswithin Date: Thu, 12 May 2016 22:19:28 +0000 Subject: [PATCH] NTFS: get volume info git-svn-id: svn://kolibrios.org@6426 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/fs/ntfs.inc | 45 +++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/kernel/trunk/fs/ntfs.inc b/kernel/trunk/fs/ntfs.inc index b0ee7292b2..cbb2051ca3 100644 --- a/kernel/trunk/fs/ntfs.inc +++ b/kernel/trunk/fs/ntfs.inc @@ -1876,12 +1876,10 @@ ntfs_datetime_to_bdfe: ;---------------------------------------------------------------- ntfs_GetFileInfo: - cmp byte [esi], 0 - jnz @f - movi eax, ERROR_UNSUPPORTED_FS - ret -@@: call ntfs_lock + mov edi, [ebx+16] + cmp byte [esi], 0 + jz .volume stdcall ntfs_find_lfn, [esp+4] jnc .found test eax, eax @@ -1889,16 +1887,47 @@ ntfs_GetFileInfo: jmp ntfsNotFound .found: - push esi edi mov esi, eax - mov edi, [ebx+16] xor eax, eax call ntfs_direntry_to_bdfe - pop edi esi +.end: call ntfs_unlock xor eax, eax ret +.volume: + mov byte [edi], 8 + mov eax, [ebx+8] + mov [edi+4], eax + mov eax, dword [ebp+NTFS.Length] + mov edx, dword [ebp+NTFS.Length+4] + shld edx, eax, 9 + shl eax, 9 + mov [edi+36], edx + mov [edi+32], eax + add edi, 40 + mov [ebp+NTFS.cur_buf], edi + mov [ebp+NTFS.cur_iRecord], 3 + mov [ebp+NTFS.cur_attr], 0x60 + mov [ebp+NTFS.cur_offs], 0 + mov [ebp+NTFS.cur_size], 1 + call ntfs_read_attr + jc ntfsFail + mov ecx, [ebp+NTFS.cur_read] + mov [edi+ecx], ax + cmp [ebx+8], eax + jnz .end + mov esi, edi + shr ecx, 1 +@@: + lodsw + call uni2ansi_char + stosb + dec ecx + jnz @b + mov byte [edi], 0 + jmp .end + ;---------------------------------------------------------------- ntfs_CreateFolder: mov [ebp+NTFS.bFolder], 1