Changeset 3215


Ignore:
Timestamp:
Mar 24, 2000, 6:12:20 PM (25 years ago)
Author:
cbratschi
Message:

scroll memory leak, GetClipboardFormatNameW fix

Location:
trunk/src/user32
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/user32/clipboard.cpp

    r2804 r3215  
    1 /* $Id: clipboard.cpp,v 1.5 2000-02-16 14:34:06 sandervl Exp $ */
     1/* $Id: clipboard.cpp,v 1.6 2000-03-24 17:12:19 cbratschi Exp $ */
    22
    33/*
     
    1818#include "win32wbase.h"
    1919
    20 #define DBG_LOCALLOG    DBG_clipboard
     20#define DBG_LOCALLOG    DBG_clipboard
    2121#include "dbglocal.h"
    2222
     
    3030    if(!wndRemove) {
    3131        dprintf(("ChangeClipboardChain, window %x not found", hwndRemove));
    32         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     32        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    3333        return 0;
    3434    }
     
    3636    if(!wndNext) {
    3737        dprintf(("ChangeClipboardChain, window %x not found", hwndNext));
    38         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     38        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    3939        return 0;
    4040    }
    4141    dprintf(("USER32:  ChangeClipboardChain\n"));
    42     return O32_ChangeClipboardChain(wndRemove->getOS2FrameWindowHandle(), 
     42    return O32_ChangeClipboardChain(wndRemove->getOS2FrameWindowHandle(),
    4343                                    wndNext->getOS2FrameWindowHandle());
    4444}
     
    8080//******************************************************************************
    8181//******************************************************************************
    82 int WIN32API GetClipboardFormatNameA( UINT arg1, LPSTR arg2, int  arg3)
    83 {
    84     dprintf(("USER32:  GetClipboardFormatNameA %s\n", arg2));
    85     return O32_GetClipboardFormatName(arg1, arg2, arg3);
    86 }
    87 //******************************************************************************
    88 //******************************************************************************
    89 int WIN32API GetClipboardFormatNameW(UINT arg1, LPWSTR arg2, int arg3)
    90 {
    91  int   rc;
    92  char *astring = UnicodeToAsciiString(arg2);
    93 
    94     dprintf(("USER32:  GetClipboardFormatNameW %s\n", astring));
    95     rc = O32_GetClipboardFormatName(arg1, astring, arg3);
    96     FreeAsciiString(astring);
    97     return(rc);
     82int WIN32API GetClipboardFormatNameA(UINT format,LPSTR lpszFormatName,int cchMaxCount)
     83{
     84  dprintf(("USER32:  GetClipboardFormatNameA %d\n",format));
     85  return O32_GetClipboardFormatName(format,lpszFormatName,cchMaxCount);
     86}
     87//******************************************************************************
     88//******************************************************************************
     89int WIN32API GetClipboardFormatNameW(UINT format,LPWSTR lpszFormatName,int cchMaxCount)
     90{
     91  int   rc;
     92  char *astring = (CHAR*)malloc(cchMaxCount);
     93
     94  dprintf(("USER32:  GetClipboardFormatNameW %d\n",format));
     95  rc = O32_GetClipboardFormatName(format,astring,cchMaxCount);
     96  if (rc) AsciiToUnicode(astring,lpszFormatName);
     97  free(astring);
     98  return(rc);
    9899}
    99100//******************************************************************************
     
    109110    window = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwndOwner);
    110111    if(!window) {
    111         //an OS/2 window probably owns the clipboard, we pretend nobody owns it
    112         return NULL;
     112        //an OS/2 window probably owns the clipboard, we pretend nobody owns it
     113        return NULL;
    113114    }
    114115    return window->getWindowHandle();
     
    126127    window = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwndViewer);
    127128    if(!window) {
    128         //probably an OS/2 window, we pretend it's nobody
    129         return NULL;
     129        //probably an OS/2 window, we pretend it's nobody
     130        return NULL;
    130131    }
    131132    return window->getWindowHandle();
     
    143144    window = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwnd);
    144145    if(!window) {
    145         //probably an OS/2 window, we pretend it's nobody
    146         return NULL;
     146        //probably an OS/2 window, we pretend it's nobody
     147        return NULL;
    147148    }
    148149    return window->getWindowHandle();
     
    171172    if(!window) {
    172173        dprintf(("OpenClipboard, window %x not found", hwnd));
    173         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     174        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    174175        return 0;
    175176    }
     
    214215    if(!wndnew) {
    215216        dprintf(("OpenClipboard, window %x not found", hwndNew));
    216         SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     217        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    217218        return 0;
    218219    }
     
    222223    wndold = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwndOld);
    223224    if(!wndold) {
    224         //probably an OS/2 window, so pretend it's nobody
     225        //probably an OS/2 window, so pretend it's nobody
    225226        return 0;
    226227    }
  • TabularUnified trunk/src/user32/scroll.cpp

    r2834 r3215  
    1 /* $Id: scroll.cpp,v 1.35 2000-02-20 18:28:33 cbratschi Exp $ */
     1/* $Id: scroll.cpp,v 1.36 2000-03-24 17:12:20 cbratschi Exp $ */
    22/*
    33 * Scrollbar control
     
    689689}
    690690
     691static LRESULT SCROLL_Destroy(HWND hwnd,WPARAM wParam,LPARAM lParam)
     692{
     693  SCROLLBAR_INFO* infoPtr = (SCROLLBAR_INFO*)GetInfoPtr(hwnd);
     694
     695  free(infoPtr);
     696
     697  return 0;
     698}
     699
    691700/***********************************************************************
    692701 *           SCROLL_HandleScrollEvent
     
    11051114      return SCROLL_Create(hwnd,wParam,lParam);
    11061115
     1116    case WM_DESTROY:
     1117      return SCROLL_Destroy(hwnd,wParam,lParam);
     1118
    11071119    case WM_LBUTTONDOWN:
    11081120    case WM_LBUTTONUP:
     
    14801492    if (!win32wnd) return FALSE;
    14811493
     1494    //CB: does Win32 send a WM_STYLECHANGED message?
    14821495    switch(nBar)
    14831496    {
    1484      case SB_CTL:
     1497      case SB_CTL:
    14851498       ShowWindow(hwnd,fShow ? SW_SHOW:SW_HIDE);
    14861499       return TRUE;
Note: See TracChangeset for help on using the changeset viewer.