Posted: Tue Apr 15, 2003 11:20 pm
Restored from previous forum. Originally posted by Eikeland.
Hi,
I'm calling an DLL and receive a pointer to an array of a structure.
Here is how I do it now, it works, but is it a faster way to do this with out the copy memory function?
/Richard
The Code:
Structure WTS_SERVER_INFO
pServerName.s ; server name
EndStructure
Procedure Test3()
lpBuffer.l
sres.s
Count.l = 0
i.l = 0
p.l
WpInf.WTS_SERVER_INFO
If OpenLibrary(#WTSAPI,"WTSAPI32.DLL")
If CallFunction(#WTSAPI,"WTSEnumerateServersA","VALHALLA",#NULL,1,@lpbuffer,@Count)
p = lpbuffer
For i = 0 To Count -1
CopyMemory(p,WpInf,SizeOf(WTS_SERVER_INFO))
sres = sres + WpInf\pServerName + Chr(10)
p+SizeOf(WTS_SERVER_INFO)
Next
MessageRequester("Test3","Servers: " + Str(Count) + Chr(10) + sres,0)
Else
MessageRequester("Test3","Could not call WTSEnumerateServersA", 0)
EndIf
CloseLibrary(#WTSAPI)
EndIf
Hi,
I'm calling an DLL and receive a pointer to an array of a structure.
Here is how I do it now, it works, but is it a faster way to do this with out the copy memory function?
/Richard
The Code:
Structure WTS_SERVER_INFO
pServerName.s ; server name
EndStructure
Procedure Test3()
lpBuffer.l
sres.s
Count.l = 0
i.l = 0
p.l
WpInf.WTS_SERVER_INFO
If OpenLibrary(#WTSAPI,"WTSAPI32.DLL")
If CallFunction(#WTSAPI,"WTSEnumerateServersA","VALHALLA",#NULL,1,@lpbuffer,@Count)
p = lpbuffer
For i = 0 To Count -1
CopyMemory(p,WpInf,SizeOf(WTS_SERVER_INFO))
sres = sres + WpInf\pServerName + Chr(10)
p+SizeOf(WTS_SERVER_INFO)
Next
MessageRequester("Test3","Servers: " + Str(Count) + Chr(10) + sres,0)
Else
MessageRequester("Test3","Could not call WTSEnumerateServersA", 0)
EndIf
CloseLibrary(#WTSAPI)
EndIf