Code:
' ' Unit.............LMUAPI1.PBL 1.10 ' Zweck............Teile vom LAN-Manager-API per Interrupt 5F (undokumentiert); ' andere Teile (Redirektionsfunktionen) befinden sich in ' REDIR2.PBL. ' Version..........1.00 aus REDIR1.PBL weiterentwickelt 31.07.95 ' 1.10 Anpassungen an PB 3.5, ASM, Verwendung von ' @Pointern, POINTER-Unit überflüssig, 08.07.98. ' Sprache..........PowerBASIC 3.x ' Autor............M.Hoffmann ' ' c: lmuapi1 .pbu 1726 5.04.98 14:42 v1.00 ' c: lmuapi1 .pbu 757 8.07.98 13:56 v1.10 ' '=============================================================================== ' COMPILEROPTIONEN '=============================================================================== $compile unit $cpu 80386 $debug map- $dim all $error all- $float emulate $lib all- defint a-z '------------------------------------------------------------------------------- ' STRUKTUREN '------------------------------------------------------------------------------- type wkstainfo10type pCName as asciiz ptr*256 pUName as asciiz ptr*256 pLGrp as asciiz ptr*256 VerMaj as byte VerMin as byte pDomain as asciiz ptr*256 pOthDom as asciiz ptr*256 ' Workspace für den LAN Manager; hier werden Ergebnisstrings plaziert, ' auf die die Pointer der Struktur zeigen (Länge?--Microsoft Schwachsinn) WorkBuf as string*256 end type '=============================================================================== ' PROZEDUREN UND FUNKTIONEN '=============================================================================== function LMNetWkstaGetInfoU (CName AS string, _ ' Computername UName AS string, _ ' Benutzername LGrp AS string, _ ' Eigene Domäne Vers AS string, _ ' LMgr Version LDom AS string, _ ' Logon Domäne ODom AS string _ ' Andere Domänen ) public as integer dim Buf AS WkstaInfo10Type dim lb as integer lb = len(buf) ! pushf ; ! push di ; ! mov bx, 10 ; Nur Userlevel-Infos anfordern ! mov cx, lb ; len(Buf) ! lea di, Buf ; Load Effective Address ! mov ax, ds ; Umweg notwendig ! mov es, ax ; Adresse jetzt wie gewünscht in ES [img]http://www.powerbasic.com/support/forums/biggrin.gif[/img]I ! mov ax, &h5f44 ; LAN Manager Call ! int &h21 ; Call DOS ! jc Cont1 ; ! xor ax, ax ; nur Carryflag läßt Aussage über Fehler zu! Cont1: ! mov function,ax ; ! pop di ; ! popf ; ! cmp ax,0 ; ! je Cont2 ; exit function Cont2: CName = [email protected] UName = [email protected] LGrp = [email protected] Vers = using$("#.##",Buf.VerMaj+Buf.VerMin/100) LDom = [email protected] ODom = [email protected] end function '===============================================================================