From b682a4c834e8a62dd36995bd34f76a3987372825 Mon Sep 17 00:00:00 2001 From: Christopher Shepherd Date: Mon, 11 May 2015 14:40:12 -0400 Subject: [PATCH] stub-out all the rest of the calls we'll be supporting after setup_ANDX and treec_ANDX --- src/SMBDEMO.S | 287 +++++++++++++++++++++++++++++++++++++++++++++++++- src/smbdemo | Bin 37154 -> 37437 bytes 2 files changed, 286 insertions(+), 1 deletion(-) diff --git a/src/SMBDEMO.S b/src/SMBDEMO.S index 9cc8184..f9e57f3 100644 --- a/src/SMBDEMO.S +++ b/src/SMBDEMO.S @@ -1078,6 +1078,8 @@ SMB_sess_domain ds 32 ; sloppy 32 byte buffer to hold SMB domain * Strings SMB_dialect asc 02'NT LM 0.12'00 ; the only dialect we're gonna speak +SMB_os asc 'GS/OS'00 ; native Operating System +SMB_lanman asc 'Apple IIgs'00 ; native LAN Manager * SMB packet staging area * TODO these will probably be dynamically allocated too? @@ -1325,7 +1327,290 @@ nego_proceeding plx ; our return address rts * -* SMB internal subroutines +* SMB_SetupAndX - Next step after negotiating protocol, includes authentication +* Arguments: +* SMB session handle (two words, on stack) +* Things I return on stack: +* Carry flag set if error +SMB_SetupAndX plx ; return address + PullLong SMB_sessid + phx ; saved return address + + PushWord #SMB_setup_ANDX ; command + PushWord #CIFS_flags1 ; flags1 + PushWord #CIFS_flags2 ; flags2 + jsr _InitSMBHeader ; make an SMB header with this information + +* TODO + + rts + +* +* SMB_TreeAndX - Connect to the remote share +* Arguments: +* SMB session handle (two words, on stack) +* Things I return on stack: +* Carry flag set if error +SMB_TreeAndX plx ; return address + PullLong SMB_sessid + phx ; saved return address + + PushWord #SMB_treec_ANDX ; command + PushWord #CIFS_flags1 ; flags1 + PushWord #CIFS_flags2 ; flags2 + jsr _InitSMBHeader ; make an SMB header with this information + +* TODO + + rts + +* +* SMB_OpenFile - Open a file on the remote share +* Arguments: +* SMB session handle (two words, on stack) +* Long pointer to filename (two words, on stack) +* Access flags (one word, on stack) +* Creation flags (one word, on stack) +* Things I return on stack: +* A = SMB filehandle id +* Carry flag set if error +SMB_OpenFile plx ; return address + PullLong SMB_sessid + phx ; saved return address + + PushWord #SMB_open_ANDX ; command + PushWord #CIFS_flags1 ; flags1 + PushWord #CIFS_flags2 ; flags2 + jsr _InitSMBHeader ; make an SMB header with this information + +* TODO + + rts + +* +* SMB_CloseFile - Close an open file on the remote share +* Arguments: +* SMB session handle (two words, on stack) +* A = SMB filehandle id +* Things I return on stack: +* Carry flag set if error +SMB_CloseFile plx ; return address + PullLong SMB_sessid + phx ; saved return address + + PushWord #SMB_close ; command + PushWord #CIFS_flags1 ; flags1 + PushWord #CIFS_flags2 ; flags2 + jsr _InitSMBHeader ; make an SMB header with this information + +* TODO + + rts + +* +* SMB_CreateDirectory - Create a directory on the remote share +* Arguments: +* SMB session handle (two words, on stack) +* Long pointer to filename (two words, on stack) +* Things I return on stack: +* Carry flag set if error +SMB_CreateDirectory + plx ; return address + PullLong SMB_sessid + phx ; saved return address + + PushWord #SMB_COM_create_directory ; command + PushWord #CIFS_flags1 ; flags1 + PushWord #CIFS_flags2 ; flags2 + jsr _InitSMBHeader ; make an SMB header with this information + +* TODO + + rts + +* +* SMB_DeleteDirectory - Delete a directory on the remote share +* Arguments: +* SMB session handle (two words, on stack) +* Long pointer to filename (two words, on stack) +* Things I return on stack: +* Carry flag set if error +SMB_DeleteDirectory + plx ; return address + PullLong SMB_sessid + phx ; saved return address + + PushWord #SMB_COM_delete_directory ; command + PushWord #CIFS_flags1 ; flags1 + PushWord #CIFS_flags2 ; flags2 + jsr _InitSMBHeader ; make an SMB header with this information + +* TODO + + rts + +* +* SMB_DeleteFile - Delete a file on the remote share +* Arguments: +* SMB session handle (two words, on stack) +* Long pointer to filename (two words, on stack) +* Things I return on stack: +* Carry flag set if error +SMB_DeleteFile plx ; return address + PullLong SMB_sessid + phx ; saved return address + + PushWord #SMB_COM_delete ; command + PushWord #CIFS_flags1 ; flags1 + PushWord #CIFS_flags2 ; flags2 + jsr _InitSMBHeader ; make an SMB header with this information + +* TODO + + rts + +* +* SMB_RenameFile - Rename a file on the remote share +* Arguments: +* SMB session handle (two words, on stack) +* Long pointer to old filename (two words, on stack) +* Long pointer to new filename (two words, on stack) +* Things I return on stack: +* Carry flag set if error +SMB_RenameFile plx ; return address + PullLong SMB_sessid + phx ; saved return address + + PushWord #SMB_COM_rename ; command + PushWord #CIFS_flags1 ; flags1 + PushWord #CIFS_flags2 ; flags2 + jsr _InitSMBHeader ; make an SMB header with this information + +* TODO + + rts + +* +* SMB_DiskInformation - Get information about the remote share +* Arguments: +* SMB session handle (two words, on stack) +* Long pointer to disk statbuf (two words, on stack) +* Things I return on stack: +* Carry flag set if error +SMB_DiskInformation + plx ; return address + PullLong SMB_sessid + phx ; saved return address + + PushWord #SMB_COM_query_information_disk ; command + PushWord #CIFS_flags1 ; flags1 + PushWord #CIFS_flags2 ; flags2 + jsr _InitSMBHeader ; make an SMB header with this information + +* TODO + + rts + +* +* SMB_ReadFile - Read an open file from the remote share +* Arguments: +* SMB session handle (two words, on stack) +* Long pointer to read buffer (two words, on stack) +* Size of read buffer (two words, on stack) +* Offset into file (two words, on stack) +* Things I return on stack: +* Carry flag set if error +SMB_ReadFile plx ; return address + PullLong SMB_sessid + phx ; saved return address + + PushWord #SMB_read_ANDX ; command + PushWord #CIFS_flags1 ; flags1 + PushWord #CIFS_flags2 ; flags2 + jsr _InitSMBHeader ; make an SMB header with this information + +* TODO + + rts + +* +* SMB_WriteFile - Write to an open file from the remote share +* Arguments: +* SMB session handle (two words, on stack) +* Long pointer to data buffer (two words, on stack) +* Size of data buffer (two words, on stack) +* Offset into file (two words, on stack) +* Things I return on stack: +* Carry flag set if error +SMB_WriteFile plx ; return address + PullLong SMB_sessid + phx ; saved return address + + PushWord #SMB_write_ANDX ; command + PushWord #CIFS_flags1 ; flags1 + PushWord #CIFS_flags2 ; flags2 + jsr _InitSMBHeader ; make an SMB header with this information + +* TODO + + rts + +* +* SMB_PathInfo - Get information about a file/path on the remote share +* Arguments: +* SMB session handle (two words, on stack) +* Long pointer to pathname (two words, on stack) +* Long pointer to smb direntry struct buffer (two words, on stack) +* Things I return on stack: +* Carry flag set if error +SMB_PathInfo plx ; return address + PullLong SMB_sessid + phx ; saved return address + + PushWord #SMB_query_path_info ; command + PushWord #CIFS_flags1 ; flags1 + PushWord #CIFS_flags2 ; flags2 + jsr _InitSMBHeader ; make an SMB header with this information + +* TODO + + rts + +* +* SMB_FindFirst - Find first file in a directory listing +* Arguments: +* SMB session handle (two words, on stack) +* Long pointer to pathname (two words, on stack) +* Flags (one word, on stack) +* Long pointer to smb direntry struct buffer (two words, on stack) +* Things I return on stack: +* Carry flag set if error + +* TODO TRANS2 call + +* +* SMB_FindNext - Find next file in a directory listing +* Arguments: +* SMB session handle (two words, on stack) +* Long pointer to smb direntry struct buffer (two words, on stack) +* Things I return on stack: +* Carry flag set if error + +* TODO TRANS2 call + +* +* SMB_FindClose - Close a directory listing +* Arguments: +* SMB session handle (two words, on stack) +* Long pointer to smb direntry struct buffer (two words, on stack) +* Things I return on stack: +* Carry flag set if error + +* TODO TRANS2 call + + +* +* Internal subroutines for SMB stuff * * _SMB_Check - Check to see if TCP received data is SMB diff --git a/src/smbdemo b/src/smbdemo index ebde3e4b77a8ab20ac53fb73d63971374de953bf..c80366e1b31fbb1e325fbb6c6c25a19499f79257 100644 GIT binary patch delta 788 zcmZvX&ubGw6vt<`X?DAvq(-8Rfyf40ZEKsP7ln#oEn-@C@sNKYDB=nt#Zt9UnkWQ3 zWH!+`D2h0wg7mQdpa&(8gFPjPWe;8~p)4`f#EKS)MuQq>Qz|*^yL`Uy^B!-QOoq)p zW`$#SK&!gbw}m5YclyP|1H0QuDrlZl&;q9|aA9qp3yWXyH~Ud$6bCpTv%V~GE1kPe zMS^D{V0?P|(s^-m^1{rr%h3_XI%mUfBnGpoQiy;I$mQS`_prlJ$;WFgtc30%#^Jem z5QN8QZK8E3CR6wvnqmz66p69xsprF5MJikYdY@L63IOQ)G@Crw1O*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