dos与windows通过IPX通信的程序 (100分)

  • 主题发起人 主题发起人 lmwen2000
  • 开始时间 开始时间
L

lmwen2000

Unregistered / Unconfirmed
GUEST, unregistred user!
1.DOS 部分:
开发工具:Borland C++ 3.1
编译模式:Tiny 或 Large

IPX.ASM Large编译模式代码:

;-------Start--------
.model large
.data
public _ipxentry
_ipxentry dd 0

.code

public _reverseword
_reverseword:
push bp
mov bp,sp
mov ax,[bp+6]
xchg ah,al
pop bp
retf

public _ipxinit
_ipxinit:
push di
push es
mov ax,7A00h
int 2Fh
cmp al,0FFh
jnz _ipxinit0
mov word ptr [_ipxentry+0],di
mov word ptr [_ipxentry+2],es
_ipxinit0:
mov dx,word ptr [_ipxentry+2]
mov ax,word ptr [_ipxentry+0]
pop es
pop di
retf

public _ipxgetaddress
_ipxgetaddress:
push bp
mov bp,sp
mov bx,0009h
mov si,[bp+6]
mov es,[bp+8]
call [_ipxentry]
pop bp
retf

public _ipxgetmaxpacketsize
_ipxgetmaxpacketsize:
mov bx,001Ah
call [_ipxentry]
retf

public _ipxopensocket
_ipxopensocket:
push bp
mov bp,sp
push ds
mov al,[bp+6]
mov bx,[bp+8]
mov ds,[bp+10]
mov dx,[bx]
pop ds
mov bx,0000h
call [_ipxentry]
push ds
mov bx,[bp+8]
mov ds,[bp+10]
mov [bx],dx
mov ah,00h
pop ds
pop bp
retf

public _ipxclosesocket
_ipxclosesocket:
push bp
mov bp,sp
mov bx,0001h
mov dx,[bp+6]
call [_ipxentry]
pop bp
retf

public _ipxlistenforpacket
_ipxlistenforpacket:
push bp
mov bp,sp
push si
push es
mov bx,0004h
mov si,[bp+6]
mov es,[bp+8]
call [_ipxentry]
mov ah,00h
pop es
pop si
pop bp
retf

public _ipxsendpacket
_ipxsendpacket:
push bp
mov bp,sp
push si
push es
mov bx,0003h
mov si,[bp+6]
mov es,[bp+8]
call [_ipxentry]
pop es
pop si
pop bp
retf

public _ipxrelenquishcontrol
_ipxrelenquishcontrol:
mov bx,000Ah
call [_ipxentry]
retf

end
;---End---


clinet.c

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include "ipx.h"

IPXADDRESS myaddress;
IPXECB recb;
IPXHEADER rheader;
unsigned char rbuffer[80];
int i;

//------------------------------------------------------------------------------
void main ( void )
{
if(!ipxinit())
{
printf("IPX not installed/n");
exit(1);
}
myaddress.socket=reverseword(0x2000);
switch(ipxopensocket(0x00,&amp;myaddress.socket))
{
case 0x00: // Success
printf("Socket %04X/n",reverseword(myaddress.socket));
break;
case 0xFE:
printf("Socket Table Full/n");
exit(1);
case 0xFF:
printf("Socket Already Open/n");
exit(1);
}

recb.socket=myaddress.socket;
recb.esraddress=NULL;
recb.fragcount=2;
recb.fragaddr1=&amp;rheader;
recb.fragsize1=sizeof(IPXHEADER);
recb.fragaddr2=rbuffer;
recb.fragsize2=sizeof(rbuffer);
ipxlistenforpacket(&amp;recb);

printf("Waiting for packet/n");
while(!kbhit())
{
ipxrelenquishcontrol();
if(!recb.inuse)
{
printf("Packet Received/n");
printf(" from %02X:%02X:%02X:%02X %02X:%02X:%02X:%02X:%02X:%02X/n",rheader.source.netadd[0],rheader.source.netadd[1],rheader.source.netadd[2],rheader.source.netadd[3],rheader.source.nodeadd[0],rheader.source.nodeadd[1],rheader.source.nodeadd[2],rheader.source.nodeadd[3],rheader.source.nodeadd[4],rheader.source.nodeadd[5]);
printf(" from socket %04X/n",reverseword(rheader.source.socket));
break;
}
}
while(kbhit()) getch();
ipxclosesocket(myaddress.socket);
}


我想在DOS部分可以得到服务器端发过来的信息(username=user04 clear=0)应该如果改呢??

 
自救一下
 
自救一下,为什么没有人帮呢?是不是分数太少了呢??
 
心有余力不足呀,帮你提前一下了
 
楼主你好!圣诞快乐
请问dos下能安装常用的网卡吗?如果能,怎么安装?Windows系统能通过网络读取Dos下的文件吗?
 
DOS下可以安装常用的网卡,只要有网卡驱动程序就可以了。
msconfig.sys
device=a:/winboot/HIMEM.SYS /TESTMEM:OFF /V
device=a:/winboot/ifshlp.sys
Shell=a:/command.com /p
lastdrive=z
buffers=20
stacks=32,256
device=a:/winboot/DBLBUFF.SYS

autoexec.bat
SET PATH=a:/winboot
cd winboot
SET NETBUFF=128
set comspec=a:/command.com
snapshot /s /b:d /m:128
net start ipx /y
winboot目录内容:
DBLBUFF.SYS
HIMEM.SYS
IFSHLP.SYS
NET.EXE
NET.MSG
PROTMAN.DOS
PROTMAN.EXE
RTSND.DOS(网卡驱动程序:按自己的网卡更换)
PROTOCOL.INI(按自己的网卡更换)
SNAPSHOT.EXE
system.dat

system.dat
REGEDIT4

[HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion]
"SystemRoot"="C://WINDOWS"

[HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Setup]
"DetectedLastDrive"="Z"
"LastDrive"="Z"
"BootDir"="C://WINDOWS"
"BootHost"="C://WINDOWS"
"OldWinBootDir"="C://WINDOWS//WINBOOT"
"WinDir"="C://WINDOWS"
"AppsDir"="C://WINDOWS"
"WinBootDir"="A://WINBOOT"
"HostWinBootDir"="C://WINDOWS//SUBOOT"
"MachineDir"="C://WINDOWS"
"WinAdminDir"="C://WINDOWS"
"SharedDir"="C://WINDOWS"
"SysDir"="C://WINDOWS//SYSTEM"
"SourcePath"="C://WINDOWS"
"OldWinDir"=""
"UninstallDir"="UNINSTALL.000"
"BackupDir"="UNINSTALL.000"
"SetupTempDir"="C://WINDOWS//SUWIN"
"SetupScratchDir"="C://WINDOWS//SUTEMP"
"EXPOSTRT"="1"
"SourcePathType"=hex:05,00,00,00
"ICMPath"="C://WINDOWS//SYSTEM//COLOR"
"ConfigPath"="C://WINDOWS//CONFIG"
"MediaPath"="C://WINDOWS//Media"

[HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Setup/WinBootDir]
"DevDir"="a://winboot"

[HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Network/Real Mode Net]
"transport"="*nwlink,ndishlp.sys"
"netcard"="RTSND.DOS"(网卡驱动程序:按自己的网卡更换)
"LoadRMDrivers"=hex:00,00,00,00
"PreferredRedir"="VREDIR"
"Transition"=hex:01
"SetupN"=hex:01
"SetupNPath"="C://WINDOWS//"
"StaticDrive"="C,d,e,f,w"

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/VxD/VNETSUP]
"ComputerName"="win98"
"WorkGroup"="WORKGROUP"
"Commment"="LiteNET-PC"
"StaticVxd"="vnetsup.vxd"
"Start"=hex:00
"NetClean"=hex:01

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/VxD/NWREDIR]
"PreferredTree"=""
"DefaultContext"=""
"NeighborhoodContext"=""
"SearchMode"=hex:00
"FirstNetworkDrive"=hex:03
"StaticVxD"="nwredir.vxd"
"Start"=hex:00
"NetClean"=hex:01
"PreserveCase"="1"

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/VxD/NWREDIR/Ndi]

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/VxD/NWREDIR/Ndi/params]

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/VxD/NWREDIR/Ndi/params/PreserveCase]
"ParamDesc"="Preserve Case"
"default"="1"
"type"="enum"
@="1"

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/VxD/NWREDIR/Ndi/params/PreserveCase/enum]
"0"="No"
"1"="Yes"

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/VxD/NWREDIR/ServiceProvider]
"Class"=hex:08,00,00,00
"ProviderPath"="sapnsp.dll"

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/VxD/NWREDIR/Parameters]

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/VxD/NWREDIR/Parameters/Winsock]
"HelperDllName"="sapnsp.dll"

[HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/MSNP32/NetworkProvider]
"LogonDisconnected"=DWORD:00000001
"DisableReLogin"=DWORD:00000001


[HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control/ComputerName]
"ComputerName"="win98"

 
没有帮一下吗?
 
无奈,自己提前一下。
 
自己提前一下。
 
自己提前一下
 
后退
顶部