A2osX/LIB/LIBCIFS.S.txt

1587 lines
27 KiB
Plaintext
Raw Normal View History

2021-01-12 21:14:13 +00:00
NEW
AUTO 3,1
.LIST OFF
.OP 65C02
.OR $2000
.TF lib/libcifs
*--------------------------------------
.INB inc/macros.i
.INB inc/a2osx.i
2021-02-11 22:08:22 +00:00
.INB inc/kernel.i
2021-01-12 21:14:13 +00:00
.INB inc/mli.e.i
.INB inc/eth.i
.INB inc/libtcpip.i
.INB inc/net.smb.i
*--------------------------------------
.DUMMY
.OR ZPLIB
ZS.START
ZPReqPtr .BS 2
ZPReqLen .BS 2
ZPCtxPtr .BS 2
2021-02-11 22:08:22 +00:00
pFD .BS 2
2021-02-17 16:15:43 +00:00
pPath .BS 2
2021-01-12 21:14:13 +00:00
ZPPtr1 .BS 2
ZPPtr2 .BS 2
2021-02-11 22:08:22 +00:00
BufPtr .BS 2
hBuf .BS 1
2021-03-11 21:40:55 +00:00
hResp .BS 1
ZPRespPtr .BS 2
2021-02-17 16:15:43 +00:00
bFlag .BS 1
2021-01-12 21:14:13 +00:00
ZS.END .ED
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA 0
.DA CS.END-CS.START
.DA 0
.DA 0
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
.1 .DA LIB.LOAD
.DA LIB.UNLOAD
.DA CIFS.Negotiate
.DA CIFS.SessionSetup
.DA CIFS.TreeConnect
.DA CIFS.Mount
.DA CIFS.UMount
*--------------------------------------
2021-01-17 21:48:54 +00:00
L.CALLBACK .DA CIFS.CallBack
*--------------------------------------
2021-01-12 21:14:13 +00:00
J.CIFS .DA CIFS.ChTyp
.DA CIFS.ChMod
.DA CIFS.FStat
.DA CIFS.Stat
.DA CIFS.MKDir
.DA CIFS.MKNod
.DA CIFS.MKFIFO
.DA CIFS.Pipe
.DA CIFS.OpenDir
.DA CIFS.ReadDir
.DA CIFS.CloseDir
.DA CIFS.Open
.DA CIFS.Close
.DA CIFS.Read
.DA CIFS.Write
.DA CIFS.ChOwn
2021-01-24 19:44:43 +00:00
J.CIFS2 .DA CIFS2.ChTyp
.DA CIFS2.ChMod
.DA CIFS2.FStat
.DA CIFS2.Stat
.DA CIFS2.MKDir
.DA CIFS2.MKNod
.DA CIFS2.MKFIFO
.DA CIFS2.Pipe
.DA CIFS2.OpenDir
.DA CIFS2.ReadDir
.DA CIFS2.CloseDir
.DA CIFS2.Open
.DA CIFS2.Close
.DA CIFS2.Read
.DA CIFS2.Write
2021-02-17 16:15:43 +00:00
.DA CIFS2.ChOwn
2021-01-12 21:14:13 +00:00
L.LIBTCPIP .DA LIBTCPIP
2021-02-11 22:08:22 +00:00
L.NETBIOS .DA NETBIOS
2021-01-12 21:14:13 +00:00
.DA 0
*--------------------------------------
LIB.LOAD >LDYA L.LIBTCPIP
2021-01-17 21:48:54 +00:00
>SYSCALL2 LoadLib
2021-01-12 21:14:13 +00:00
bcs .9
sta hLIBTCPIP
2021-01-17 21:48:54 +00:00
>SYSCALL2 GetMemPtr
>STYA pLIBTCPIP
2021-01-12 21:14:13 +00:00
>LDYAI 256
2021-01-17 21:48:54 +00:00
>SYSCALL2 GetMem
2021-01-12 21:14:13 +00:00
bcs .9
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
stx hReq
* clc
.9 rts
*--------------------------------------
LIB.UNLOAD lda hReq
beq .1
2021-01-17 21:48:54 +00:00
>SYSCALL2 FreeMem
2021-01-12 21:14:13 +00:00
.1 lda hLIBTCPIP
beq .8
2021-01-17 21:48:54 +00:00
>SYSCALL2 UnloadLib
2021-01-12 21:14:13 +00:00
.8 clc
rts
*--------------------------------------
* >PUSHB hSocket
2021-01-17 21:48:54 +00:00
* >PUSHBI 0
2021-01-12 21:14:13 +00:00
* >LIBCALL Negotiate
* A = hSMBContext
*--------------------------------------
CIFS.Negotiate lda (pStack)
bne .1
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
dec
sta (pStack)
2021-02-11 22:08:22 +00:00
>PUSHWI SMB.NegReq.end-NETBIOS
>PUSHW L.NETBIOS
2021-01-12 21:14:13 +00:00
ldy #1+4 hSocket
lda (pStack),y
2021-01-13 16:57:41 +00:00
ldx #LIBTCPIP.Send
2021-01-17 21:48:54 +00:00
jsr GO.LIBTCPIP
2021-01-12 21:14:13 +00:00
bcs .99
2021-01-13 16:57:41 +00:00
2021-01-12 21:14:13 +00:00
lda #0
sec
rts
.1 dec
sta (pStack)
beq .98
ldy #1 hSocket
lda (pStack),y
2021-01-13 16:57:41 +00:00
ldx #LIBTCPIP.Recv
2021-01-17 21:48:54 +00:00
jsr GO.LIBTCPIP
2021-01-12 21:14:13 +00:00
bcc .3
cmp #E.NODATA
bne .99
inc
rts
.3 jsr GetRespData
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
ldy #S.NETBIOS+S.SMB.H.STATUS
lda (ZPRespPtr),y
bne .97
2021-02-11 22:08:22 +00:00
ldy #S.NETBIOS.LEN+2
2021-01-12 21:14:13 +00:00
lda (ZPRespPtr),y
2021-01-17 21:48:54 +00:00
2021-01-14 21:39:36 +00:00
clc
2021-02-11 22:08:22 +00:00
adc #S.NETBIOS
2021-01-14 21:39:36 +00:00
sta ZPPtr1
2021-01-12 21:14:13 +00:00
tay
lda #0
2021-01-17 21:48:54 +00:00
>SYSCALL2 GetMem
2021-01-12 21:14:13 +00:00
bcs .99
2021-01-17 21:48:54 +00:00
>STYA ZPCtxPtr
2021-01-14 21:39:36 +00:00
ldy ZPPtr1
2021-01-12 21:14:13 +00:00
.4 dey
lda (ZPRespPtr),y
sta (ZPCtxPtr),y
tya
bne .4
2021-01-14 21:39:36 +00:00
ldy #S.NETBIOS+S.SMB.H.FLAGS
sta (ZPCtxPtr),y
2021-01-12 21:14:13 +00:00
phx
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
lda hResp
2021-01-17 21:48:54 +00:00
>SYSCALL2 FreeMem
2021-01-12 21:14:13 +00:00
pla
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
clc
>RET 2
.97 lda hResp
2021-01-17 21:48:54 +00:00
>SYSCALL2 FreeMem
2021-01-12 21:14:13 +00:00
.98 lda #MLI.E.IO
2021-01-14 21:39:36 +00:00
.99 >RET 2
2021-01-12 21:14:13 +00:00
*--------------------------------------
* >PUSHB hSocket
* >PUSHB hSMBContext
* >PUSHW username
* >PUSHW password
2021-01-17 21:48:54 +00:00
* >PUSHBI 0
2021-01-12 21:14:13 +00:00
* >LIBCALL SessionSetup
* (SMBContext updated with UID)
*--------------------------------------
CIFS.SessionSetup
lda (pStack)
2021-01-17 21:48:54 +00:00
bne .5
2021-01-12 21:14:13 +00:00
2021-01-17 21:48:54 +00:00
dec
2021-01-12 21:14:13 +00:00
sta (pStack)
2021-01-17 21:48:54 +00:00
ldy #5 hSMBContext
jsr GetSMBContext
2021-01-14 21:39:36 +00:00
2021-01-12 21:14:13 +00:00
ldx #S.SMB.H.CMD.SESSION.SETUP.ANDX
2021-01-17 21:48:54 +00:00
jsr RequestSetupX
2021-01-12 21:14:13 +00:00
ldx #0
.2 lda SMB.SessionSetup.H,x
sta (ZPReqPtr),y
iny
inx
cpx #SMB.SessionSetup.H.Len
bne .2
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
phy save Y = LEN
iny
iny
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
ldx #0
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
.3 lda SMB.SessionSetup.Guest,x
sta (ZPReqPtr),y
iny
inx
cpx #SMB.SessionSetup.Guest.Len
bne .3
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
ldx #0
.4 lda SMB.SessionSetup.T,x
sta (ZPReqPtr),y
iny
inx
cpx #SMB.SessionSetup.T.Len
bne .4
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
pla
2021-01-17 21:48:54 +00:00
2021-01-14 21:39:36 +00:00
jsr SetReqLenYAtA
2021-01-12 21:14:13 +00:00
>PUSHYA
>PUSHW ZPReqPtr
ldy #6+4 hSocket
lda (pStack),y
2021-01-13 16:57:41 +00:00
ldx #LIBTCPIP.Send
2021-01-17 21:48:54 +00:00
jsr GO.LIBTCPIP
2021-01-12 21:14:13 +00:00
bcs .99
lda #0
sec
2021-01-17 21:48:54 +00:00
rts
2021-01-12 21:14:13 +00:00
.5 dec
sta (pStack)
beq .98
ldy #6 hSocket
lda (pStack),y
2021-01-13 16:57:41 +00:00
ldx #LIBTCPIP.Recv
2021-01-17 21:48:54 +00:00
jsr GO.LIBTCPIP
2021-01-12 21:14:13 +00:00
bcc .6
cmp #E.NODATA
bne .99
inc
rts
.6 jsr GetRespData
ldy #S.NETBIOS+S.SMB.H.STATUS
lda (ZPRespPtr),y
bne .97
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
ldy #5 hSMBContext
2021-01-17 21:48:54 +00:00
jsr GetSMBContext
2021-01-12 21:14:13 +00:00
ldy #S.NETBIOS+S.SMB.H.UID
lda (ZPRespPtr),y
sta (ZPCtxPtr),y
2021-01-17 21:48:54 +00:00
iny
2021-01-12 21:14:13 +00:00
lda (ZPRespPtr),y
sta (ZPCtxPtr),y
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
.8 lda hResp
2021-01-17 21:48:54 +00:00
>SYSCALL2 FreeMem
2021-01-12 21:14:13 +00:00
clc
>RET 7
.97 lda hResp
2021-01-17 21:48:54 +00:00
>SYSCALL2 FreeMem
2021-01-12 21:14:13 +00:00
.98 lda #MLI.E.IO
2021-01-13 16:57:41 +00:00
sec
2021-01-17 21:48:54 +00:00
.99 >RET 7
2021-01-12 21:14:13 +00:00
*--------------------------------------
* >PUSHB hSocket
* >PUSHB hSMBContext
2021-01-14 21:39:36 +00:00
* >PUSHW pathname
2021-01-17 21:48:54 +00:00
* >PUSHBI 0
2021-01-12 21:14:13 +00:00
* >LIBCALL TreeConnect
* (SMBContext updated with TID)
*--------------------------------------
CIFS.TreeConnect
lda (pStack)
2021-01-17 21:48:54 +00:00
bne .5
2021-01-12 21:14:13 +00:00
2021-01-17 21:48:54 +00:00
dec
2021-01-12 21:14:13 +00:00
sta (pStack)
2021-01-14 21:39:36 +00:00
ldy #1 pathname
lda (pStack),y
sta ZPPtr1
iny
lda (pStack),y
sta ZPPtr1+1
2021-01-17 21:48:54 +00:00
iny hSMBContext
jsr GetSMBContext
2021-01-12 21:14:13 +00:00
2021-01-17 21:48:54 +00:00
ldx #S.SMB.H.CMD.TREE.CONNECT.ANDX
jsr RequestSetupX
2021-01-12 21:14:13 +00:00
ldx #0
2021-02-17 16:15:43 +00:00
2021-01-17 21:48:54 +00:00
.1 lda SMB.TreeConnect.H,x
2021-01-12 21:14:13 +00:00
sta (ZPReqPtr),y
iny
inx
cpx #SMB.TreeConnect.H.Len
2021-01-17 21:48:54 +00:00
bne .1
2021-01-12 21:14:13 +00:00
phy save Y = LEN
iny
iny
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
lda #0
sta (ZPReqPtr),y PASSWORD = "\0"
iny
2021-01-17 21:48:54 +00:00
.2 lda (ZPPtr1)
2021-01-12 21:14:13 +00:00
inc ZPPtr1
2021-01-17 21:48:54 +00:00
bne .3
2021-01-12 21:14:13 +00:00
inc ZPPtr1+1
2021-01-17 21:48:54 +00:00
.3 sta (ZPReqPtr),y
2021-01-12 21:14:13 +00:00
iny
tax
2021-01-17 21:48:54 +00:00
bne .2
2021-01-12 21:14:13 +00:00
ldx #0
.4 lda SMB.TreeConnect.T,x
sta (ZPReqPtr),y
iny
inx
cpx #SMB.TreeConnect.T.Len
bne .4
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
pla
2021-01-17 21:48:54 +00:00
2021-01-14 21:39:36 +00:00
jsr SetReqLenYAtA
2021-01-12 21:14:13 +00:00
>PUSHYA
>PUSHW ZPReqPtr
ldy #4+4 hSocket
lda (pStack),y
2021-01-13 16:57:41 +00:00
ldx #LIBTCPIP.Send
2021-01-17 21:48:54 +00:00
jsr GO.LIBTCPIP
2021-01-12 21:14:13 +00:00
bcs .99
lda #0
sec
2021-01-17 21:48:54 +00:00
rts
2021-01-12 21:14:13 +00:00
.5 dec
sta (pStack)
beq .98
ldy #4 hSocket
lda (pStack),y
2021-01-13 16:57:41 +00:00
ldx #LIBTCPIP.Recv
2021-01-17 21:48:54 +00:00
jsr GO.LIBTCPIP
2021-01-12 21:14:13 +00:00
bcc .6
cmp #E.NODATA
bne .99
inc
rts
.6 jsr GetRespData
ldy #S.NETBIOS+S.SMB.H.STATUS
lda (ZPRespPtr),y
bne .97
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
ldy #3 hSMBContext
2021-01-17 21:48:54 +00:00
jsr GetSMBContext
2021-01-12 21:14:13 +00:00
ldy #S.NETBIOS+S.SMB.H.TID
lda (ZPRespPtr),y
sta (ZPCtxPtr),y
2021-01-17 21:48:54 +00:00
iny
2021-01-12 21:14:13 +00:00
lda (ZPRespPtr),y
sta (ZPCtxPtr),y
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
.8 lda hResp
2021-01-17 21:48:54 +00:00
>SYSCALL2 FreeMem
2021-01-12 21:14:13 +00:00
clc
>RET 5
.97 lda hResp
2021-01-17 21:48:54 +00:00
>SYSCALL2 FreeMem
2021-01-12 21:14:13 +00:00
.98 lda #MLI.E.IO
2021-01-13 16:57:41 +00:00
sec
2021-01-17 21:48:54 +00:00
.99 >RET 5
2021-01-12 21:14:13 +00:00
*--------------------------------------
2021-01-17 21:48:54 +00:00
* >PUSHB hSocket
* >PUSHB hSMBContext
* >PUSHW MountPoint
* >LIBCALL Mount
*--------------------------------------
CIFS.Mount ldy #1
lda (pStack),y MP HI
>PUSHA
lda (pStack),y MP LO
>PUSHA
2021-02-17 16:15:43 +00:00
2021-01-17 21:48:54 +00:00
>PUSHW L.CALLBACK
>SYSCALL2 Mount
bcs .9
2021-02-17 16:15:43 +00:00
2021-01-17 21:48:54 +00:00
pha hMount
2021-02-17 16:15:43 +00:00
2021-01-17 21:48:54 +00:00
ldx #0
.1 >PULLB MountTable,x
inx
cpx #4
bne .1
2021-02-17 16:15:43 +00:00
2021-01-17 21:48:54 +00:00
pla
2021-02-17 16:15:43 +00:00
clc
rts
2021-01-17 21:48:54 +00:00
.9 >RET 4
2021-01-12 21:14:13 +00:00
*--------------------------------------
CIFS.UMount clc
rts
*--------------------------------------
2021-01-24 19:44:43 +00:00
CIFS.CallBack bit CIFS.Status
2021-02-17 16:15:43 +00:00
bpl .1
phy
pha
ldy #S.PS.PID
2021-01-24 19:44:43 +00:00
lda (pPS),y
cmp CIFS.PID
2021-02-17 16:15:43 +00:00
beq .2
2021-01-24 19:44:43 +00:00
2021-02-17 16:15:43 +00:00
pla
ply
lda #0
2021-01-24 19:44:43 +00:00
sec
2021-02-17 16:15:43 +00:00
rts
.1 jmp (J.CIFS,x)
2021-03-11 21:40:55 +00:00
2021-02-17 16:15:43 +00:00
.2 pla
ply
jmp (J.CIFS2,x)
2021-01-12 21:14:13 +00:00
*--------------------------------------
CIFS.ChTyp
2021-01-24 19:44:43 +00:00
CIFS2.ChTyp
2021-01-12 21:14:13 +00:00
*--------------------------------------
CIFS.ChMod
2021-01-24 19:44:43 +00:00
CIFS2.ChMod
*--------------------------------------
2021-02-17 16:15:43 +00:00
CIFS.FStat
2021-01-12 21:14:13 +00:00
*--------------------------------------
2021-01-24 19:44:43 +00:00
CIFS2.FStat lda #MLI.E.BADCALL
sec
rts
2021-01-12 21:14:13 +00:00
*--------------------------------------
2021-02-17 16:15:43 +00:00
CIFS.Stat >STYA pPath resolved path
2021-03-15 15:00:27 +00:00
jsr ClearSocket
2021-02-11 22:08:22 +00:00
jsr MakeTrans2Reg
2021-01-24 19:44:43 +00:00
ldx #0
2021-02-17 16:15:43 +00:00
.1 lda SMB.QueryPathInfo,x
2021-01-24 19:44:43 +00:00
sta (ZPReqPtr),y
iny
inx
cpx #SMB.QueryPathInfo.Len
2021-02-17 16:15:43 +00:00
bne .1
2021-01-24 19:44:43 +00:00
2021-02-17 16:15:43 +00:00
jsr AppendPath
2021-01-24 19:44:43 +00:00
2021-02-17 16:15:43 +00:00
lda #0
sta (ZPReqPtr),y
2021-01-24 19:44:43 +00:00
iny
jsr SetT2ReqLenYA
>PUSHYA
>PUSHW ZPReqPtr
lda MountTable+3 hSocket
ldx #LIBTCPIP.Send
jsr GO.LIBTCPIP
bcs .9
2021-03-11 21:40:55 +00:00
jmp Sleep
2021-01-24 19:44:43 +00:00
.9 >RET 4
*--------------------------------------
2021-03-15 15:00:27 +00:00
CIFS2.Stat jsr ReadSocket
2021-01-24 19:44:43 +00:00
bcs .9
2021-02-17 16:15:43 +00:00
2021-01-24 19:44:43 +00:00
jsr GetRespData
ldy #S.NETBIOS+S.SMB.H.STATUS
lda (ZPRespPtr),y
beq .1
2021-02-17 16:15:43 +00:00
2021-01-24 19:44:43 +00:00
lda #MLI.E.FNOTFND
bra .99
2021-01-17 21:48:54 +00:00
2021-02-17 16:15:43 +00:00
.1 >PULLW ZPPtr2 Stat Buffer
inc pStack Skip Filename
2021-01-24 19:44:43 +00:00
inc pStack
2021-02-17 16:15:43 +00:00
jsr GetRespDataOffset
jsr FileInfo2StatBuf
jsr StatBuf2Ptr2
2021-03-11 21:40:55 +00:00
lda hResp
>SYSCALL2 FreeMem
2021-01-24 19:44:43 +00:00
stz CIFS.Status
clc
rts
.9 cmp #E.NODATA
2021-03-15 15:00:27 +00:00
bne .9
2021-01-12 21:14:13 +00:00
2021-01-24 19:44:43 +00:00
dec CIFS.Retries
beq .90
2021-02-17 16:15:43 +00:00
2021-01-24 19:44:43 +00:00
lda #0
2021-01-12 21:14:13 +00:00
sec
rts
2021-02-17 16:15:43 +00:00
2021-01-24 19:44:43 +00:00
.90 lda #MLI.E.IO
2021-03-11 21:40:55 +00:00
2021-01-24 19:44:43 +00:00
.99 sec
stz CIFS.Status
2021-02-17 16:15:43 +00:00
>RET 4
2021-01-12 21:14:13 +00:00
*--------------------------------------
2021-02-17 16:15:43 +00:00
CIFS.MKDir >STYA pPath resolved path
jsr MakeTrans2Reg
ldx #0
.1 lda SMB.CreateDirectory,x
sta (ZPReqPtr),y
iny
inx
cpx #SMB.CreateDirectory.Len
bne .1
jsr AppendPath
lda #0
sta (ZPReqPtr),y
iny
jsr SetT2ReqLenYA
>PUSHYA
>PUSHW ZPReqPtr
lda MountTable+3 hSocket
ldx #LIBTCPIP.Send
jsr GO.LIBTCPIP
bcs .9
2021-03-11 21:40:55 +00:00
jmp Sleep
2021-02-17 16:15:43 +00:00
.9 >RET 4
*--------------------------------------
2021-03-15 15:00:27 +00:00
CIFS2.MKDir jsr ReadSocket
2021-02-17 16:15:43 +00:00
bcs .9
jsr GetRespData
ldy #S.NETBIOS+S.SMB.H.STATUS
lda (ZPRespPtr),y
2021-03-11 21:40:55 +00:00
clc
beq .8
2021-02-17 16:15:43 +00:00
lda #MLI.E.DUPFILE
2021-03-11 21:40:55 +00:00
sec
.8 jsr FreeRespData
2021-02-17 16:15:43 +00:00
2021-03-11 21:40:55 +00:00
stz CIFS.Status
2021-02-17 16:15:43 +00:00
>RET 4
.9 cmp #E.NODATA
bne .99
dec CIFS.Retries
2021-03-11 21:40:55 +00:00
beq .98
2021-02-17 16:15:43 +00:00
lda #0
sec
rts
2021-03-11 21:40:55 +00:00
.98 lda #MLI.E.IO
2021-02-17 16:15:43 +00:00
.99 sec
stz CIFS.Status
>RET 4
2021-01-12 21:14:13 +00:00
*--------------------------------------
CIFS.MKNod
2021-01-24 19:44:43 +00:00
CIFS2.MKNod
2021-01-12 21:14:13 +00:00
*--------------------------------------
CIFS.MKFIFO
2021-01-24 19:44:43 +00:00
CIFS2.MKFIFO
2021-01-12 21:14:13 +00:00
*--------------------------------------
2021-01-24 19:44:43 +00:00
CIFS.Pipe
CIFS2.Pipe lda #MLI.E.BADCALL
2021-01-12 21:14:13 +00:00
sec
rts
*--------------------------------------
2021-02-17 16:15:43 +00:00
CIFS.OpenDir >STYA pPath resolved path
2021-01-24 19:44:43 +00:00
>LDYAI S.FD.DIR
>SYSCALL2 GetMem
bcs .9
2021-02-17 16:15:43 +00:00
2021-01-24 19:44:43 +00:00
>STYA ZPPtr2
2021-02-17 16:15:43 +00:00
2021-01-24 19:44:43 +00:00
lda #S.FD.T.DIR
sta (ZPPtr2)
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
lda hHandler
ldy #S.FD.HANDLER
sta (ZPPtr2),y
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
lda #0
2021-02-17 16:15:43 +00:00
ldy #S.FD.DIR.EPB
sta (ZPPtr2),y EOF Flag
iny
2021-02-11 22:08:22 +00:00
sta (ZPPtr2),y
iny
sta (ZPPtr2),y
2021-02-17 16:15:43 +00:00
>PUSHW pPath
2021-01-24 19:44:43 +00:00
>PUSHWI 0
txa
>PUSHA
>SYSCALL2 mknod
2021-02-17 16:15:43 +00:00
.9 rts
*--------------------------------------
2021-01-24 19:44:43 +00:00
CIFS2.OpenDir lda #MLI.E.BADCALL
2021-01-12 21:14:13 +00:00
sec
rts
*--------------------------------------
2021-02-11 22:08:22 +00:00
CIFS.ReadDir jsr GetPFD
2021-03-15 15:00:27 +00:00
jsr ClearSocket
2021-02-17 16:15:43 +00:00
ldy #S.FD.DIR.EPB
lda (pFD),y
beq .1
lda #MLI.E.EOF
sec
rts
.1 iny
lda (pFD),y
2021-02-11 22:08:22 +00:00
iny
2021-02-17 16:15:43 +00:00
ora (pFD),y
2021-02-11 22:08:22 +00:00
bne CIFS.ReadDir.Next
jsr MakeTrans2Reg
ldx #0
2021-02-17 16:15:43 +00:00
2021-02-20 10:18:02 +00:00
.2 lda SMB.FindFirst2,x
2021-02-11 22:08:22 +00:00
sta (ZPReqPtr),y
iny
inx
2021-02-20 10:18:02 +00:00
cpx #SMB.FindFirst2.Len
2021-02-11 22:08:22 +00:00
bne .2
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
bra CIFS.ReadDir.Send
2021-02-17 16:15:43 +00:00
CIFS.ReadDir.Next
2021-02-11 22:08:22 +00:00
jsr MakeTrans2Reg
ldx #0
2021-02-17 16:15:43 +00:00
2021-02-20 10:18:02 +00:00
.2 lda SMB.FindNext2,x
2021-02-11 22:08:22 +00:00
sta (ZPReqPtr),y
iny
inx
2021-02-20 10:18:02 +00:00
cpx #SMB.FindNext2.Len
2021-02-11 22:08:22 +00:00
bne .2
phy
ldy #S.FD.DIR.FC+1
2021-02-17 16:15:43 +00:00
lda (pFD),y
2021-02-11 22:08:22 +00:00
tax
dey
2021-02-17 16:15:43 +00:00
lda (pFD),y
ldy #S.NETBIOS+S.SMB.H+SMB.Trans2.H.Len+7 Search ID
sta (ZPReqPtr),y
2021-02-11 22:08:22 +00:00
txa
iny
2021-02-17 16:15:43 +00:00
sta (ZPReqPtr),y
2021-02-11 22:08:22 +00:00
ply
2021-02-17 16:15:43 +00:00
CIFS.ReadDir.Send
lda (pPath)
beq .1
jsr AppendPath
lda #'\'
sta (ZPReqPtr),y
iny
.1 lda #'*'
sta (ZPReqPtr),y
iny
lda #0
sta (ZPReqPtr),y
iny
2021-02-11 22:08:22 +00:00
jsr SetT2ReqLenYA
>PUSHYA
>PUSHW ZPReqPtr
lda MountTable+3 hSocket
ldx #LIBTCPIP.Send
jsr GO.LIBTCPIP
2021-02-17 16:15:43 +00:00
bcs .9
2021-02-11 22:08:22 +00:00
2021-03-11 21:40:55 +00:00
jmp Sleep
2021-02-11 22:08:22 +00:00
.9 rts
*--------------------------------------
2021-02-17 16:15:43 +00:00
CIFS2.ReadDir jsr GetPFD
2021-03-15 15:00:27 +00:00
jsr ReadSocket
2021-03-11 21:40:55 +00:00
bcs .90
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
jsr GetRespData
ldy #S.NETBIOS+S.SMB.H.STATUS
lda (ZPRespPtr),y
2021-03-11 21:40:55 +00:00
beq .1
2021-02-11 22:08:22 +00:00
2021-03-11 21:40:55 +00:00
.91 sec
lda #MLI.E.IO
bra .9
.1 ldy #S.FD.DIR.FC
2021-02-17 16:15:43 +00:00
lda (pFD),y
iny
ora (pFD),y
sta bFlag
2021-03-11 21:40:55 +00:00
bne .2
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
ldy #S.NETBIOS+S.SMB.H+S.TRANS2.H+1 Search ID
lda (ZPRespPtr),y
tax
dey
2021-03-11 21:40:55 +00:00
ora (ZPRespPtr),y
beq .91
2021-02-17 16:15:43 +00:00
2021-03-11 21:40:55 +00:00
lda (ZPRespPtr),y
2021-02-11 22:08:22 +00:00
ldy #S.FD.DIR.FC
2021-02-17 16:15:43 +00:00
sta (pFD),y
2021-02-11 22:08:22 +00:00
iny
txa
2021-02-17 16:15:43 +00:00
sta (pFD),y
2021-02-11 22:08:22 +00:00
2021-03-11 21:40:55 +00:00
.2 jsr GetRespDataOffset
2021-02-11 22:08:22 +00:00
jsr CIFS2.ReadDir.GetBuf
2021-03-11 21:40:55 +00:00
bcs .9
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
jsr GetRespDataOffset
jsr CIFS2.ReadDir.FillBuf
2021-02-17 16:15:43 +00:00
2021-03-11 21:40:55 +00:00
lda hResp
>SYSCALL2 FreeMem
2021-02-11 22:08:22 +00:00
>LDYA BufPtr
ldx hBuf
2021-03-11 21:40:55 +00:00
2021-02-11 22:08:22 +00:00
stz CIFS.Status
clc
rts
2021-03-11 21:40:55 +00:00
.9 stz CIFS.Status
jmp FreeRespData
2021-02-11 22:08:22 +00:00
2021-03-11 21:40:55 +00:00
.90 cmp #E.NODATA
2021-02-11 22:08:22 +00:00
bne .99
dec CIFS.Retries
2021-03-11 21:40:55 +00:00
beq .98
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
lda #0
2021-01-12 21:14:13 +00:00
sec
rts
2021-02-17 16:15:43 +00:00
2021-03-11 21:40:55 +00:00
.98 lda #MLI.E.IO
2021-02-11 22:08:22 +00:00
.99 stz CIFS.Status
sec
2021-02-17 16:15:43 +00:00
rts
2021-01-12 21:14:13 +00:00
*--------------------------------------
2021-02-11 22:08:22 +00:00
CIFS2.ReadDir.GetBuf
2021-02-17 16:15:43 +00:00
ldy #S.NETBIOS+S.SMB.H+S.TRANS2.H Search Count
lda bFlag
bne .10
iny
iny
.10 iny
iny
lda (ZPRespPtr),y End Of Search
phy
ldy #S.FD.DIR.EPB
sta (pFD),y
ply
dey
dey
lda (ZPRespPtr),y Search Count
beq .99
tax
2021-02-11 22:08:22 +00:00
lda #1 +Ending 0
sta ZPPtr2
stz ZPPtr2+1
.1 lda ZPPtr2
clc
adc #S.STAT
sta ZPPtr2
bcc .2
inc ZPPtr2+1
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
.2 lda ZPPtr1
clc
adc #22
sta ZPPtr1
bcc .3
inc ZPPtr1+1
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
.3 lda (ZPPtr1) Filename Len
pha
sec
adc ZPPtr2
sta ZPPtr2
bcc .4
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
inc ZPPtr2+1
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
.4 pla
inc
sec
adc ZPPtr1
sta ZPPtr1
bcc .5
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
inc ZPPtr1+1
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
.5 dex
bne .1
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
>LDYA ZPPtr2
>SYSCALL2 GetMem
bcs .9
>STYA BufPtr
>STYA ZPPtr2
stx hBuf
.9 rts
2021-02-17 16:15:43 +00:00
.99 lda #MLI.E.EOF
sec
rts
2021-02-11 22:08:22 +00:00
*--------------------------------------
CIFS2.ReadDir.FillBuf
2021-02-17 16:15:43 +00:00
ldy #S.NETBIOS+S.SMB.H+S.TRANS2.H Search Count
lda bFlag
bne .10
iny
iny
.10 lda (ZPRespPtr),y
2021-02-11 22:08:22 +00:00
tax
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
.1 jsr FileInfo2StatBuf
lda ZPPtr1
sec skip Filename Len
adc #22
sta ZPPtr1
bcc .2
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
inc ZPPtr1+1
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
.2 ldy #$ff
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
.3 iny
lda (ZPPtr1),y
sta (ZPPtr2),y
bne .3
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
tya
sec
adc ZPPtr1
sta ZPPtr1
bcc .4
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
inc ZPPtr1+1
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
.4 tya
sec
adc ZPPtr2
sta ZPPtr2
bcc .5
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
inc ZPPtr2+1
2021-02-17 16:15:43 +00:00
.5 jsr StatBuf2Ptr2
2021-02-11 22:08:22 +00:00
lda #S.STAT
clc
adc ZPPtr2
sta ZPPtr2
bcc .7
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
inc ZPPtr2+1
.7 dex
bne .1
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
lda #0
sta (ZPPtr2)
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
rts
*--------------------------------------
2021-02-17 16:15:43 +00:00
CIFS.CloseDir tax
lda Nod.Table.hName-2,x
beq .1
phx
stz Nod.Table.hName-2,x
>SYSCALL2 FreeMem
2021-02-11 22:08:22 +00:00
2021-02-17 16:15:43 +00:00
plx
.1 lda Nod.Table.hFD-2,x
stz Nod.Table.hFD-2,x
>SYSCALL2 FreeMem
stz CIFS.Status
clc
rts
*--------------------------------------
2021-02-11 22:08:22 +00:00
CIFS2.CloseDir lda #MLI.E.INVPATH
sec
rts
2021-01-12 21:14:13 +00:00
*--------------------------------------
CIFS.Open
2021-01-24 19:44:43 +00:00
CIFS2.Open
2021-01-12 21:14:13 +00:00
*--------------------------------------
2021-02-17 16:15:43 +00:00
CIFS.Close
2021-01-24 19:44:43 +00:00
CIFS2.Close
2021-02-11 22:08:22 +00:00
lda #MLI.E.INVPATH
sec
rts
2021-01-12 21:14:13 +00:00
*--------------------------------------
CIFS.Read
2021-01-24 19:44:43 +00:00
CIFS2.Read
2021-01-12 21:14:13 +00:00
*--------------------------------------
CIFS.Write
2021-01-24 19:44:43 +00:00
CIFS2.Write
2021-01-12 21:14:13 +00:00
*--------------------------------------
CIFS.ChOwn
2021-01-24 19:44:43 +00:00
CIFS2.ChOwn
2021-01-12 21:14:13 +00:00
lda #MLI.E.BADCALL
sec
rts
*--------------------------------------
2021-02-17 16:15:43 +00:00
GetPFD tax
phx
lda Nod.Table.hName-2,x
>SYSCALL2 GetMemPtr
>STYA pPath
plx
lda Nod.Table.hFD-2,x
>SYSCALL2 GetMemPtr
>STYA pFD
rts
*--------------------------------------
2021-02-11 22:08:22 +00:00
MakeTrans2Reg lda MountTable+2
>SYSCALL2 GetMemPtr
>STYA ZPCtxPtr
ldx #S.SMB.H.CMD.TRANS2
jsr RequestSetupX
ldx #0
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
.1 lda SMB.Trans2.H,x
sta (ZPReqPtr),y
iny
inx
cpx #SMB.Trans2.H.Len
bne .1
rts
*--------------------------------------
2021-01-17 21:48:54 +00:00
GetSMBContext lda (pStack),y
>SYSCALL2 GetMemPtr
2021-01-12 21:14:13 +00:00
>STYA ZPCtxPtr
rts
*--------------------------------------
2021-01-17 21:48:54 +00:00
RequestSetupX phx
lda hReq
>SYSCALL2 GetMemPtr
>STYA ZPReqPtr
plx
ldy #0
.1 lda (ZPCtxPtr),y
cpy #S.NETBIOS+S.SMB.H.CMD
bne .2
txa
.2 sta (ZPReqPtr),y
iny
cpy #S.NETBIOS+S.SMB.H
bne .1
rts
*--------------------------------------
2021-02-17 16:15:43 +00:00
AppendPath ldx #0
.1 lda (pPath)
beq .4
inc pPath
bne .2
inc pPath+1
.2 cmp #'/'
bne .3
lda #'\'
.3 sta (ZPReqPtr),y
tax
iny
bra .1
.4 cpx #'\'
bne .5
dey
.5 rts
*--------------------------------------
2021-01-12 21:14:13 +00:00
* Y = LEN from S.NETBIOS.TYPE
* A = Ptr to LEN Word
*--------------------------------------
2021-01-14 21:39:36 +00:00
SetReqLenYAtA sty ZPReqLen
2021-01-12 21:14:13 +00:00
stz ZPReqLen+1
2021-01-17 21:48:54 +00:00
2021-01-14 21:39:36 +00:00
sta ZPPtr1
2021-01-12 21:14:13 +00:00
pha
2021-01-17 21:48:54 +00:00
2021-01-12 21:14:13 +00:00
tya
dec
dec
2021-01-14 21:39:36 +00:00
sec
sbc ZPPtr1
2021-01-12 21:14:13 +00:00
ply
2021-01-14 21:39:36 +00:00
2021-01-12 21:14:13 +00:00
sta (ZPReqPtr),y
iny
lda #0
sta (ZPReqPtr),y
2021-01-24 19:44:43 +00:00
bra SetReqLenNETBIOS
*--------------------------------------
SetT2ReqLenYA sty ZPReqLen
stz ZPReqLen+1
2021-02-17 16:15:43 +00:00
2021-01-24 19:44:43 +00:00
tya
sec
sbc #S.NETBIOS+S.SMB.H+SMB.Trans2.H.Len+7
ldy #S.NETBIOS+S.SMB.H+1
sta (ZPReqPtr),y
ldy #S.NETBIOS+S.SMB.H+19
sta (ZPReqPtr),y
2021-02-17 16:15:43 +00:00
2021-01-24 19:44:43 +00:00
inc
inc
inc
2021-02-17 16:15:43 +00:00
2021-01-24 19:44:43 +00:00
ldy #S.NETBIOS+S.SMB.H+SMB.Trans2.H.Len+2
sta (ZPReqPtr),y
2021-01-17 21:48:54 +00:00
2021-01-24 19:44:43 +00:00
SetReqLenNETBIOS
2021-01-12 21:14:13 +00:00
lda ZPReqLen
sec
sbc #S.NETBIOS
ldy #S.NETBIOS.LEN+2
sta (ZPReqPtr),y
lda ZPReqLen+1
sec
2021-01-17 21:48:54 +00:00
sbc /S.NETBIOS
2021-01-12 21:14:13 +00:00
dey
sta (ZPReqPtr),y
2021-01-17 21:48:54 +00:00
2021-01-14 21:39:36 +00:00
>LDYA ZPReqLen
2021-01-12 21:14:13 +00:00
rts
*--------------------------------------
2021-03-11 21:40:55 +00:00
Sleep ldy #S.PS.PID
lda (pPS),y
sta CIFS.PID
dec CIFS.Status
stz CIFS.Retries
lda #0
sec
rts
*--------------------------------------
2021-01-12 21:14:13 +00:00
GetRespData sta hResp
2021-01-17 21:48:54 +00:00
>SYSCALL2 GetMemPtr
2021-01-12 21:14:13 +00:00
pha
tya
* clc
adc #S.TCP
sta ZPRespPtr
pla
adc /S.TCP
sta ZPRespPtr+1
rts
*--------------------------------------
2021-02-11 22:08:22 +00:00
GetRespDataOffset
ldy #S.NETBIOS+S.SMB.H+15 Data Offset
lda (ZPRespPtr),y
clc
adc ZPRespPtr
tax
iny
lda (ZPRespPtr),y
adc ZPRespPtr+1
pha
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
txa
clc
adc #S.NETBIOS
sta ZPPtr1
2021-02-17 16:15:43 +00:00
2021-02-11 22:08:22 +00:00
pla
adc /S.NETBIOS
sta ZPPtr1+1
2021-02-17 16:15:43 +00:00
2021-03-11 21:40:55 +00:00
rts
*--------------------------------------
FreeRespData php
pha
lda hResp
>SYSCALL2 FreeMem
pla
plp
2021-02-11 22:08:22 +00:00
rts
2021-01-12 21:14:13 +00:00
*--------------------------------------
2021-02-11 22:08:22 +00:00
FileInfo2StatBuf
phx
ldx #S.STAT-1
.1 stz StatBuf,x
dex
bpl .1
2021-02-17 16:15:43 +00:00
ldy #0 Creation Date/Time
ldx #S.STAT.CTIME
jsr FileInfo2StatBufDT
ldy #4 Last Access Date/Time
ldx #S.STAT.ATIME
jsr FileInfo2StatBufDT
ldy #8 Last Write Date/Time
ldx #S.STAT.MTIME
jsr FileInfo2StatBufDT
ldy #12+3 Data Size
2021-02-11 22:08:22 +00:00
ldx #3
2021-02-17 16:15:43 +00:00
.7 lda (ZPPtr1),y
2021-02-11 22:08:22 +00:00
sta StatBuf+S.STAT.SIZE,x
dey
dex
2021-02-17 16:15:43 +00:00
bpl .7
ldy #20 File Attribute
lda (ZPPtr1),y
and #$10
beq .8
lda /S.STAT.MODE.DIR
sta StatBuf+S.STAT.MODE+1
2021-02-11 22:08:22 +00:00
.8 plx
2021-02-17 16:15:43 +00:00
rts
2021-01-12 21:14:13 +00:00
*--------------------------------------
2021-02-17 16:15:43 +00:00
* YYYYYYYM MMM DDDDD
* HHHHHmmm mmm SSSSS
*--------------------------------------
FileInfo2StatBufDT
iny
lda (ZPPtr1),y
2021-02-11 22:08:22 +00:00
lsr
2021-02-17 16:15:43 +00:00
php
clc
adc #80
sta StatBuf+S.TIME.YEAR,x
lda #19
adc #0
sta StatBuf+S.TIME.CENTURY,x
dey
plp
lda (ZPPtr1),y
ror
lsr
lsr
lsr
lsr
sta StatBuf+S.TIME.MONTH,x
lda (ZPPtr1),y
and #$1F
sta StatBuf+S.TIME.DAY,x
iny
iny
lda (ZPPtr1),y
and #$1F
asl
sta StatBuf+S.TIME.SECOND,x
lda (ZPPtr1),y
and #$E0
sta StatBuf+S.TIME.MINUTE,x
lda (ZPPtr1),y
lsr
ror StatBuf+S.TIME.MINUTE,x
lsr
ror StatBuf+S.TIME.MINUTE,x
lsr
ror StatBuf+S.TIME.MINUTE,x
lsr StatBuf+S.TIME.MINUTE,x
lsr StatBuf+S.TIME.MINUTE,x
sta StatBuf+S.TIME.HOUR,x
2021-02-11 22:08:22 +00:00
rts
2021-02-17 16:15:43 +00:00
* TODO : S.TIME.WDAY
*--------------------------------------
StatBuf2Ptr2 ldy #S.STAT-1
.1 lda StatBuf,y
sta (ZPPtr2),y
dey
bpl .1
rts
*--------------------------------------
2021-03-15 15:00:27 +00:00
ClearSocket jsr ReadSocket
bcs .8
>SYSCALL2 FreeMem
bra ClearSocket
.8 clc
rts
*--------------------------------------
ReadSocket lda MountTable+3 hSocket
ldx #LIBTCPIP.Recv
2021-02-11 22:08:22 +00:00
GO.LIBTCPIP jmp (pLIBTCPIP)
2021-01-24 19:44:43 +00:00
*--------------------------------------
2021-02-11 22:08:22 +00:00
CS.END
2021-01-17 21:48:54 +00:00
*--------------------------------------
2021-02-11 22:08:22 +00:00
NETBIOS .DA #0 DIRECT TCP TRANSPORT
2021-01-12 21:14:13 +00:00
.DA #0 24 BITS LENGTH
.DA /SMB.NegReq.end-SMB.H
.DA #SMB.NegReq.end-SMB.H
*--------------------------------------
SMB.H .DA #$FF
.AS "SMB"
.DA #S.SMB.H.CMD.NEGOTIATE
.HS 00000000
.DA #0 S.SMB.H.FLAGS
.DA S.SMB.H.FLAGS2.LONGNAMES
.DA 0 PIDHI
.HS 0000000000000000 SECFEAT
.DA 0 RSVD
.DA $FFFF TID
.DA $FFFE PIDLO
.BS 2 UID
.DA 0 MID
*--------------------------------------
SMB.NegReq .DA #0 WORD COUNT
.DA #SMB.NegReq.end-2-* ByteCount
.DA #0
* .DA #2
* .AZ "PC NETWORK PROGRAM 1.0"
* .DA #2
* .AZ "LANMAN1.0"
* .DA #2
* .AZ "Windows for Workgroups 3.1a"
* .DA #2
* .AZ "LM1.2X002"
* .DA #2
* .AZ "LANMAN2.1"
.DA #2
.AZ "NT LM 0.12"
* .DA #2
* .AZ "SMB 2.002"
* .DA #2
* .AZ "SMB 2.???"
SMB.NegReq.end .EQ *
*--------------------------------------
SMB.SessionSetup.H
.DA #13 WORD COUNT
.HS FF000000 NO MORE CMD
.DA 1280 MAX BUFFER
.DA 2 MAX MPX COUNT
.HS 0000 VC NUMBER
.HS 00000000 SESSION KEY
2021-01-14 21:39:36 +00:00
.DA 0 CI PASS LEN (ANSI)
.DA 0 CS PASS LEN (UNICODE)
2021-01-12 21:14:13 +00:00
.HS 00000000
.HS 00000000 CAPABILITIES
SMB.SessionSetup.H.Len .EQ *-SMB.SessionSetup.H
* .BS 2 ByteCount
SMB.SessionSetup.Guest
2021-01-14 21:39:36 +00:00
* .AZ "" Password
2021-01-12 21:14:13 +00:00
.AZ "Guest" Account Name
.AZ "?" Primary Domain
SMB.SessionSetup.Guest.Len .EQ *-SMB.SessionSetup.Guest
SMB.SessionSetup.T
.AZ "A2osX" Native OS
.AZ "A2osX-CIFSD" Native LANMAN
SMB.SessionSetup.T.Len .EQ *-SMB.SessionSetup.T
*--------------------------------------
SMB.TreeConnect.H
.DA #4 WORD COUNT
.HS FF000000 NO MORE CMD
.DA 0
.DA 1 PASSWORD LEN (1 for "\0")
SMB.TreeConnect.H.Len .EQ *-SMB.TreeConnect.H
* .BS 2 ByteCount
* .AZ "" PASSWORD
* .AZ "_temp" PATH
SMB.TreeConnect.T
.AZ "A:" Disk Share
SMB.TreeConnect.T.Len .EQ *-SMB.TreeConnect.T
2021-02-20 10:18:02 +00:00
*-------------------------------------- #$2E
SMB.ComRead.H .DA #10 WORD COUNT
.HS FF000000 NO MORE CMD
.BS 2 FID
.BS 4 Offset
.BS 2 MaxCountOfBytesToReturn
.HS 0000 MinCountOfBytesToReturn
.HS 00000000 Timeout
.HS 0000 Remaining
.HS 0000 ByteCount
SMB.ComRead.H.Len .EQ *-SMB.ComRead.H
*-------------------------------------- #$2F
SMB.ComWrite.H .DA #12 WORD COUNT
.HS FF000000 NO MORE CMD
.BS 2 FID
.BS 4 Offset
.HS 00000000 Timeout
2021-03-11 21:40:55 +00:00
.HS 0001 WriteMode=WritethroughMode
2021-02-20 10:18:02 +00:00
.BS 2 Remaining
.HS 0000 Reserved
.BS 2 DataLength
.BS 2 DataOffset
SMB.ComWrite.H.Len .EQ *-SMB.ComWrite.H
.BS 2 ByteCount
SMB.ComWrite.T
* DATA.....
SMB.ComWrite.T.Len .EQ *-SMB.ComWrite.T
*-------------------------------------- #$04
SMB.ComClose.H .DA #3 WORD COUNT
.BS 2 FID
.HS 00000000 LastTimeModified
.HS 0000 ByteCount
SMB.ComClose.H.Len .EQ *-SMB.ComClose.H
2021-01-12 21:14:13 +00:00
*--------------------------------------
2021-01-24 19:44:43 +00:00
SMB.Trans2.H .DA #15 WORD COUNT
.BS 2 TotalParamCount
2021-01-12 21:14:13 +00:00
.DA 0 TotalDataCount
2021-02-11 22:08:22 +00:00
.DA 10 MaxParameterCount
2021-03-11 21:40:55 +00:00
.DA 450 MaxDataCount
2021-01-24 19:44:43 +00:00
.DA #0 MaxSetupCount
2021-01-12 21:14:13 +00:00
.HS 00 Reserved1
.DA 0 Flags
.HS 00000000 Timeout
.HS 0000 Reserved2
2021-01-24 19:44:43 +00:00
.BS 2 ParameterCount
.DA 68 ParameterOffset
2021-01-12 21:14:13 +00:00
.HS 0000 DataCount
.HS 0000 DataOffset
.DA #1 SetupCount
.HS 00 Reserved3
2021-02-17 16:15:43 +00:00
SMB.Trans2.H.Len .EQ *-SMB.Trans2.H
2021-01-12 21:14:13 +00:00
*--------------------------------------
2021-02-17 16:15:43 +00:00
SMB.Open2 .DA 0 TRANS2_OPEN2
2021-02-20 10:18:02 +00:00
.BS 2 PrmCnt
.HS 000000 Padding
.HS 0000 Flags
.BS 2 Access Mode
.HS 0000 Reserved1
.BS 2 FileAttributes
.HS 00000000 CreationTime
.BS 2 OpenMode
.HS 00000000 AllocationSize
.HS 00000000000000000000 Reserved
* .AZ "filename"
2021-02-17 16:15:43 +00:00
SMB.Open2.Len .EQ *-SMB.Open2
2021-01-12 21:14:13 +00:00
*--------------------------------------
2021-02-20 10:18:02 +00:00
SMB.FindFirst2 .DA 1 TRANS2_FIND_FIRST2
2021-01-24 19:44:43 +00:00
.BS 2 PrmCnt
2021-02-11 22:08:22 +00:00
.HS 000000 Padding
.DA $0037 SearchAttributes
2021-01-12 21:14:13 +00:00
.DA 1024 SearchCount
2021-01-24 19:44:43 +00:00
.DA 2 Flags
.DA SMB_INFO_STANDARD InformationLevel
2021-02-11 22:08:22 +00:00
.HS 00000000 SearchStorageType
2021-02-20 10:18:02 +00:00
* .AZ "path\*"
SMB.FindFirst2.Len .EQ *-SMB.FindFirst2
2021-01-24 19:44:43 +00:00
*--------------------------------------
2021-02-20 10:18:02 +00:00
SMB.FindNext2 .DA 2 TRANS2_FIND_NEXT2
2021-01-24 19:44:43 +00:00
.BS 2 PrmCnt
2021-02-11 22:08:22 +00:00
.HS 000000 Padding
2021-01-24 19:44:43 +00:00
.BS 2 SID
.DA 1024 SearchCount
.DA SMB_INFO_STANDARD InformationLevel
2021-02-17 16:15:43 +00:00
.HS 00000000 ResumeKey
.DA 2+8 Flags
2021-02-20 10:18:02 +00:00
* .AZ "path\*"
SMB.FindNext2.Len .EQ *-SMB.FindNext2
2021-02-11 22:08:22 +00:00
*--------------------------------------
2021-02-17 16:15:43 +00:00
SMB.QueryPathInfo
.DA 5 TRANS2_QUERY_PATH_INFORMATION
.BS 2 PrmCnt
.HS 000000 Padding
.DA SMB_INFO_STANDARD InformationLevel
.HS 00000000 SearchStorageType
2021-02-20 10:18:02 +00:00
* .AZ "filename"
2021-02-17 16:15:43 +00:00
SMB.QueryPathInfo.Len .EQ *-SMB.QueryPathInfo
*--------------------------------------
SMB.CreateDirectory
.DA 13 TRANS2_CREATE_DIRECTORY
.BS 2 PrmCnt
.HS 000000 Padding
.HS 00000000 Reserved
* .AZ "DirName"
SMB.CreateDirectory.Len .EQ *-SMB.CreateDirectory
*--------------------------------------
2021-02-11 22:08:22 +00:00
LIBTCPIP .AZ "libtcpip"
hLIBTCPIP .BS 1
pLIBTCPIP .BS 2
hSocket .BS 1
hReq .BS 1
*--------------------------------------
CIFS.Status .BS 1
CIFS.PID .BS 1
CIFS.Retries .BS 1
*--------------------------------------
MountTable .BS 2 pMountPoint
.BS 1 hSMBContext
.BS 1 hSocket
*--------------------------------------
StatBuf .BS S.STAT
2021-01-12 21:14:13 +00:00
*--------------------------------------
MAN
SAVE usr/src/lib/libcifs.s
ASM