Discussion:
TCITEMA to/from another process - bytes cleared beyond the record.
(too old to reply)
R.Wieser
2019-03-24 09:23:44 UTC
Permalink
Hello all,

On XPsp3 I'm trying to get info of a tab on a SysTabControl32 which is
located in a different process (.CPL configuration dialogs), using the
TCM_GETITEM message (and some virtual memory magic).

The thing is that when I ask for the stored parameter (TCIF_PARAM) (and only
than!) there are four bytes cleared /beyond/ the TCITEMA record (directly
after the parameter field, bytes 0x1C .. 0x1F). The same thing doesn't
happen when I request the same record from within the same process.

Question: Is this something to be expected (maybe related to my use of
virtual memory), or should I consider it a quirk of the targetted control ?

Regards,
Rudy Wieser
R.Wieser
2019-03-24 09:53:26 UTC
Permalink
I forgot to mention that I found out about this clearing when I asked for
the tabs name too (TCIF_TEXT) and added a buffer for it directly after the
TCITEMA structure (writing it to the target process as a single block of
memory) - only to find, on return, the first four bytes of the name erased
(but the rest of it all there).

Which, I now realize, maks it look as if the TCM_GETITEM itself works, but
something after it causes the bytes to be cleared ...

Regards,
Rudy Wieser
R.Wieser
2019-03-24 20:57:50 UTC
Permalink
Don't you hate it when you're only given partial info ? I know I do.
<angry> :-(

It looks like that those extra bytes I mentioned are linked to the
TCM_SETITEMEXTRA method. At least, after some stumbling-in-the-dark not
finding anything on the MS websites or by googeling I found that that
command causes the TCIF_PARAM flag to respond with the set ammount of bytes,
instead of just 4 .

The only thing is, I can't seem to find the 'GET' variant of that method
(which means that I cannot create a buffer of the right size / check if the
returned data will fit a static buffer). Does someone have an idea where
its hidden (if it exists that is) ?

Regards,
Rudy Wieser

Loading...