Changeset 23ab9d7ec99e6502490f89b2951c7c7e73b876e7

Show
Ignore:
Timestamp:
18/08/06 17:11:02 (2 years ago)
Author:
Damien Fouilleul <damienf@videolan.org>
git-committer:
Damien Fouilleul <damienf@videolan.org> 1155913862 +0000
git-parent:

[ba98f2bd51b7e1f7a7f5ca69807774894fd05e30]

git-author:
Damien Fouilleul <damienf@videolan.org> 1155913862 +0000
Message:

- minor fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • activex/utils.cpp

    r2cb472d r23ab9d7  
    6363            MultiByteToWideChar(codePage, 0, s, -1, wideStr, wideLen); 
    6464            bstr = SysAllocStringLen(wideStr, wideLen); 
    65             free(wideStr); 
     65            CoTaskMemFree(wideStr); 
    6666 
    6767            return bstr; 
     
    106106{ 
    107107    HDC hdc=NULL; 
    108     LPDEVNAMES lpDevNames; 
    109     LPDEVMODE lpDevMode; 
    110     LPTSTR lpszDriverName; 
    111     LPTSTR lpszDeviceName; 
    112     LPTSTR lpszPortName; 
     108    if( NULL == ptd ) 
     109    { 
     110        hdc = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL); 
     111    } 
     112    else 
     113    { 
     114        LPDEVNAMES lpDevNames; 
     115        LPDEVMODE lpDevMode; 
     116        LPTSTR lpszDriverName; 
     117        LPTSTR lpszDeviceName; 
     118        LPTSTR lpszPortName; 
    113119 
    114     if (ptd == NULL) { 
    115         hdc = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL); 
    116         goto errReturn; 
    117     } 
     120        lpDevNames = (LPDEVNAMES) ptd; // offset for size field 
    118121 
    119     lpDevNames = (LPDEVNAMES) ptd; // offset for size field 
     122        if (ptd->tdExtDevmodeOffset == 0) 
     123        { 
     124            lpDevMode = NULL; 
     125        } 
     126        else 
     127        { 
     128            lpDevMode  = (LPDEVMODE) ((LPTSTR)ptd + ptd->tdExtDevmodeOffset); 
     129        } 
    120130 
    121     if (ptd->tdExtDevmodeOffset == 0) { 
    122         lpDevMode = NULL; 
    123     }else{ 
    124         lpDevMode  = (LPDEVMODE) ((LPTSTR)ptd + ptd->tdExtDevmodeOffset); 
    125     } 
     131        lpszDriverName = (LPTSTR) lpDevNames + ptd->tdDriverNameOffset; 
     132        lpszDeviceName = (LPTSTR) lpDevNames + ptd->tdDeviceNameOffset; 
     133        lpszPortName   = (LPTSTR) lpDevNames + ptd->tdPortNameOffset; 
    126134 
    127     lpszDriverName = (LPTSTR) lpDevNames + ptd->tdDriverNameOffset; 
    128     lpszDeviceName = (LPTSTR) lpDevNames + ptd->tdDeviceNameOffset; 
    129     lpszPortName   = (LPTSTR) lpDevNames + ptd->tdPortNameOffset; 
    130  
    131     hdc = CreateDC(lpszDriverName, lpszDeviceName, lpszPortName, lpDevMode); 
    132  
    133 errReturn: 
     135        hdc = CreateDC(lpszDriverName, lpszDeviceName, lpszPortName, lpDevMode); 
     136    } 
    134137    return hdc; 
    135138};