P:G:
March 16th, 2001, 05:40
A newbie question..
How can I view in SICE 4.x complex data like "DRAWITEMSTRUCT" or "MEASUREITEMSTRUCT" and so on?
At now I can only inspect simply data like "int" or "BOOL" and the only manner I can view complex data is copying single fields in simple data.
Is there a manner to inspect them directly?
Kayaker
March 16th, 2001, 12:37
Hi,
Both of the data types you mentioned are structures which are used with system defined window messages. One of the parameters of the message is an address pointer to the structure. The structure itself can contain many fields so as far as I know the most direct way to view it in SoftIce is to set a BMSG break on the windows message that uses it.
The DRAWITEMSTRUCT you mentioned for example is defined as:
==================================
The DRAWITEMSTRUCT structure provides information the owner window must have to determine how to paint an owner-drawn control or menu item. The owner window of the owner-drawn control or menu item receives a pointer to this structure as the lParam parameter of the WM_DRAWITEM message.
typedef struct tagDRAWITEMSTRUCT { // dis
UINT CtlType;
UINT CtlID;
UINT itemID;
UINT itemAction;
UINT itemState;
HWND hwndItem;
HDC hDC;
RECT rcItem;
DWORD itemData;
} DRAWITEMSTRUCT;
==================================
and the windows message that uses it is:
==================================
The WM_DRAWITEM message is sent to the owner window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.
WM_DRAWITEM
idCtl = (UINT) wParam; // control identifier
lpdis = (LPDRAWITEMSTRUCT) lParam; // item-drawing information
Parameters
idCtl
Value of wParam. Specifies the identifier of the control that sent the WM_DRAWITEM message. If the message was sent by a menu, this parameter is zero.
lpdis
Value of lParam. Points to a DRAWITEMSTRUCT structure containing information about the item to be drawn and the type of drawing required.
==================================
So you'd need to retrieve the hWnd of the control that uses the WM_DRAWITEM message (with 'HWND' in SI or with a utility such as Winshow/Winfrog) and set a 'BMSG hWnd WM_DRAWITEM' in SI. When the control receives the message SI should break and you can view the address of the DRAWITEMSTRUCT (pointed to by lParam in the above example).
Many API's also use structures directly as one of their parameters (i.e. GetOpenFileName), in which case you can use a bpx rather than a bmsg breakpoint.
Anyway, hope this helps
Kayaker
Powered by vBulletin® Version 4.2.2 Copyright © 2018 vBulletin Solutions, Inc. All rights reserved.