Presumed bug found in SCROLL_GetPtrScrollInfo

giorgian giorgian at icube.it
Tue Sep 4 04:46:59 CDT 2001


Hi all.
We have a win32 application linked to Far Point's Spread32 library;
the application crashes when referencing a NULL pointer returned by 
GlobalLock,
but obviously it runs perfectly under win98SE (see previous post about 
GetWindowLongA) .

The behaviour of SCROLL_GetPtrScrollInfo, with nBar parameter = SB_CTL,
is to return wndPtr->wExtra as it were a pointer.
Actually we found that, in this case, the application stores in 
wndPtr->wExtra[0] a handle;
so, tricking with wine's code, we obtained the pointer from the handle 
(using GlobalLock),
making the app working (almost) correctly.
Before releasing a patch, we would like to hear some suggestion about it
(I mean: the current code isn't correct, but will all of others apps work
correctly after our fix?)

Our version of SCROLL_GetPtrScrollInfo looks like this:

[ controls/scroll.c ]:

   126  
/***********************************************************************
   127   *           SCROLL_GetPtrScrollInfo
   128   */
   129  static SCROLLBAR_INFO *SCROLL_GetPtrScrollInfo( WND* wndPtr, INT 
nBar )
   130  {
   131      SCROLLBAR_INFO *infoPtr;
   132      HGLOBAL hmem;

   133      if (!wndPtr) return NULL;
   134      switch(nBar)
   135      {
   136          case SB_HORZ: infoPtr = (SCROLLBAR_INFO 
*)wndPtr->pHScroll; break;
   137          case SB_VERT: infoPtr = (SCROLLBAR_INFO 
*)wndPtr->pVScroll; break;
   138          /*  -- OLD VERSION -- case SB_CTL:  infoPtr = 
(SCROLLBAR_INFO *)wndPtr->wExtra; break; */
   139          case SB_CTL:
   140            hmem = (HGLOBAL) wndPtr->wExtra[0];
   141            infoPtr = GlobalLock(hmem);
   142            GlobalUnlock(hmem);
   143            break;

Any help would be appreciated.
Thx





More information about the wine-users mailing list