-
Notifications
You must be signed in to change notification settings - Fork 1
/
LFNCHK.ASM
81 lines (65 loc) · 2.66 KB
/
LFNCHK.ASM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
;;
;; LFNCHK.ASM - Check wether LFN is supported for a specific drive.
;;
;; Copyright (C) 1999, 2000, 2001, Imre Leber.
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have recieved a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;;
;; If you have any questions, comments, suggestions, or fixes please
;; email me at: [email protected]
;;
;;
%assign FILESYSLENGTH 32 ;; Sufficient according to RBIL
segment _DATA class=DATA
drive DB '?:\'
filesys times FILESYSLENGTH DB 0
segment _TEXT class=CODE
;=========================================================================
;=== CheckDriveOnLFN ===
;===-------------------------------------------------------------------===
;=== int CheckDriveOnLFN(char drive); ===
;=== ===
;=== Paramete: drive letter, eg. 'A' ===
;=== ===
;=== Returns: LFN supported on this disk: 0 ===
;=== LFN supported on this disk: 1 ===
;=========================================================================
global _CheckDriveOnLFN
_CheckDriveOnLFN:
push es
push di
mov bx, sp
mov ax, [ss:bx+06h] ;; Get parameter
mov [drive], al ;; Complete drive spec
mov ax, 71A0h ;; The function
mov dx, drive ;; Pointer to drive string
mov cx, FILESYSLENGTH ;; Set lentgh of buffer for file system string
push ds ;; Far pointer
pop es
mov di, filesys ;; to file system string
stc ;; Set carry for old DOS compatibility
int 21h ;; Ask the system
jc .NotSupported
and bx, 16384 ;; Mask return value
cmp bx, 0 ;; See if supported
je .NotSupported
mov ax, 1 ;; Function supported
jmp short .EndOfProc
.NotSupported:
mov ax, 0 ;; Function not supported
.EndOfProc:
pop di
pop es
ret