Article # 653, added by Geoworks, historical record
| first | previous | index | next | last |

Broken C-stub: SocketGetMediumAddress



C Routine:  SocketGetMediumAddress
Date Fixed: 10/15/97

The c-stub for SocketGetMediumAddress was calling the wrong routine
and thus the wrong data was coming back. You can work around this
bug by writing your own C-stub. The code below is a good start.
 

include geos.def
include geode.def
include resource.def
include ec.def
include assert.def

UseLib socket.def

SetGeosConvention

CApiCode	segment resource

MYGETMEDIUMADDRESS		proc	far	domain:fptr.char,
						buffer:fptr.byte,
						bufsize:fptr.word,
						mau:fptr.MediumAndUnit
		uses	si,di,ds
		.enter
	; 
	; Copy the parameters from the stack into registers
	;
		movdw	dssi, bufsize
		Assert	fptr dssi
		mov	cx, ds:[si]
		push	ds,si
		movdw	dssi, domain
		movdw	esdi, buffer
		movdw	dxax, mau
	;
	; Call the assembly function
	;
		call	SocketGetMediumAddress
	;
	; Return the result
	;
		pop	ds,si
		mov	ds:[si], cx
		.leave
		ret
MYGETMEDIUMADDRESS	endp

CApiCode	ends

SetDefaultConvention