Changeset 9140 for trunk/src


Ignore:
Timestamp:
Aug 27, 2002, 10:31:48 AM (23 years ago)
Author:
sandervl
Message:

wine resync; fixed 16 bits handle bugs

Location:
trunk/src/msvfw32
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/msvfw32/LICENSE.TXT

    r6379 r9140  
    1 $Id: LICENSE.TXT,v 1.1 2001-07-21 08:57:44 sandervl Exp $
    2 @c This is an additional Odin license agreement.
    3 @c It supercedes the main Odin license, but is only valid in
    4 @c the source directory in which it is present.
     1$Id: LICENSE.TXT,v 1.2 2002-08-27 08:31:47 sandervl Exp $
     2This is an additional Odin license agreement.
     3It supercedes the main Odin license, but is only valid in
     4the source directory in which it is present.
    55
    6 @c This file is processed by GNU's TeXinfo
    7 @c If you modify it or move it to another location, make sure that
    8 @c TeXinfo works (type `make' in directory documentation).
    9 
    10 Copyright (c) 1993-2000 the Wine project authors (see the file AUTHORS
     6Copyright (c) 1993-2002 the Wine project authors (see the file AUTHORS
    117for a complete list)
    128
    13 Permission is hereby granted, free of charge, to any person obtaining a copy
    14 of this software and associated documentation files (the "Software"), to deal
    15 in the Software without restriction, including without limitation the rights
    16 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    17 copies of the Software, and to permit persons to whom the Software is
    18 furnished to do so, subject to the following conditions:
     9Wine is free software; you can redistribute it and/or modify it under
     10the terms of the GNU Lesser General Public License as published by the
     11Free Software Foundation; either version 2.1 of the License, or (at
     12your option) any later version.
    1913
    20 The above copyright notice and this permission notice shall be included in
    21 all copies or substantial portions of the Software.
     14This program is distributed in the hope that it will be useful, but
     15WITHOUT ANY WARRANTY; without even the implied warranty of
     16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     17Lesser General Public License for more details.
    2218
    23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    24 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    25 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
    26 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
    27 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    28 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
     19A copy of the GNU Lesser General Public License is included in the
     20Wine distribution in the file COPYING.LIB. If you did not receive this
     21copy, write to the Free Software Foundation, Inc., 59 Temple Place,
     22Suite 330, Boston, MA 02111-1307 USA.
  • trunk/src/msvfw32/drawdib.c

    r7511 r9140  
    1 /* 
     1/*
    22 * Copyright 2000 Bradley Baetz
    33 *
    4  * Fixme: Some flags are ignored
     4 * This library is free software; you can redistribute it and/or
     5 * modify it under the terms of the GNU Lesser General Public
     6 * License as published by the Free Software Foundation; either
     7 * version 2.1 of the License, or (at your option) any later version.
     8 *
     9 * This library is distributed in the hope that it will be useful,
     10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12 * Lesser General Public License for more details.
     13 *
     14 * You should have received a copy of the GNU Lesser General Public
     15 * License along with this library; if not, write to the Free Software
     16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     17 *
     18 * FIXME: Some flags are ignored
    519 *
    620 * Handle palettes
     
    1327#include "winuser.h"
    1428#include "wine/winbase16.h"
    15 #include "debugtools.h"
     29#include "wine/debug.h"
    1630#include "vfw.h"
    1731#include "vfw16.h"
    1832#include "windef.h"
    1933
    20 DEFAULT_DEBUG_CHANNEL(msvideo);
     34WINE_DEFAULT_DEBUG_CHANNEL(msvideo);
    2135
    2236typedef struct {
     
    3751} WINE_HDD;
    3852
    39 #ifdef __WIN32OS2__
    40 #include <heapstring.h>
    41 
    42 #define GlobalAlloc16 GlobalAlloc
    43 #define GlobalLock16 GlobalLock
    44 #define GlobalUnlock16 GlobalUnlock
    45 #define GlobalFree16 GlobalFree
    46 
    47 #endif
     53int num_colours(LPBITMAPINFOHEADER lpbi)
     54{
     55        if(lpbi->biClrUsed)
     56                return lpbi->biClrUsed;
     57        if(lpbi->biBitCount<=8)
     58                return 1<<lpbi->biBitCount;
     59        return 0;
     60}
    4861
    4962/***********************************************************************
     
    6073
    6174/***********************************************************************
    62  *              DrawDibOpen             [MSVIDEO.102]
    63  */
    64 HDRAWDIB16 VFWAPI DrawDibOpen16(void) {
    65         return (HDRAWDIB16)DrawDibOpen();
    66 }
    67 
    68 /***********************************************************************
    6975 *              DrawDibClose            [MSVFW32.@]
    7076 */
     
    8389        GlobalFree16(hdd);
    8490        return TRUE;
    85 }
    86 
    87 /***********************************************************************
    88  *              DrawDibClose            [MSVIDEO.103]
    89  */
    90 BOOL16 VFWAPI DrawDibClose16(HDRAWDIB16 hdd) {
    91         return DrawDibClose(hdd);
    9291}
    9392
     
    9897        BOOL ret = TRUE;
    9998        WINE_HDD *whdd = GlobalLock16(hdd);
    100        
     99
    101100        TRACE("(0x%08lx)\n",(DWORD)hdd);
    102101
     
    124123        if (whdd->hDib)
    125124                DeleteObject(whdd->hDib);
    126        
     125
    127126        if (whdd->hic) {
    128127                ICDecompressEnd(whdd->hic);
     
    134133        GlobalUnlock16(hdd);
    135134        return ret;
    136 }
    137 
    138 /***********************************************************************
    139  *              DrawDibEnd              [MSVIDEO.105]
    140  */
    141 BOOL16 VFWAPI DrawDibEnd16(HDRAWDIB16 hdd) {
    142         return DrawDibEnd(hdd);
    143135}
    144136
     
    161153        );
    162154        TRACE("lpbi: %ld,%ld/%ld,%d,%d,%ld,%ld,%ld,%ld,%ld,%ld\n",
    163                   lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes, 
    164                   lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage, 
    165                   lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed, 
     155                  lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes,
     156                  lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage,
     157                  lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed,
    166158                  lpbi->biClrImportant);
    167159
     
    212204                /* No compression */
    213205                TRACE("Not compressed!\n");
    214                 dwSize = lpbi->biSize + lpbi->biClrUsed*sizeof(RGBQUAD);
     206                dwSize = lpbi->biSize + num_colours(lpbi)*sizeof(RGBQUAD);
    215207                whdd->lpbiOut = HeapAlloc(GetProcessHeap(),0,dwSize);
    216208                memcpy(whdd->lpbiOut,lpbi,dwSize);
     
    219211        if (ret) {
    220212                /*whdd->lpvbuf = HeapAlloc(GetProcessHeap(),0,whdd->lpbiOut->biSizeImage);*/
    221                
     213
    222214                whdd->hMemDC = CreateCompatibleDC(hdc);
    223215                TRACE("Creating: %ld,%p\n",whdd->lpbiOut->biSize,whdd->lpvbits);
     
    254246}
    255247
    256 /************************************************************************
    257  *              DrawDibBegin            [MSVIDEO.104]
    258  */
    259 BOOL16 VFWAPI DrawDibBegin16(HDRAWDIB16 hdd,
    260                                                    HDC16      hdc,
    261                                                    INT16      dxDst,
    262                                                    INT16      dyDst,
    263                                                    LPBITMAPINFOHEADER lpbi,
    264                                                    INT16      dxSrc,
    265                                                    INT16      dySrc,
    266                                                    UINT16     wFlags) {
    267         return DrawDibBegin(hdd,hdc,dxDst,dyDst,lpbi,dxSrc,dySrc,wFlags);
    268 }
    269 
    270248/**********************************************************************
    271249 *              DrawDibDraw             [MSVFW32.@]
     
    285263        );
    286264
    287         if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | 
     265        if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME |
    288266                                   DDF_UPDATE | DDF_DONTDRAW))
    289267                FIXME("wFlags == 0x%08lx not handled\n",(DWORD)wFlags);
     
    291269        if (!lpBits) {
    292270                /* Undocumented? */
    293                 lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)(lpbi->biClrUsed*sizeof(RGBQUAD));
     271                lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)(num_colours(lpbi)*sizeof(RGBQUAD));
    294272        }
    295273
     
    318296                if (lpbi->biCompression) {
    319297                    DWORD flags = 0;
    320                
     298
    321299                        TRACE("Compression == 0x%08lx\n",lpbi->biCompression);
    322                
     300
    323301                        if (wFlags & DDF_NOTKEYFRAME)
    324302                            flags |= ICDECOMPRESS_NOTKEYFRAME;
    325                
     303
    326304                        ICDecompress(whdd->hic,flags,lpbi,lpBits,whdd->lpbiOut,whdd->lpvbits);
    327305                } else {
    328306                    memcpy(whdd->lpvbits,lpBits,lpbi->biSizeImage);
    329                 }       
     307                }
    330308        }
    331309        if (!(wFlags & DDF_DONTDRAW) && whdd->hpal)
     
    337315        GlobalUnlock16(hdd);
    338316        return ret;
    339 }
    340 
    341 /**********************************************************************
    342  *              DrawDibDraw             [MSVIDEO.106]
    343  */
    344 BOOL16 VFWAPI DrawDibDraw16(HDRAWDIB16 hdd,             
    345                                                   HDC16 hdc,
    346                                                   INT16 xDst,
    347                                                   INT16 yDst,
    348                                                   INT16 dxDst,
    349                                                   INT16 dyDst,
    350                                                   LPBITMAPINFOHEADER lpbi,
    351                                                   LPVOID lpBits,
    352                                                   INT16 xSrc,
    353                                                   INT16 ySrc,
    354                                                   INT16 dxSrc,
    355                                                   INT16 dySrc,
    356                                                   UINT16 wFlags) {
    357         return DrawDibDraw(hdd,hdc,xDst,yDst,dxDst,dyDst,lpbi,lpBits,xSrc,ySrc,dxSrc,dySrc,wFlags);
    358317}
    359318
     
    367326
    368327/*************************************************************************
    369  *              DrawDibStart            [MSVIDEO.118]
    370  */
    371 BOOL16 VFWAPI DrawDibStart16(HDRAWDIB16 hdd, DWORD rate) {
    372         return DrawDibStart(hdd,rate);
    373 }
    374 
    375 /*************************************************************************
    376328 *              DrawDibStop             [MSVFW32.@]
    377329 */
     
    381333}
    382334
    383 /*************************************************************************
    384  *              DrawDibStop             [MSVIDEO.119]
    385  */
    386 BOOL16 DrawDibStop16(HDRAWDIB16 hdd) {
    387         return DrawDibStop(hdd);
    388 }
    389 
    390335/***********************************************************************
    391336 *              DrawDibSetPalette       [MSVFW32.@]
     
    398343        whdd = GlobalLock16(hdd);
    399344        whdd->hpal = hpal;
    400        
     345
    401346        if (whdd->begun) {
    402347                SelectPalette(whdd->hdc,hpal,0);
     
    408353
    409354/***********************************************************************
    410  *              DrawDibSetPalette       [MSVIDEO.110]
    411  */
    412 BOOL16 VFWAPI DrawDibSetPalette16(HDRAWDIB16 hdd, HPALETTE16 hpal) {
    413         return DrawDibSetPalette(hdd,hpal);
    414 }
    415 
    416 /***********************************************************************
    417355 *              DrawDibGetPalette       [MSVFW32.@]
    418356 */
     
    430368
    431369/***********************************************************************
    432  *              DrawDibGetPalette       [MSVIDEO.108]
    433  */
    434 HPALETTE16 VFWAPI DrawDibGetPalette16(HDRAWDIB16 hdd) {
    435         return (HPALETTE16)DrawDibGetPalette(hdd);
    436 }
    437 
    438 /***********************************************************************
    439370 *              DrawDibRealize          [MSVFW32.@]
    440371 */
     
    445376
    446377        FIXME("(%d,0x%08lx,%d), stub\n",hdd,(DWORD)hdc,fBackground);
    447        
     378
    448379        whdd = GlobalLock16(hdd);
    449380
     
    452383                goto out;
    453384        }
    454        
     385
    455386        if (!whdd->hpal)
    456387                whdd->hpal = CreateHalftonePalette(hdc);
     
    458389        oldPal = SelectPalette(hdc,whdd->hpal,fBackground);
    459390        ret = RealizePalette(hdc);
    460        
     391
    461392 out:
    462393        GlobalUnlock16(hdd);
     
    465396        return ret;
    466397}
    467 
    468 /***********************************************************************
    469  *              DrawDibRealize          [MSVIDEO.112]
    470  */
    471 UINT16 VFWAPI DrawDibRealize16(HDRAWDIB16 hdd, HDC16 hdc, BOOL16 fBackground) {
    472         return (UINT16)DrawDibRealize(hdd,hdc,fBackground);
    473 }
  • trunk/src/msvfw32/makefile

    r6386 r9140  
    1 # $Id: makefile,v 1.12 2001-07-21 17:39:44 sandervl Exp $
     1# $Id: makefile,v 1.13 2002-08-27 08:31:48 sandervl Exp $
    22
    33#
     
    2121$(OBJDIR)\drawdib.obj \
    2222$(OBJDIR)\msvideo_main.obj \
     23$(OBJDIR)\mciwnd.obj \
    2324$(OBJDIR)\msvfw32rsrc.obj \
    2425$(DLLENTRY)
     
    3132$(ODIN32_LIB)/kernel32.lib \
    3233$(ODIN32_LIB)/user32.lib \
     34$(ODIN32_LIB)/comctl32.lib \
    3335$(ODIN32_LIB)/version.lib \
    3436$(ODIN32_LIB)/gdi32.lib \
  • trunk/src/msvfw32/msvfw32.cpp

    r6386 r9140  
    1 /* $Id: msvfw32.cpp,v 1.8 2001-07-21 17:39:44 sandervl Exp $ */
     1/* $Id: msvfw32.cpp,v 1.9 2002-08-27 08:31:48 sandervl Exp $ */
    22/*
    33 * Copyright 1998 Marcus Meissner
     
    160160
    161161/****************************************************************************
    162  *    ICImageCompress     [MSVFW.31]
    163  */
    164 HANDLE VFWAPI ICImageCompress(
    165         HIC                 hic,        // compressor to use
    166         UINT                uiFlags,    // flags (none yet)
    167         LPBITMAPINFO      lpbiIn,     // format to compress from
    168         LPVOID              lpBits,     // data to compress
    169         LPBITMAPINFO        lpbiOut,    // compress to this (NULL ==> default)
    170         LONG                lQuality,   // quality to use
    171         LONG  *             plSize)     // compress to this size (0=whatever)
    172 {
    173 #ifdef DEBUG
    174     dprintf(("MSVFW32: ICImageCompress not implemented\n"));
    175 #endif
    176   return 0;
    177 }
    178 
    179 
    180 /****************************************************************************
    181  *    ICImageDecompress   [MSVFW.32]
    182  */
    183 HANDLE VFWAPI ICImageDecompress(
    184         HIC                 hic,        // compressor to use
    185         UINT                uiFlags,    // flags (none yet)
    186         LPBITMAPINFO        lpbiIn,     // format to decompress from
    187         LPVOID              lpBits,     // data to decompress
    188         LPBITMAPINFO        lpbiOut)    // decompress to this (NULL ==> default)
    189 {
    190 #ifdef DEBUG
    191     dprintf(("MSVFW32: ICImageDecompress not implemented\n"));
    192 #endif
    193   return 0;
    194 }
    195 
    196 
    197 /****************************************************************************
    198162 *    ICInstall     [MSVFW.34]
    199163 */
  • trunk/src/msvfw32/msvideo_main.c

    r7511 r9140  
    11/*
    22 * Copyright 1998 Marcus Meissner
    3  * Copyright 2000 Bradley Baetz
     3 * Copyright 2000 Bradley Baetz
     4 *
     5 * This library is free software; you can redistribute it and/or
     6 * modify it under the terms of the GNU Lesser General Public
     7 * License as published by the Free Software Foundation; either
     8 * version 2.1 of the License, or (at your option) any later version.
     9 *
     10 * This library is distributed in the hope that it will be useful,
     11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13 * Lesser General Public License for more details.
     14 *
     15 * You should have received a copy of the GNU Lesser General Public
     16 * License along with this library; if not, write to the Free Software
     17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    418 *
    519 * FIXME: This all assumes 32 bit codecs
     
    2034#include "vfw16.h"
    2135#include "wine/winbase16.h"
    22 #include "debugtools.h"
    23 #include "heap.h"
     36#include "wine/debug.h"
    2437#include "stackframe.h"
    2538
    26 DEFAULT_DEBUG_CHANNEL(msvideo);
     39WINE_DEFAULT_DEBUG_CHANNEL(msvideo);
    2740
    2841#ifdef __WIN32OS2__
    29 #include <heapstring.h>
    30 
    31 #define GlobalAlloc16 GlobalAlloc
    32 #define GlobalLock16 GlobalLock
    33 #define GlobalUnlock16 GlobalUnlock
    34 #define GlobalFree16 GlobalFree
    35 #undef SEGPTR_NEW
    36 #define SEGPTR_NEW(a)   malloc(sizeof(a))
    37 #define SEGPTR_FREE(a)  free(a)
    38 #define SEGPTR_GET(a)   a
    39 
    40 #endif
    41 
     42#define MSVIDEO_CallTo16_long_lwwll(a,b,c,d,e,f) 0
     43#else
    4244/* ### start build ### */
    4345extern LONG CALLBACK MSVIDEO_CallTo16_long_lwwll(FARPROC16,LONG,WORD,WORD,LONG,LONG);
    4446/* ### stop build ### */
     47#endif
    4548
    4649LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2);
    4750void MSVIDEO_UnmapMsg16To32(UINT msg, LPVOID lpv, LPDWORD lParam1, LPDWORD lParam2);
    4851LRESULT MSVIDEO_SendMessage(HIC hic, UINT msg, DWORD lParam1, DWORD lParam2, BOOL bFrom32);
     52
     53#define HDRVR_16(h32)           (LOWORD(h32))
     54
    4955
    5056/***********************************************************************
     
    162168        return FALSE;
    163169}
    164 #ifndef __WIN32OS2__
     170
    165171/***********************************************************************
    166172 *              ICInfo                          [MSVIDEO.200]
     
    182188
    183189        MSVIDEO_UnmapMsg16To32(ICM_GETINFO,lpv,&lParam,&size);
    184        
     190
    185191        return ret;
    186192}
    187 #endif
     193
    188194/***********************************************************************
    189195 *              ICOpen                          [MSVFW32.@]
     
    203209        sprintf(codecname,"%s.%s",type,handler);
    204210
    205         /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the 
     211        /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
    206212         * same layout as ICOPEN
    207213         */
     
    239245        char    type[5],handler[5],codecname[20];
    240246        HIC16   hic;
    241         ICOPEN*  icopen = SEGPTR_NEW(ICOPEN);
     247        ICOPEN icopen;
     248        SEGPTR seg_icopen;
    242249        WINE_HIC        *whic;
    243250
     
    245252        memcpy(handler,&fccHandler,4);handler[4]=0;
    246253        TRACE("(%s,%s,%d,%p,%d)\n",type,handler,wMode,lpfnHandler,bFrom32?32:16);
    247        
    248         icopen->fccType         = fccType;
    249         icopen->fccHandler      = fccHandler;
    250         icopen->dwSize          = sizeof(ICOPEN);
    251         icopen->dwFlags         = wMode;
    252        
    253         sprintf(codecname,"%s.%s",type,handler);
     254
     255        icopen.fccType    = fccType;
     256        icopen.fccHandler = fccHandler;
     257        icopen.dwSize     = sizeof(ICOPEN);
     258        icopen.dwFlags    = wMode;
     259
     260        sprintf(codecname,"%s.%s",type,handler);
    254261
    255262        hic = GlobalAlloc16(GHND,sizeof(WINE_HIC));
     
    258265        whic = GlobalLock16(hic);
    259266        whic->driverproc = lpfnHandler;
    260        
     267
    261268#ifdef __WIN32OS2__
    262269        whic->privatevfw        = bFrom32;
     
    264271        whic->private = bFrom32;
    265272#endif
    266        
    267273        /* Now try opening/loading the driver. Taken from DRIVER_AddToList */
    268274        /* What if the function is used more than once? */
    269        
     275
    270276        if (MSVIDEO_SendMessage(hic,DRV_LOAD,0L,0L,bFrom32) != DRV_SUCCESS) {
    271277                WARN("DRV_LOAD failed for hic 0x%08lx\n",(DWORD)hic);
     
    276282        MSVIDEO_SendMessage(hic,DRV_ENABLE,0L,0L,bFrom32);
    277283
    278         whic->hdrv = MSVIDEO_SendMessage(hic,DRV_OPEN,0,(LPARAM)(SEGPTR_GET(icopen)),FALSE);
     284        seg_icopen = MapLS( &icopen );
     285        whic->hdrv = (HDRVR)MSVIDEO_SendMessage(hic,DRV_OPEN,0,seg_icopen,FALSE);
     286        UnMapLS( seg_icopen );
    279287        if (whic->hdrv == 0) {
    280288                WARN("DRV_OPEN failed for hic 0x%08lx\n",(DWORD)hic);
     
    295303}
    296304
    297 #ifndef __WIN32OS2__
    298 /***********************************************************************
    299  *              ICOpen                          [MSVIDEO.203]
    300  */
    301 HIC16 VFWAPI ICOpen16(DWORD fccType, DWORD fccHandler, UINT16 wMode) {
    302         return (HIC16)ICOpen(fccType, fccHandler, wMode);
    303 }
    304 
    305305/***********************************************************************
    306306 *              ICOpenFunction                  [MSVIDEO.206]
     
    310310        return MSVIDEO_OpenFunc(fccType, fccHandler, wMode, (FARPROC)lpfnHandler,FALSE);
    311311}
    312 #endif
    313312
    314313/***********************************************************************
     
    323322        return ret;
    324323}
    325 
    326 #ifndef __WIN32OS2__
    327 /***********************************************************************
    328  *              ICGetInfo                       [MSVIDEO.212]
    329  */
    330 LRESULT VFWAPI ICGetInfo16(HIC16 hic, ICINFO16 *picinfo,DWORD cb) {
    331         LRESULT         ret;
    332 
    333         TRACE("(0x%08lx,%p,%ld)\n",(DWORD)hic,picinfo,cb);
    334         ret = ICSendMessage16(hic,ICM_GETINFO,(DWORD)picinfo,cb);
    335         TRACE(" -> 0x%08lx\n",ret);
    336         return ret;
    337 }
    338 #endif
    339324
    340325/***********************************************************************
     
    357342        switch (wMode) {
    358343        case ICMODE_FASTCOMPRESS:
    359         case ICMODE_COMPRESS: 
     344        case ICMODE_COMPRESS:
    360345                querymsg = ICM_COMPRESS_QUERY;
    361346                break;
     
    385370        /* Now try each driver in turn. 32 bit codecs only. */
    386371        /* FIXME: Move this to an init routine? */
    387        
     372
    388373        pszBuffer = (LPSTR)HeapAlloc(GetProcessHeap(),0,1024);
    389374        if (GetPrivateProfileSectionA("drivers32",pszBuffer,1024,"system.ini")) {
     
    408393        }
    409394        HeapFree(GetProcessHeap(),0,pszBuffer);
    410        
     395
    411396        if (fccType==streamtypeVIDEO) {
    412397                hic = ICLocate(ICTYPE_VIDEO,fccHandler,lpbiIn,lpbiOut,wMode);
     
    420405}
    421406
    422 #ifndef __WIN32OS2__
    423 /***********************************************************************
    424  *              ICLocate                        [MSVIDEO.213]
    425  */
    426 HIC16 VFWAPI ICLocate16(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn,
    427                                                 LPBITMAPINFOHEADER lpbiOut, WORD wFlags) {
    428         return (HIC16)ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, wFlags);
    429 }
    430 #endif
    431 
    432407/***********************************************************************
    433408 *              ICGetDisplayFormat                      [MSVFW32.@]
     
    437412        INT depth,INT dx,INT dy)
    438413{
    439         HIC     tmphic = hic; 
     414        HIC     tmphic = hic;
    440415
    441416        FIXME("(0x%08lx,%p,%p,%d,%d,%d),stub!\n",(DWORD)hic,lpbiIn,lpbiOut,depth,dx,dy);
     
    474449        if (lpbiIn->biBitCount == 8)
    475450                depth = 8;
    476        
     451
    477452        TRACE("=> 0x%08lx\n",(DWORD)tmphic);
    478453        return tmphic;
     
    484459        return 0;
    485460}
    486 
    487 #ifndef __WIN32OS2__
    488 /***********************************************************************
    489  *              ICGetDisplayFormat                      [MSVIDEO.239]
    490  */
    491 HIC16 VFWAPI ICGetDisplayFormat16(HIC16 hic, LPBITMAPINFOHEADER lpbiIn,
    492                                                                   LPBITMAPINFOHEADER lpbiOut, INT16 depth, INT16 dx, INT16 dy) {
    493         return (HIC16)ICGetDisplayFormat(hic,lpbiIn,lpbiOut,depth,dx,dy);
    494 }
    495 #endif
    496461
    497462/***********************************************************************
     
    526491}
    527492
    528 #ifndef __WIN32OS2__
    529 /***********************************************************************
    530  *              _ICCompress                     [MSVIDEO.224]
    531  */
    532 DWORD VFWAPIV ICCompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiOutput, LPVOID lpData,
    533                                                    LPBITMAPINFOHEADER lpbiInput, LPVOID lpBits, LPDWORD lpckid,
    534                                                    LPDWORD lpdwFlags, LONG lFrameNum, DWORD dwFrameSize, DWORD dwQuality,
    535                                                    LPBITMAPINFOHEADER lpbiPrev, LPVOID lpPrev) {
    536 
    537         DWORD ret;
    538         ICCOMPRESS *iccmp = SEGPTR_NEW(ICCOMPRESS);
    539 
    540         TRACE("(0x%08lx,%ld,%p,%p,%p,%p,...)\n",(DWORD)hic,dwFlags,lpbiOutput,lpData,lpbiInput,lpBits);
    541 
    542         iccmp->dwFlags          = dwFlags;
    543 
    544         iccmp->lpbiOutput       = lpbiOutput;
    545         iccmp->lpOutput         = lpData;
    546         iccmp->lpbiInput                = lpbiInput;
    547         iccmp->lpInput          = lpBits;
    548 
    549         iccmp->lpckid           = lpckid;
    550         iccmp->lpdwFlags                = lpdwFlags;
    551         iccmp->lFrameNum                = lFrameNum;
    552         iccmp->dwFrameSize      = dwFrameSize;
    553         iccmp->dwQuality                = dwQuality;
    554         iccmp->lpbiPrev         = lpbiPrev;
    555         iccmp->lpPrev           = lpPrev;
    556         ret = ICSendMessage16(hic,ICM_COMPRESS,(DWORD)SEGPTR_GET(iccmp),sizeof(ICCOMPRESS));
    557         SEGPTR_FREE(iccmp);
    558         return ret;
    559 }
    560 #endif
    561 
    562493/***********************************************************************
    563494 *              ICDecompress                    [MSVFW32.@]
     
    589520}
    590521
    591 #ifndef __WIN32OS2__
    592 /***********************************************************************
    593  *              _ICDecompress                   [MSVIDEO.230]
    594  */
    595 DWORD VFWAPIV ICDecompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFormat,
    596                                                          LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits) {
    597 
    598         ICDECOMPRESS *icd = SEGPTR_NEW(ICDECOMPRESS);
    599         DWORD ret;
    600        
    601         TRACE("(0x%08lx,%ld,%p,%p,%p,%p)\n",(DWORD)hic,dwFlags,lpbiFormat,lpData,lpbi,lpBits);
    602 
    603         icd->dwFlags = dwFlags;
    604         icd->lpbiInput = lpbiFormat;
    605         icd->lpInput = lpData;
    606         icd->lpbiOutput = lpbi;
    607         icd->lpOutput = lpBits;
    608         icd->ckid = 0;
    609 
    610         ret = ICSendMessage16(hic,ICM_DECOMPRESS,(DWORD)SEGPTR_GET(icd),sizeof(ICDECOMPRESS));
    611 
    612         SEGPTR_FREE(icd);
    613         return ret;
    614 }
    615 
    616522#define COPY(x,y) (x->y = x##16->y);
    617523#define COPYPTR(x,y) (x->y = MapSL((SEGPTR)x##16->y));
     
    623529        ICDECOMPRESSEX16 *icdx16 = MapSL(*lParam);
    624530        ret = icdx16;
    625        
     531
    626532        COPY(icdx,dwFlags);
    627533        COPYPTR(icdx,lpbiSrc);
     
    637543        COPY(icdx,dxSrc);
    638544        COPY(icdx,dySrc);
    639        
     545
    640546        *lParam = (DWORD)(icdx);
    641547        return ret;
     
    644550LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2) {
    645551        LPVOID ret = 0;
    646        
     552
    647553        TRACE("Mapping %d\n",msg);
    648554
     
    714620                        COPYPTR(icc,lpbiPrev);
    715621                        COPYPTR(icc,lpPrev);
    716                        
     622
    717623                        *lParam1 = (DWORD)(icc);
    718624                        *lParam2 = sizeof(ICCOMPRESS);
     
    723629                        ICDECOMPRESS *icd = HeapAlloc(GetProcessHeap(),0,sizeof(ICDECOMPRESS));
    724630                        ICDECOMPRESS *icd16; /* Same structure except for the pointers */
    725                        
     631
    726632                        icd16 = MapSL(*lParam1);
    727633                        ret = icd16;
    728                        
     634
    729635                        COPY(icd,dwFlags);
    730636                        COPYPTR(icd,lpbiInput);
     
    733639                        COPYPTR(icd,lpOutput);
    734640                        COPY(icd,ckid);
    735                        
     641
    736642                        *lParam1 = (DWORD)(icd);
    737643                        *lParam2 = sizeof(ICDECOMPRESS);
     
    762668                 else
    763669                 addr[1] = 0;
    764                  
     670
    765671                 ret = addr;
    766672                 }
     
    801707                        ICDRAWSUGGEST *icds = HeapAlloc(GetProcessHeap(),0,sizeof(ICDRAWSUGGEST));
    802708                        ICDRAWSUGGEST16 *icds16 = MapSL(*lParam1);
    803                        
     709
    804710                        ret = icds16;
    805711
     
    894800                ERR("Unmapping unmapped msg %d\n",msg);
    895801        }
    896 #undef UNCOPY           
    897 }
    898 #endif
     802#undef UNCOPY
     803}
    899804
    900805LRESULT MSVIDEO_SendMessage(HIC hic,UINT msg,DWORD lParam1,DWORD lParam2, BOOL bFrom32) {
     
    974879        if (whic->driverproc) { /* IC is a function */
    975880#ifdef __WIN32OS2__
    976                 bDrv32 = whic->privatevfw;
     881                bDrv32 = whic->privatevfw;
    977882#else
    978883                bDrv32 = whic->private;
     
    982887        }
    983888
    984 #ifndef __WIN32OS2__
    985889        if (!bFrom32) {
    986890                if (bDrv32)
     
    993897                }
    994898        }
    995 #endif
    996        
     899
    997900        if (whic->driverproc) {
    998 #ifdef __WIN32OS2__
    999                 ret = whic->driverproc(whic->hdrv,hic,msg,lParam1,lParam2);
    1000 #else
    1001901                if (bDrv32) {
    1002902                        ret = whic->driverproc(whic->hdrv,hic,msg,lParam1,lParam2);
    1003903                } else {
    1004                         ret = MSVIDEO_CallTo16_long_lwwll((FARPROC16)whic->driverproc,whic->hdrv,hic,msg,lParam1,lParam2);
    1005                 }
    1006 #endif
     904                        ret = MSVIDEO_CallTo16_long_lwwll((FARPROC16)whic->driverproc,HDRVR_16(whic->hdrv),hic,msg,lParam1,lParam2);
     905                }
    1007906        } else {
    1008907                ret = SendDriverMessage(whic->hdrv,msg,lParam1,lParam2);
    1009908        }
    1010909
    1011 #ifndef __WIN32OS2__
    1012910        if (data16)
    1013911                MSVIDEO_UnmapMsg16To32(msg,data16,&lParam1,&lParam2);
    1014 #endif
    1015  
     912
    1016913 out:
    1017914        GlobalUnlock16(hic);
    1018        
     915
    1019916        TRACE(" -> 0x%08lx\n",ret);
    1020917        return ret;
     
    1027924        return MSVIDEO_SendMessage(hic,msg,lParam1,lParam2,TRUE);
    1028925}
    1029 #ifndef __WIN32OS2__
     926
    1030927/***********************************************************************
    1031928 *              ICSendMessage                   [MSVIDEO.205]
     
    1035932}
    1036933
    1037 /***********************************************************************
    1038  *              _ICMessage                      [MSVIDEO.207]
    1039  */
    1040 LRESULT VFWAPIV ICMessage16(void) {
    1041         HIC16 hic;
    1042         UINT16 msg;
    1043         UINT16 cb;
    1044         LPWORD lpData;
    1045         LRESULT ret;
    1046         UINT16 i;
    1047 
    1048         VA_LIST16 valist;
    1049        
    1050         VA_START16(valist);
    1051         hic = VA_ARG16(valist, HIC16);
    1052         msg = VA_ARG16(valist, UINT16);
    1053         cb  = VA_ARG16(valist, UINT16);
    1054 
    1055         lpData = SEGPTR_ALLOC(cb);
    1056 
    1057         TRACE("0x%08lx, %u, %u, ...)\n",(DWORD)hic,msg,cb);
    1058 
    1059         for(i=0;i<cb/sizeof(WORD);i++) {
    1060                 lpData[i] = VA_ARG16(valist, WORD);
    1061         }
    1062                
    1063         VA_END16(valist);
    1064         ret = ICSendMessage16(hic, msg, (DWORD)(SEGPTR_GET(lpData)), (DWORD)cb);
    1065 
    1066         SEGPTR_FREE(lpData);
    1067         return ret;
    1068 }
    1069 #endif
    1070934/***********************************************************************
    1071935 *              ICDrawBegin             [MSVFW32.@]
     
    1089953        DWORD              dwScale) /* [in] */
    1090954{
    1091        
     955
    1092956        ICDRAWBEGIN     icdb;
    1093957
     
    1114978}
    1115979
    1116 #ifndef __WIN32OS2__
    1117 /***********************************************************************
    1118  *              _ICDrawBegin            [MSVIDEO.232]
    1119  */
    1120 DWORD VFWAPIV ICDrawBegin16(
    1121         HIC16               hic,     /* [in] */
    1122         DWORD               dwFlags, /* [in] flags */
    1123         HPALETTE16          hpal,    /* [in] palette to draw with */
    1124         HWND16              hwnd,    /* [in] window to draw to */
    1125         HDC16               hdc,     /* [in] HDC to draw to */
    1126         INT16               xDst,    /* [in] destination rectangle */
    1127         INT16               yDst,    /* [in] */
    1128         INT16               dxDst,   /* [in] */
    1129         INT16               dyDst,   /* [in] */
    1130         LPBITMAPINFOHEADER  lpbi,    /* [in] format of frame to draw NOTE: SEGPTR */
    1131         INT16               xSrc,    /* [in] source rectangle */
    1132         INT16               ySrc,    /* [in] */
    1133         INT16               dxSrc,   /* [in] */
    1134         INT16               dySrc,   /* [in] */
    1135         DWORD               dwRate,  /* [in] frames/second = (dwRate/dwScale) */
    1136         DWORD               dwScale) /* [in] */
    1137 {
    1138         DWORD ret;
    1139         ICDRAWBEGIN16* icdb = SEGPTR_NEW(ICDRAWBEGIN16); /* SEGPTR for mapper to deal with */
    1140 
    1141         TRACE("(0x%08lx,%ld,0x%08lx,0x%08lx,0x%08lx,%u,%u,%u,%u,%p,%u,%u,%u,%u,%ld,%ld)\n",
    1142                   (DWORD)hic, dwFlags, (DWORD)hpal, (DWORD)hwnd, (DWORD)hdc, xDst, yDst, dxDst, dyDst,
    1143                   lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale);
    1144 
    1145         icdb->dwFlags = dwFlags;
    1146         icdb->hpal = hpal;
    1147         icdb->hwnd = hwnd;
    1148         icdb->hdc = hdc;
    1149         icdb->xDst = xDst;
    1150         icdb->yDst = yDst;
    1151         icdb->dxDst = dxDst;
    1152         icdb->dyDst = dyDst;
    1153         icdb->lpbi = lpbi; /* Keep this as SEGPTR for the mapping code to deal with */
    1154         icdb->xSrc = xSrc;
    1155         icdb->ySrc = ySrc;
    1156         icdb->dxSrc = dxSrc;
    1157         icdb->dySrc = dySrc;
    1158         icdb->dwRate = dwRate;
    1159         icdb->dwScale = dwScale;
    1160        
    1161         ret = (DWORD)ICSendMessage16(hic,ICM_DRAW_BEGIN,(DWORD)SEGPTR_GET(icdb),sizeof(ICDRAWBEGIN16));
    1162         SEGPTR_FREE(icdb);
    1163         return ret;
    1164 }
    1165 #endif
    1166 
    1167980/***********************************************************************
    1168981 *              ICDraw                  [MSVFW32.@]
     
    1181994        return ICSendMessage(hic,ICM_DRAW,(DWORD)&icd,sizeof(icd));
    1182995}
    1183 
    1184 #ifndef __WIN32OS2__
    1185 /***********************************************************************
    1186  *              _ICDraw                 [MSVIDEO.234]
    1187  */
    1188 DWORD VFWAPIV ICDraw16(
    1189         HIC16 hic,
    1190         DWORD dwFlags,
    1191         LPVOID lpFormat, /* [???] NOTE: SEGPTR */
    1192         LPVOID lpData,   /* [???] NOTE: SEGPTR */
    1193         DWORD cbData,
    1194         LONG lTime)
    1195 {
    1196         ICDRAW* icd = SEGPTR_NEW(ICDRAW); /* SEGPTR for mapper to deal with */
    1197 
    1198         TRACE("(0x%08lx,0x%08lx,%p,%p,%ld,%ld)\n",(DWORD)hic,dwFlags,lpFormat,lpData,cbData,lTime);
    1199         icd->dwFlags = dwFlags;
    1200         icd->lpFormat = lpFormat;
    1201         icd->lpData = lpData;
    1202         icd->cbData = cbData;
    1203         icd->lTime = lTime;
    1204 
    1205         return ICSendMessage16(hic,ICM_DRAW,(DWORD)SEGPTR_GET(icd),sizeof(ICDRAW));
    1206 }
    1207 #endif
    1208996
    1209997/***********************************************************************
     
    12261014}
    12271015
    1228 #ifndef __WIN32OS2__
    1229 /***********************************************************************
    1230  *              ICClose                 [MSVIDEO.204]
    1231  */
    1232 LRESULT WINAPI ICClose16(HIC16 hic) {
    1233         return ICClose(hic);
    1234 }
    1235 #endif
    1236 
    1237 /***********************************************************************
    1238  *              MCIWndCreate            [MSVFW32.@]
    1239  *              MCIWndCreateA           [MSVFW32.@]
    1240  */
    1241 HWND VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance,
    1242                       DWORD dwStyle,LPCSTR szFile)
     1016
     1017
     1018/***********************************************************************
     1019 *              ICImageCompress [MSVFW32.@]
     1020 */
     1021HANDLE VFWAPI ICImageCompress(
     1022        HIC hic, UINT uiFlags,
     1023        LPBITMAPINFO lpbiIn, LPVOID lpBits,
     1024        LPBITMAPINFO lpbiOut, LONG lQuality,
     1025        LONG* plSize)
    12431026{
    1244         FIXME("%x %x %lx %s\n",hwndParent, hInstance, dwStyle, szFile);
    1245         return 0;
    1246 }
    1247 
    1248 /***********************************************************************
    1249  *              MCIWndCreateW           [MSVFW32.@]
    1250  */
    1251 HWND VFWAPIV MCIWndCreateW(HWND hwndParent, HINSTANCE hInstance,
    1252                       DWORD dwStyle,LPCWSTR szFile)
     1027        FIXME("(%08x,%08x,%p,%p,%p,%ld,%p)\n",
     1028                hic, uiFlags, lpbiIn, lpBits, lpbiOut, lQuality, plSize);
     1029
     1030        return (HANDLE)NULL;
     1031}
     1032
     1033/***********************************************************************
     1034 *              ICImageDecompress       [MSVFW32.@]
     1035 */
     1036
     1037HANDLE VFWAPI ICImageDecompress(
     1038        HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn,
     1039        LPVOID lpBits, LPBITMAPINFO lpbiOut)
    12531040{
    1254         FIXME("%x %x %lx %s\n",hwndParent, hInstance, dwStyle, debugstr_w(szFile));
    1255         return 0;
    1256 }
     1041        HGLOBAL hMem = (HGLOBAL)NULL;
     1042        BYTE*   pMem = NULL;
     1043        BOOL    bReleaseIC = FALSE;
     1044        BYTE*   pHdr = NULL;
     1045        LONG    cbHdr = 0;
     1046        BOOL    bSucceeded = FALSE;
     1047        BOOL    bInDecompress = FALSE;
     1048        DWORD   biSizeImage;
     1049
     1050        TRACE("(%08x,%08x,%p,%p,%p)\n",
     1051                hic, uiFlags, lpbiIn, lpBits, lpbiOut);
     1052
     1053        if ( hic == (HIC)NULL )
     1054        {
     1055                hic = ICDecompressOpen( mmioFOURCC('V','I','D','C'), 0, &lpbiIn->bmiHeader, (lpbiOut != NULL) ? &lpbiOut->bmiHeader : NULL );
     1056                if ( hic == (HIC)NULL )
     1057                {
     1058                        WARN("no handler\n" );
     1059                        goto err;
     1060                }
     1061                bReleaseIC = TRUE;
     1062        }
     1063        if ( uiFlags != 0 )
     1064        {
     1065                FIXME( "unknown flag %08x\n", uiFlags );
     1066                goto err;
     1067        }
     1068        if ( lpbiIn == NULL || lpBits == NULL )
     1069        {
     1070                WARN("invalid argument\n");
     1071                goto err;
     1072        }
     1073
     1074        if ( lpbiOut != NULL )
     1075        {
     1076                if ( lpbiOut->bmiHeader.biSize != sizeof(BITMAPINFOHEADER) )
     1077                        goto err;
     1078                cbHdr = sizeof(BITMAPINFOHEADER);
     1079                if ( lpbiOut->bmiHeader.biCompression == 3 )
     1080                        cbHdr += sizeof(DWORD)*3;
     1081                else
     1082                if ( lpbiOut->bmiHeader.biBitCount <= 8 )
     1083                {
     1084                        if ( lpbiOut->bmiHeader.biClrUsed == 0 )
     1085                                cbHdr += sizeof(RGBQUAD) * (1<<lpbiOut->bmiHeader.biBitCount);
     1086                        else
     1087                                cbHdr += sizeof(RGBQUAD) * lpbiOut->bmiHeader.biClrUsed;
     1088                }
     1089        }
     1090        else
     1091        {
     1092                TRACE( "get format\n" );
     1093
     1094                cbHdr = ICDecompressGetFormatSize(hic,lpbiIn);
     1095                if ( cbHdr < sizeof(BITMAPINFOHEADER) )
     1096                        goto err;
     1097                pHdr = (BYTE*)HeapAlloc(GetProcessHeap(),0,cbHdr+sizeof(RGBQUAD)*256);
     1098                if ( pHdr == NULL )
     1099                        goto err;
     1100                ZeroMemory( pHdr, cbHdr+sizeof(RGBQUAD)*256 );
     1101                if ( ICDecompressGetFormat( hic, lpbiIn, (BITMAPINFO*)pHdr ) != ICERR_OK )
     1102                        goto err;
     1103                lpbiOut = (BITMAPINFO*)pHdr;
     1104                if ( lpbiOut->bmiHeader.biBitCount <= 8 &&
     1105                         ICDecompressGetPalette( hic, lpbiIn, lpbiOut ) != ICERR_OK &&
     1106                         lpbiIn->bmiHeader.biBitCount == lpbiOut->bmiHeader.biBitCount )
     1107                {
     1108                        if ( lpbiIn->bmiHeader.biClrUsed == 0 )
     1109                                memcpy( lpbiOut->bmiColors, lpbiIn->bmiColors, sizeof(RGBQUAD)*(1<<lpbiOut->bmiHeader.biBitCount) );
     1110                        else
     1111                                memcpy( lpbiOut->bmiColors, lpbiIn->bmiColors, sizeof(RGBQUAD)*lpbiIn->bmiHeader.biClrUsed );
     1112                }
     1113                if ( lpbiOut->bmiHeader.biBitCount <= 8 &&
     1114                         lpbiOut->bmiHeader.biClrUsed == 0 )
     1115                        lpbiOut->bmiHeader.biClrUsed = 1<<lpbiOut->bmiHeader.biBitCount;
     1116
     1117                lpbiOut->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
     1118                cbHdr = sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD)*lpbiOut->bmiHeader.biClrUsed;
     1119        }
     1120
     1121        biSizeImage = lpbiOut->bmiHeader.biSizeImage;
     1122        if ( biSizeImage == 0 )
     1123                biSizeImage = ((((lpbiOut->bmiHeader.biWidth * lpbiOut->bmiHeader.biBitCount + 7) >> 3) + 3) & (~3)) * abs(lpbiOut->bmiHeader.biHeight);
     1124
     1125        TRACE( "call ICDecompressBegin\n" );
     1126
     1127        if ( ICDecompressBegin( hic, lpbiIn, lpbiOut ) != ICERR_OK )
     1128                goto err;
     1129        bInDecompress = TRUE;
     1130
     1131        TRACE( "cbHdr %ld, biSizeImage %ld\n", cbHdr, biSizeImage );
     1132
     1133        hMem = GlobalAlloc( GMEM_MOVEABLE|GMEM_ZEROINIT, cbHdr + biSizeImage );
     1134        if ( hMem == (HGLOBAL)NULL )
     1135        {
     1136                WARN( "out of memory\n" );
     1137                goto err;
     1138        }
     1139        pMem = (BYTE*)GlobalLock( hMem );
     1140        if ( pMem == NULL )
     1141                goto err;
     1142        memcpy( pMem, lpbiOut, cbHdr );
     1143
     1144        TRACE( "call ICDecompress\n" );
     1145        if ( ICDecompress( hic, 0, &lpbiIn->bmiHeader, lpBits, &lpbiOut->bmiHeader, pMem+cbHdr ) != ICERR_OK )
     1146                goto err;
     1147
     1148        bSucceeded = TRUE;
     1149err:
     1150        if ( bInDecompress )
     1151                ICDecompressEnd( hic );
     1152        if ( bReleaseIC )
     1153                ICClose(hic);
     1154        if ( pHdr != NULL )
     1155                HeapFree(GetProcessHeap(),0,pHdr);
     1156        if ( pMem != NULL )
     1157                GlobalUnlock( hMem );
     1158        if ( !bSucceeded && hMem != (HGLOBAL)NULL )
     1159        {
     1160                GlobalFree(hMem); hMem = (HGLOBAL)NULL;
     1161        }
     1162
     1163        return (HANDLE)hMem;
     1164}
  • trunk/src/msvfw32/vfw16.h

    r6386 r9140  
     1/*
     2 * Copyright 1999 Marcus Meissner
     3 *
     4 * This library is free software; you can redistribute it and/or
     5 * modify it under the terms of the GNU Lesser General Public
     6 * License as published by the Free Software Foundation; either
     7 * version 2.1 of the License, or (at your option) any later version.
     8 *
     9 * This library is distributed in the hope that it will be useful,
     10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12 * Lesser General Public License for more details.
     13 *
     14 * You should have received a copy of the GNU Lesser General Public
     15 * License along with this library; if not, write to the Free Software
     16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     17 */
     18
    119#ifndef __WINE_VFW16_H
    220#define __WINE_VFW16_H
     
    826extern "C" {
    927#endif  /* __cplusplus */
     28
     29#ifdef __WIN32OS2__
     30#include <heapstring.h>
     31
     32#define GlobalAlloc16 GlobalAlloc
     33#define GlobalLock16 GlobalLock
     34#define GlobalUnlock16 GlobalUnlock
     35#define GlobalFree16 GlobalFree
     36
     37#define MapLS(a)        a
     38#define UnMapLS(a)
     39
     40#define HIC16   DWORD
     41
     42#endif
    1043
    1144typedef HANDLE16 HDRAWDIB16;
Note: See TracChangeset for help on using the changeset viewer.