Board index » cppbuilder » Re: About date format in DOS under XP

Re: About date format in DOS under XP


2006-04-03 10:26:50 PM
cppbuilder22
Thanks Mark
But I could not even find Long File Names Servirces (for example the same
714Eh - Find First File and 714Fh - Find Next File) there.
To understand what I want I have placed the URL references below.
Not so far I knew that I can use Long File Names in DOS programs if a
corresponding Windows operational system supports them. So I wrote a
FILESEEK class on TASM 4.1 and incoporated it into a Clipper demo.
I demonstrate my class by emulating DIR command. As my class supports LFN
and ordinary (8.3) files I'd like that DIR will be of two types: one as old
DOS DIR command for ordinary files and with two digits years (as it exists
in me demo at present) and another as that you can see when will issue DIR
command on XP. In the last case year representation (two digits or four
digits) is depended of short date format on XP.
The demo you can see here
hyperupload.com/download/01b0e62972/FS_DEMO1.EXE.html
The corresponding source code of the demo is here
hyperupload.com/download/0283d25183/FS_DEMO1.PRG.html
A Long File Name test program for my class
hyperupload.com/download/f5d4dc83/SEEKDEMO.EXE.html
the corresponding source code
hyperupload.com/download/92981687/SEEKDEMO.PRG.html
Vladimir Grigoriev
"Mark Jacobs" <www.jacobsm.com/mjmsg?Borland%20Newsgroup>wrote in
message news: XXXX@XXXXX.COM ...
Quote
Vladimir, I think you may find the following references useful :-

Ralph Brown's Interrupt List at www.ctyme.com/rbrown.htm
Downloadable versions at
www.cs.cmu.edu/afs/cs/user/ralf/pub/WWW/files.html

--

Mark Jacobs
DK Computing
www.dkcomputing.co.uk


 
 

Re:Re: About date format in DOS under XP

Vladimir Grigoriev wrote:
Quote
Thanks Mark
But I could not even find Long File Names Servirces (for example the same
714Eh - Find First File and 714Fh - Find Next File) there.
www.ctyme.com/intr/cat-010.htm
Bottom of the page.
Also from here.
www.ctyme.com/intr/int.htm
Click on interrupt 21.
 

Re:Re: About date format in DOS under XP

"Bob Gonder" < XXXX@XXXXX.COM >wrote in message
Quote
Vladimir Grigoriev wrote:

>Thanks Mark
>But I could not even find Long File Names Servirces (for example the same
>714Eh - Find First File and 714Fh - Find Next File) there.

www.ctyme.com/intr/cat-010.htm
Bottom of the page.

Also from here.
www.ctyme.com/intr/int.htm
Click on interrupt 21.
Thanks Bob - I was sure that they are supported, interrupt-wise. I also have a
pocket book of DOS interrupts, and Findfirst/next is in there too! The
function pair are listed as Int 21/4E (Findfirst) and Int21/4F (Findnext).
Valdimir, please read the references you have been given - there isn't much
about DOS interrupts that isn't in Ralph's tomes about them.
--
Mark Jacobs
DK Computing
www.dkcomputing.co.uk
 

{smallsort}

Re:Re: About date format in DOS under XP

Thanks Bob.
I have found function 70h of int 21h already myself. But it does not work on
XP.
I have tried the following code
IDEAL
MODEL LARGE, CPP
PROC GetInternationalInfo
ARG @@pBufferPtr:DATAPTR,@@nBufferLen
USES di,si
mov ax,07000h
les di,[@@pBufferPtr]
mov cx,[@@nBufferLen]
lds si,[UnknownDataPtr] ; defined in DATASEG
stc
int 21h
jnc @@20
cmp ax,07000h
jne @@10
mov ax,ERROR_INVALID_FUNCTION
@@10:
jmp short @@30
@@20:
xor ax,ax
@@30:
ret
ENDP GetInternationalInfo
But it seems that under XP this interrupt function is not supported. I
always get Carry Flag is set (as I set it myself) and AX is equal 07000h.
Also it is not clear from the function description the meaning of data at
address DS:SI.
Vladimir Grigoriev
"Bob Gonder" < XXXX@XXXXX.COM >wrote in message
Quote
Vladimir Grigoriev wrote:

>Thanks Mark
>But I could not even find Long File Names Servirces (for example the same
>714Eh - Find First File and 714Fh - Find Next File) there.

www.ctyme.com/intr/cat-010.htm
Bottom of the page.

Also from here.
www.ctyme.com/intr/int.htm
Click on interrupt 21.


 

Re:Re: About date format in DOS under XP

Mark
I spoke about Long File Names Find First File (function 714Eh) and Find Next
File (714Fh). These are different functions from 4Eh and 4Fh. 714Eh and
714Fh use WIN32_FIND_DATA structure while 4Eh and 4Fh use DTA area and
FILEINFO structure.
Vladimir Grigoriev
"Mark Jacobs" <www.jacobsm.com/mjmsg?Borland%20Newsgroup>wrote in
message news: XXXX@XXXXX.COM ...
Quote
"Bob Gonder" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>Vladimir Grigoriev wrote:
>
>>Thanks Mark
>>But I could not even find Long File Names Servirces (for example the
same
>>714Eh - Find First File and 714Fh - Find Next File) there.
>
>www.ctyme.com/intr/cat-010.htm
>Bottom of the page.
>
>Also from here.
>www.ctyme.com/intr/int.htm
>Click on interrupt 21.

Thanks Bob - I was sure that they are supported, interrupt-wise. I also
have a
pocket book of DOS interrupts, and Findfirst/next is in there too! The
function pair are listed as Int 21/4E (Findfirst) and Int21/4F (Findnext).
Valdimir, please read the references you have been given - there isn't
much
about DOS interrupts that isn't in Ralph's tomes about them.
--

Mark Jacobs
DK Computing
www.dkcomputing.co.uk


 

Re:Re: About date format in DOS under XP

"Vladimir Grigoriev" < XXXX@XXXXX.COM >wrote in message
Quote
I have tried the following code

IDEAL

MODEL LARGE, CPP

PROC GetInternationalInfo
ARG @@pBufferPtr:DATAPTR,@@nBufferLen
USES di,si
mov ax,07000h
les di,[@@pBufferPtr]
mov cx,[@@nBufferLen]
lds si,[UnknownDataPtr] ; defined in DATASEG
stc
int 21h
jnc @@20
cmp ax,07000h
jne @@10
mov ax,ERROR_INVALID_FUNCTION
@@10:
jmp short @@30
@@20:
xor ax,ax
@@30:
ret
ENDP GetInternationalInfo

But it seems that under XP this interrupt function is not supported. I
always get Carry Flag is set (as I set it myself) and AX is equal 07000h.
Also it is not clear from the function description the meaning of data at
address DS:SI.
Did it work under Windows 2000? Did it work under Win 9x? If it does, then XP
is at fault, and you should contact M$ for an explanation, and tea with Bill
Gates. ;-)
--
Mark Jacobs
DK Computing
www.dkcomputing.co.uk
 

Re:Re: About date format in DOS under XP

Thanks, but I have not had a possibility to test the code under Windows 2000
yet! ;-)
And if somebody will test it it wouldl be great.
Vladimir Grigoriev
"Mark Jacobs" <www.jacobsm.com/mjmsg?Borland%20Newsgroup>wrote in
message news: XXXX@XXXXX.COM ...
Quote
"Vladimir Grigoriev" < XXXX@XXXXX.COM >wrote in message
news:4432404d$ XXXX@XXXXX.COM ...
>I have tried the following code
>
>IDEAL
>
>MODEL LARGE, CPP
>
>PROC GetInternationalInfo
>ARG @@pBufferPtr:DATAPTR,@@nBufferLen
>USES di,si
>mov ax,07000h
>les di,[@@pBufferPtr]
>mov cx,[@@nBufferLen]
>lds si,[UnknownDataPtr] ; defined in DATASEG
>stc
>int 21h
>jnc @@20
>cmp ax,07000h
>jne @@10
>mov ax,ERROR_INVALID_FUNCTION
>@@10:
>jmp short @@30
>@@20:
>xor ax,ax
>@@30:
>ret
>ENDP GetInternationalInfo
>
>But it seems that under XP this interrupt function is not supported. I
>always get Carry Flag is set (as I set it myself) and AX is equal
07000h.
>Also it is not clear from the function description the meaning of data
at
>address DS:SI.

Did it work under Windows 2000? Did it work under Win 9x? If it does, then
XP
is at fault, and you should contact M$ for an explanation, and tea with
Bill
Gates. ;-)
--

Mark Jacobs
DK Computing
www.dkcomputing.co.uk


 

Re:Re: About date format in DOS under XP

Vladimir Grigoriev wrote:
Quote
PROC GetInternationalInfo
ARG @@pBufferPtr:DATAPTR,@@nBufferLen
I don't have my books with me. Is a DATAPTR a far pointer?
Quote
USES di,si
mov ax,07000h
les di,[@@pBufferPtr]
mov cx,[@@nBufferLen]
cx should always be 3ah
and the buffer should of course always be at least that large.
Quote
stc
it should be a waste of time to set the carry
Quote
int 21h
jnc @@20
jnc short @@20
Quote
cmp ax,07000h
jne @@10
jne short @@30
Quote
mov ax,ERROR_INVALID_FUNCTION
@@10:
jmp short @@30
ret
Quote
@@20:
xor ax,ax
@@30:
ret
ENDP GetInternationalInfo

But it seems that under XP this interrupt function is not supported. I
always get Carry Flag is set (as I set it myself) and AX is equal 07000h.
Also it is not clear from the function description the meaning of data at
address DS:SI.
si is only used for subfunctions 1 and 2, not for 0 which you are
using.
 

Re:Re: About date format in DOS under XP

Hi Bob.
Well, I have showed my assembler procedure for LARGE memory model so DATAPTR
is a far pointer by default (segment:offset)
I use STC command as it is a general practice to check interrupt function
supporting. If you will not use STC then it is difficult (of cource not so
difficult but not common used) to determine is a function supported and does
return success or is not supported so also does return success (does not set
carry flag). This technique is described in LFN documentation in MSDN.
The testing program can be rewritten as stand alone COM file.
Something as the following.
IDEAL
MODEL TINY, CPP
ERROR_INVALID_FUNCTION = 0001h
DATASEG
ReceivingData db 58 DUP( 0 ) ; LENGTH = 3Ah
cErrorMsg db 'Function 07000h of INT 021h is not supported.$'
cInfoMsg db 'Function 07000h of INT 021h is sopported.$'
CODESEG
mov ax,LENGTH ReceivingData
push ax
mov ax,offset ReceivingData
push ax
call GetInternationalInfo
add sp,4
or ax,ax
jz @@10
mov dx,offset cErrorMsg
jmp short @@20
@@10:
mov dx, offset cInfoMsg
@@20:
mov ah,9h
int 021h
ret
PROC GetInternationalInfo
ARG @@pBufferPtr:DATAPTR,@@nBufferLen
USES di,si
mov ax,07000h
mov di,ds
mov es,di
mov di,[@@pBufferPtr]
mov cx,[@@nBufferLen]
stc
int 21h
jnc @@20
cmp ax,07000h
jne @@10
mov ax,ERROR_INVALID_FUNCTION
@@10:
jmp short @@30
@@20:
xor ax,ax
@@30:
ret
ENDP GetInternationalInfo
END @Startup
Compile and link as
TASM prog /ml/m
TLINK -t prog
I did not test it but I think it must work.
Vladimir Grigoriev
"Bob Gonder" < XXXX@XXXXX.COM >wrote in message
Quote
Vladimir Grigoriev wrote:

>PROC GetInternationalInfo
>ARG @@pBufferPtr:DATAPTR,@@nBufferLen

I don't have my books with me. Is a DATAPTR a far pointer?

>USES di,si
>mov ax,07000h
>les di,[@@pBufferPtr]
>mov cx,[@@nBufferLen]

cx should always be 3ah
and the buffer should of course always be at least that large.

>stc

it should be a waste of time to set the carry

>int 21h
>jnc @@20

jnc short @@20

>cmp ax,07000h
>jne @@10

jne short @@30

>mov ax,ERROR_INVALID_FUNCTION
>@@10:
>jmp short @@30

ret

>@@20:
>xor ax,ax
>@@30:
>ret
>ENDP GetInternationalInfo
>
>But it seems that under XP this interrupt function is not supported. I
>always get Carry Flag is set (as I set it myself) and AX is equal 07000h.
>Also it is not clear from the function description the meaning of data at
>address DS:SI.

si is only used for subfunctions 1 and 2, not for 0 which you are
using.