Feature Requests item #1755527, was opened at 2007-07-18 01:33
Message generated for change (Comment added) made by mhammond
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);
}
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2007-07-18 07:46
Message:
Logged In: YES
user_id=14198
Originator: NO
If we do that, it would prevent us upgrading the code in the future (as it
would then break code which assumed the buffer). An alternative might be
an extra param to indicate if a buffer is wanted or not, which would then
be used in all cases.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551957&aid=1755527&group_id=78018
|