Return value GetStockObject

Vincent Béron vberon at mecano.gme.usherb.ca
Wed Aug 28 11:36:03 CDT 2002


Le mer 28/08/2002 à 11:10, Fabian Cenedese a écrit :
> Hi again
> 
> In my app I try to get a handle to a system font with following call:
> HGDIOBJ hobj=GetStockObject(ANSI_FIXED_FONT);
> If the call succeeds it should return a handle to the requested object,
> otherwise zero. In Windows I get something like 0x018A000E (looks ok),
> but in Wine I get 0x0000009E. Even not zero I can't imagine that this is
> a valid handle (address). ANSI_FIXED_FONT is never really used in Wine,
> only SYSTEM_FONT.
> Is this an error or am I barking up the wrong tree?

In Wine, handles are not (yet) all void * (see bug #90). Even then, it
doesn't mean a handle is a valid heap address; I know there are a couple
places in Wine where they are used as an index in an array locating all
objects of a kind. It doesn't exactly follow the Windows convention, but
I think handles are supposed to be passed back to APIs, not handled
(dereferenced) directly by apps.

So 0x0000009E doesn't strike me as bad. If you use it in calls to font
APIs, does it work correctly?

Vincent




More information about the wine-devel mailing list