Hi, Larry. This function is a little strange. You pass a pointer to a buffer and the function puts the pointer inside the buffer. The microsoft-provided VB example uses a function called copymemory string to get the data.
The MSDN page uses this description which confused me at first """ BOOL WTSQueryUserConfig( LPTSTR pServerName, LPTSTR pUserName, WTS_CONFIG_CLASS WTSConfigClass, LPTSTR* ppBuffer, DWORD* pBytesReturned ); ... ppBuffer [out] Pointer to a variable that receives a pointer to the requested information. The format and contents of the data depend on the information class specified in the WTSConfigClass parameter. To free the returned buffer, call the WTSFreeMemory function. """ which means that my buffer end up _containing_ the pointer. I imagine I'm going to have to write a simple module that can get string by address. -Mark On Tue, Aug 27, 2002 at 02:23:20PM -0500, Larry Bates wrote: > Mark, > > Normally when the objects work with pointers you pass > pointers to them and they fill in the information and > you access the information when you get back from the > function. I use Sam Rushing's membuf and cstring > functions (part of dynwin module) to define and work > with these types of objects. Sometimes you also need > to use struct module also. Hope this information > helps. > > Larry Bates > Syscon, Inc. > > [EMAIL PROTECTED] > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of > [EMAIL PROTECTED] > Sent: Tuesday, August 27, 2002 2:03 PM > To: [EMAIL PROTECTED] > Subject: ActivePython digest, Vol 1 #424 - 2 msgs > > > Send ActivePython mailing list submissions to > [EMAIL PROTECTED] > > To subscribe or unsubscribe via the World Wide Web, visit > http://listserv.ActiveState.com/mailman/listinfo/activepython > or, via email, send a message with subject or body 'help' to > [EMAIL PROTECTED] > > You can reach the person managing the list at > [EMAIL PROTECTED] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of ActivePython digest..." > > > Today's Topics: > > 1. RE: FW: swig help with wtsapi32 (Roach, Mark R.) > 2. Create a python string from a pointer to a string? (Roach, Mark R.) > > --__--__-- > > Message: 1 > Subject: RE: FW: swig help with wtsapi32 > From: "Roach, Mark R." <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Date: 27 Aug 2002 12:25:09 -0500 > > It would be nice if this library was usable through COM, I actually have > a third party COM object I have been using but it only supports a subset > of the api. According to MSDN I will have to wait till the ominous ".NET > Server" before I can use ADSI to access the terminal server specific > portions of user configuration. > > This struct stuff is very low level and nasty but it at least seems > workable, probably more so (for me) than futzing with C headers. Thanks > everyone, for you efforts. Now I get to go dig through MSDN(blech) and > struct conversion stuff(also blech). > > -Mark > > On Tue, 2002-08-27 at 12:20, [EMAIL PROTECTED] wrote: > > Hi Mark > > > > I dont know the calldll module, neither, but one way to call the > > wtsapi32.dll is from Visual Basic. > > There are a couple of articles on the MSDN library how to do that,e.g > > Q292631 "HOWTO: Call WTSSetUserConfig() and WTSQueryUserConfig() from > > Visual Basic" > > Q253140 "HOWTO: Use WTSEnumerateProcesses from Visual Basic" > > > > So what is the reason to use SWIG? > > Maybe it is also possible with Python COM, but when passing structs from > > a different language to a DLL you have to take care on memory layout and > > data type representations. > > > > Maybe it is possible to strip down the Header you initially mentionned > > so it compiles with SWIG? > > From the tests we did with SWIG one year ago I know there are a couple > > of things that SWIG does not support > > but sometimes it is possible to throw out all unneeded stuff and get it > > compilable. > > > > Peter > > > > > -----Original Message----- > > > From: Roach, Mark R. [ mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > ] > > > Sent: Tuesday, August 27, 2002 5:38 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: FW: swig help with wtsapi32 > > > > > > > > > That looks very cool. I actually tried using LoadLibrary and > > > GetProcAddress manually with little success. If I can just figure out > > > how to get constants and structs out of the dll this will work > > > beautifully. (Anyone know how to do that? If not, I'll just > > > have to keep > > > poking at it) Thanks very much! > > > > > > -Mark > > > > > > > > --__--__-- > > Message: 2 > Subject: Create a python string from a pointer to a string? > From: "Roach, Mark R." <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Date: 27 Aug 2002 13:24:29 -0500 > > Hi again everyone. It appears that a function that I am calling in > windows (wtsapi32.WTSQueryUserConfiguration) returns a _pointer_ to a > string rather than the string itself. Does anyone know if there is a > way, given the pointer, to access the string at that address? > > Thanks, > > Mark Roach > > > --__--__-- > > _______________________________________________ > ActivePython mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > > > End of ActivePython Digest > > > _______________________________________________ > ActivePython mailing list > [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython _______________________________________________ ActivePython mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython