Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

EDR-DOS WIP 2009-03-28 released | many BUG's (Users)

posted by DOS386, 07.04.2009, 05:39

> No, it's documented not to work. Read the documentation.

The only valid documentation is available at ???

> If it returns CF set, ax=1 then this should be fine for any well-written software.

Feel free to submit a list of "well-written software" :hungry:

GetFileAttributesA proc public uses ebx pName:ptr byte

local   szFile[MAX_PATH]:byte

;--- if a path ends with a '\', skip it. unless it is "\" or "x:\"

                mov             ebx, pName
                invoke  lstrlen, ebx
        .if (eax && (byte ptr [ebx+eax-1] == '\'))
                cmp eax, 2
            jb dontstrip
            cmp byte ptr [ebx+eax-2],':'
            jz dontstrip
                push eax
                invoke lstrcpy, addr szFile, ebx
            pop eax
            lea ebx, szFile
            mov byte ptr [ebx+eax-1],0
        .endif
dontstrip:
        mov     edx, ebx
                mov             ax,7143h
                mov             bl, 00                  ;file attributes
                stc
                int             21h
                jnc             success
                cmp             ax,7100h ; HEH ??? King Udo returns something else here ...
                jnz             error ; BOOM !!!
        mov     ax,4300h
        int     21h
        jc              error
success:
                mov             eax, FILE_ATTRIBUTE_NORMAL
                and             cx, 37h
                jz              @F
        movzx   eax,cx
@@:
done:
                @strace <"GetFileAttributesA(", &pName, ")=", eax>
        ret
error:
                movzx   eax, ax
        invoke  SetLastError,eax
                @mov    eax, -1
        jmp             done
        align   4
       
GetFileAttributesA endp


Apparently DKRNL32 is a poorly-written one :-(

> Even badly written software should recognise that there was an error at all

That's exactly what happens, but it is not useful :-P

> Which condition exactly?

Deleted the useless and never accessed "dot" . and .. "dotdot" entries ;-)

> And where did I say something about this?

Mail.

> don't know exactly what bug you're talking about here

See above

> > - LFN Get Attributes AX=$7143 BL=0 returns flag(C)=1 and AX=1 (!!!)
> What's that surprising/shocking/... about this? This is the MS-DOS 2.x+
> way of saying "invalid (sub)function".

See above, it does break.

> Stop using that software

AKA stop using all software

> or rewrite it with
> proper LFN support [1]
> or
> none at [2]

[2] is preferable from [1] , but I might not apply [2] either since UI21DEB can fix the problem immediately for all NTLFN-aware apps without the need to rewrite or recompile or to have the source at all :clap:

---
This is a LOGITECH mouse driver, but some software expect here
the following string:*** This is Copyright 1983 Microsoft ***

 

Complete thread:

Back to the forum
Board view  Mix view
22752 Postings in 2119 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum