Feature Requests item #1755527, was opened at 2007-07-17 10:33
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551957&aid=1755527&group_id=78018
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: win32
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: ken (kchmbrln)
Assigned to: Nobody/Anonymous (nobody)
Summary: Default to buffer for win32ts.WTSQuerySessionInformation
Initial Comment:
Currently win32ts.WTSQuerySessionInformation raises a PyExc_NotImplementedError exception in those cases where no specific interpretation of the results has been provided. It would be more useful if, instead of an exception, it would return a buffer object with the raw contents of the buffer that the api function returned copied into it. Then the user could use something like struct.unpack_from(fmt, buffer [,offset = 0]) to interpret the results as needed.
Something like (untested):
switch (WTSInfoClass){
...
default:
void *newbuf
ret=PyBuffer_New(bufsize);
ret->ob_type->tp_as_buffer->bf_getwritebuffer(ret, 0, &newbuf);
memcpy(newbuf, buf, bufsize);
}
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551957&aid=1755527&group_id=78018
|