https://bugzilla.novell.com/show_bug.cgi?id=244613 ------- Comment #20 from mfabian@novell.com 2007-02-16 09:14 MST ------- This patch uses the necessary hunk from Takashi's patch and one extra hunk. The extra hunk is needed because XGetWindowProperty returns only half the number of bytes in “bytes_after_return” which are really needed to store the “prop_return” array. man XGetWindowProperty: man> SYNTAX man> int XGetWindowProperty(Display *display, Window w, Atom property, long man> long_offset, long long_length, Bool delete, Atom req_type, Atom man> *actual_type_return, int *actual_format_return, unsigned long man> *nitems_return, unsigned long *bytes_after_return, unsigned char man> **prop_return); man> man> [...] man> man> prop_return man> Returns the data in the specified format. If the returned format man> is 8, the returned data is represented as a char array. If the man> returned format is 16, the returned data is represented as a man> array of short int type and should be cast to that type to obtain man> the elements. If the returned format is 32, the property data man> will be stored as an array of longs (which in a 64-bit applica- man> tion will be 64-bit values that are padded in the upper 4 bytes). man> [...] For example, if the “prop_return” array contains 6 32 bit values, it has a length of 48 bytes total. man> man> o If the specified property exists and either you assign AnyPropertyType man> to the req_type argument or the specified type matches the actual man> property type, XGetWindowProperty returns the actual property type to man> actual_type_return and the actual property format (never zero) to man> actual_format_return. It also returns a value to bytes_after_return man> and nitems_return, by defining the following values: man> man> N = actual length of the stored property in bytes man> (even if the format is 16 or 32) man> I = 4 * long_offset man> T = N - I man> L = MINIMUM(T, 4 * long_length) man> A = N - (I + L) man> man> The returned value starts at byte index I in the property (indexing man> from zero), and its length in bytes is L. If the value for long_off- man> set causes L to be negative, a BadValue error results. The value of man> bytes_after_return is A, giving the number of trailing unread bytes in man> the stored property. Nevertheless “bytes_after_return” returns “24” instead of “48” for the example of 6 32 bit values, i.e. one needs to allocate twice as much space for the “prop_return” array on 64 bit platforms. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.