VirtualBox

Changeset 35713 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 25, 2011 2:15:16 PM (14 years ago)
Author:
vboxsync
Message:

wined3d/xpdm: fix crashes for apps using WPF, doesn't render correctly though. (public #4587)

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Wine
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/d3d9/directx.c

    r33656 r35713  
    467467
    468468static HRESULT WINAPI IDirect3D9ExImpl_GetAdapterDisplayModeEx(IDirect3D9Ex *iface,
    469         UINT adapter, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation)
    470 {
    471     FIXME("iface %p, adapter %u, mode %p, rotation %p stub!\n",
    472             iface, adapter, mode, rotation);
    473 
    474     return D3DERR_DRIVERINTERNALERROR;
     469        UINT Adapter, D3DDISPLAYMODEEX *pMode, D3DDISPLAYROTATION *pRotation)
     470{
     471    IDirect3D9Impl *This = (IDirect3D9Impl *)iface;
     472    HRESULT hr;
     473
     474    TRACE("iface %p, adapter %u, mode %p, rotation %p", iface, Adapter, pMode, pRotation);
     475
     476    wined3d_mutex_lock();
     477    hr = IWineD3D_GetAdapterDisplayModeEx(This->WineD3D, Adapter, (WINED3DDISPLAYMODEEX *) pMode, (WINED3DDISPLAYROTATION *) pRotation);
     478    wined3d_mutex_unlock();
     479
     480    if (SUCCEEDED(hr))
     481    {
     482        pMode->Format = d3dformat_from_wined3dformat(pMode->Format);
     483    }
     484
     485/*
     486    if (mode)
     487    {
     488        D3DDISPLAYMODE* d3dmode;
     489
     490        if (mode->Size != sizeof(D3DDISPLAYMODEEX))
     491        {
     492            WARN("Invalid mode->Size %u expected %u", mode->Size, sizeof(D3DDISPLAYMODEEX));
     493            return D3DERR_INVALIDCALL;
     494        }
     495
     496        wined3d_mutex_lock();
     497        hr = IWineD3D_GetAdapterDisplayMode(This->WineD3D, Adapter, (WINED3DDISPLAYMODE *) &d3dmode);
     498        wined3d_mutex_unlock();
     499
     500        if (SUCCEEDED(hr))
     501        {
     502            mode->Width = d3dmode.Width;
     503            mode->Height = d3dmode.Height;
     504            mode->RefreshRate = d3dmode.RefreshRate;
     505            mode->Format = d3dformat_from_wined3dformat(d3dmode.Format);
     506            mode->ScanLineOrdering = D3DSCANLINEORDERING_PROGRESSIVE; //D3DSCANLINEORDERING_INTERLACED
     507        }
     508    }
     509    else
     510    {
     511        hr = WINED3D_OK;
     512    }
     513
     514    if (rotation)
     515    {
     516        *rotation = D3DDISPLAYROTATION_IDENTITY;
     517    }
     518*/
     519    return hr;
    475520}
    476521
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/wine/wined3d.h

    r35650 r35713  
    21102110    WINED3DFORMAT Format;
    21112111} WINED3DDISPLAYMODE;
     2112typedef enum _WINED3DSCANLINEORDERING {
     2113  WINED3DSCANLINEORDERING_UNKNOWN    = 0,
     2114  WINED3DSCANLINEORDERING_PROGRESSIVE   = 1,
     2115  WINED3DSCANLINEORDERING_INTERLACED    = 2
     2116} WINED3DSCANLINEORDERING;
     2117typedef struct _WINED3DDISPLAYMODEEX {
     2118    UINT Size;
     2119    UINT Width;
     2120    UINT Height;
     2121    UINT RefreshRate;
     2122    WINED3DFORMAT Format;
     2123    WINED3DSCANLINEORDERING ScanLineOrdering;
     2124} WINED3DDISPLAYMODEEX;
     2125typedef enum _WINED3DDISPLAYROTATION {
     2126  WINED3DDISPLAYROTATION_IDENTITY   = 1,
     2127  WINED3DDISPLAYROTATION_90         = 2,
     2128  WINED3DDISPLAYROTATION_180        = 3,
     2129  WINED3DDISPLAYROTATION_270        = 4
     2130} WINED3DDISPLAYROTATION;
    21122131typedef struct _WINED3DCOLORVALUE {
    21132132    float r;
     
    29392958        WINED3DDISPLAYMODE *mode) = 0;
    29402959
     2960    virtual HRESULT STDMETHODCALLTYPE GetAdapterDisplayModeEx(
     2961        UINT adapter_idx,
     2962        WINED3DDISPLAYMODEEX *mode,
     2963        WINED3DDISPLAYROTATION *rotation) = 0;
     2964
    29412965    virtual HRESULT STDMETHODCALLTYPE GetAdapterIdentifier(
    29422966        UINT adapter_idx,
     
    30453069        UINT adapter_idx,
    30463070        WINED3DDISPLAYMODE *mode);
     3071
     3072    HRESULT (STDMETHODCALLTYPE *GetAdapterDisplayModeEx)(
     3073        IWineD3D* This,
     3074        UINT adapter_idx,
     3075        WINED3DDISPLAYMODEEX *mode,
     3076        WINED3DDISPLAYROTATION *rotation);
    30473077
    30483078    HRESULT (STDMETHODCALLTYPE *GetAdapterIdentifier)(
     
    31303160#define IWineD3D_EnumAdapterModes(This,adapter_idx,format,mode_idx,mode) (This)->lpVtbl->EnumAdapterModes(This,adapter_idx,format,mode_idx,mode)
    31313161#define IWineD3D_GetAdapterDisplayMode(This,adapter_idx,mode) (This)->lpVtbl->GetAdapterDisplayMode(This,adapter_idx,mode)
     3162#define IWineD3D_GetAdapterDisplayModeEx(This,adapter_idx,mode,rotation) (This)->lpVtbl->GetAdapterDisplayModeEx(This,adapter_idx,mode,rotation)
    31323163#define IWineD3D_GetAdapterIdentifier(This,adapter_idx,flags,identifier) (This)->lpVtbl->GetAdapterIdentifier(This,adapter_idx,flags,identifier)
    31333164#define IWineD3D_CheckDeviceMultiSampleType(This,adapter_idx,device_type,surface_format,windowed,multisample_type,quality_levels) (This)->lpVtbl->CheckDeviceMultiSampleType(This,adapter_idx,device_type,surface_format,windowed,multisample_type,quality_levels)
     
    31903221    WINED3DDISPLAYMODE *mode);
    31913222void __RPC_STUB IWineD3D_GetAdapterDisplayMode_Stub(
     3223    IRpcStubBuffer* This,
     3224    IRpcChannelBuffer* pRpcChannelBuffer,
     3225    PRPC_MESSAGE pRpcMessage,
     3226    DWORD* pdwStubPhase);
     3227HRESULT STDMETHODCALLTYPE IWineD3D_GetAdapterDisplayModeEx_Proxy(
     3228    IWineD3D* This,
     3229    UINT adapter_idx,
     3230    WINED3DDISPLAYMODEEX *mode,
     3231    WINED3DDISPLAYROTATION *rotation);
     3232void __RPC_STUB IWineD3D_GetAdapterDisplayModeEx_Stub(
    31923233    IRpcStubBuffer* This,
    31933234    IRpcChannelBuffer* pRpcChannelBuffer,
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/wingdi.h

    r33656 r35713  
    29042904        DWORD dmDisplayFixedOutput;
    29052905      } DUMMYSTRUCTNAME2;
    2906     } DUMMYUNIONNAME1;
     2906    } DUMMYUNIONNAME;
    29072907    short  dmColor;
    29082908    short  dmDuplex;
     
    29512951#define DM_SCALE                0x00000010L
    29522952#define DM_POSITION             0x00000020L
     2953#define DM_DISPLAYORIENTATION   0x00000080L
    29532954#define DM_COPIES               0x00000100L
    29542955#define DM_DEFAULTSOURCE        0x00000200L
     
    31363137#define DMCOLLATE_FALSE         0
    31373138#define DMCOLLATE_TRUE          1
     3139
     3140/* DEVMODE dmDisplayOrientation specifiations */
     3141#define DMDO_DEFAULT    0
     3142#define DMDO_90         1
     3143#define DMDO_180        2
     3144#define DMDO_270        3
     3145
     3146/* DEVMODE dmDisplayFlags flags */
     3147#define DM_INTERLACED           0x00000002
     3148#define DMDISPLAYFLAGS_TEXTMODE 0x00000004
    31383149
    31393150#define DMICMMETHOD_NONE        1
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/vbox/libWineStub/include/wine/wined3d.h

    r35650 r35713  
    21122112    WINED3DFORMAT Format;
    21132113} WINED3DDISPLAYMODE;
     2114typedef enum _WINED3DSCANLINEORDERING {
     2115  WINED3DSCANLINEORDERING_UNKNOWN    = 0,
     2116  WINED3DSCANLINEORDERING_PROGRESSIVE   = 1,
     2117  WINED3DSCANLINEORDERING_INTERLACED    = 2
     2118} WINED3DSCANLINEORDERING;
     2119typedef struct _WINED3DDISPLAYMODEEX {
     2120    UINT Size;
     2121    UINT Width;
     2122    UINT Height;
     2123    UINT RefreshRate;
     2124    WINED3DFORMAT Format;
     2125    WINED3DSCANLINEORDERING ScanLineOrdering;
     2126} WINED3DDISPLAYMODEEX;
     2127typedef enum _WINED3DDISPLAYROTATION {
     2128  WINED3DDISPLAYROTATION_IDENTITY   = 1,
     2129  WINED3DDISPLAYROTATION_90         = 2,
     2130  WINED3DDISPLAYROTATION_180        = 3,
     2131  WINED3DDISPLAYROTATION_270        = 4
     2132} WINED3DDISPLAYROTATION;
    21142133typedef struct _WINED3DCOLORVALUE {
    21152134    float r;
     
    29412960        WINED3DDISPLAYMODE *mode) = 0;
    29422961
     2962    virtual HRESULT STDMETHODCALLTYPE GetAdapterDisplayModeEx(
     2963        UINT adapter_idx,
     2964        WINED3DDISPLAYMODEEX *mode,
     2965        WINED3DDISPLAYROTATION *rotation) = 0;
     2966
    29432967    virtual HRESULT STDMETHODCALLTYPE GetAdapterIdentifier(
    29442968        UINT adapter_idx,
     
    30473071        UINT adapter_idx,
    30483072        WINED3DDISPLAYMODE *mode);
     3073
     3074    HRESULT (STDMETHODCALLTYPE *GetAdapterDisplayModeEx)(
     3075        IWineD3D* This,
     3076        UINT adapter_idx,
     3077        WINED3DDISPLAYMODEEX *mode,
     3078        WINED3DDISPLAYROTATION *rotation);
    30493079
    30503080    HRESULT (STDMETHODCALLTYPE *GetAdapterIdentifier)(
     
    31323162#define IWineD3D_EnumAdapterModes(This,adapter_idx,format,mode_idx,mode) (This)->lpVtbl->EnumAdapterModes(This,adapter_idx,format,mode_idx,mode)
    31333163#define IWineD3D_GetAdapterDisplayMode(This,adapter_idx,mode) (This)->lpVtbl->GetAdapterDisplayMode(This,adapter_idx,mode)
     3164#define IWineD3D_GetAdapterDisplayModeEx(This,adapter_idx,mode,rotation) (This)->lpVtbl->GetAdapterDisplayModeEx(This,adapter_idx,mode,rotation)
    31343165#define IWineD3D_GetAdapterIdentifier(This,adapter_idx,flags,identifier) (This)->lpVtbl->GetAdapterIdentifier(This,adapter_idx,flags,identifier)
    31353166#define IWineD3D_CheckDeviceMultiSampleType(This,adapter_idx,device_type,surface_format,windowed,multisample_type,quality_levels) (This)->lpVtbl->CheckDeviceMultiSampleType(This,adapter_idx,device_type,surface_format,windowed,multisample_type,quality_levels)
     
    31923223    WINED3DDISPLAYMODE *mode);
    31933224void __RPC_STUB IWineD3D_GetAdapterDisplayMode_Stub(
     3225    IRpcStubBuffer* This,
     3226    IRpcChannelBuffer* pRpcChannelBuffer,
     3227    PRPC_MESSAGE pRpcMessage,
     3228    DWORD* pdwStubPhase);
     3229HRESULT STDMETHODCALLTYPE IWineD3D_GetAdapterDisplayModeEx_Proxy(
     3230    IWineD3D* This,
     3231    UINT adapter_idx,
     3232    WINED3DDISPLAYMODEEX *mode,
     3233    WINED3DDISPLAYROTATION *rotation);
     3234void __RPC_STUB IWineD3D_GetAdapterDisplayModeEx_Stub(
    31943235    IRpcStubBuffer* This,
    31953236    IRpcChannelBuffer* pRpcChannelBuffer,
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/directx.c

    r35319 r35713  
    28622862}
    28632863
     2864static HRESULT WINAPI IWineD3DImpl_GetAdapterDisplayModeEx(IWineD3D *iface,
     2865        UINT Adapter, WINED3DDISPLAYMODEEX *pMode, WINED3DDISPLAYROTATION *pRotation)
     2866{
     2867    TRACE("iface %p, adapter_idx %u, display_mode %p, display_rotation %p.\n", iface, Adapter, pMode, pRotation);
     2868
     2869    if (pMode==NULL && pRotation==NULL)
     2870    {
     2871        return WINED3D_OK;
     2872    }
     2873
     2874    if (pMode && pMode->Size != sizeof(WINED3DDISPLAYMODEEX))
     2875    {
     2876        WARN("Invalid mode->Size %u expected %u", pMode->Size, sizeof(WINED3DDISPLAYMODEEX));
     2877        return WINED3DERR_INVALIDCALL;
     2878    }
     2879
     2880    if (Adapter >= IWineD3D_GetAdapterCount(iface))
     2881    {
     2882        return WINED3DERR_INVALIDCALL;
     2883    }
     2884
     2885    if (Adapter == 0) { /* Display */
     2886        int bpp = 0;
     2887        DEVMODEW DevModeW;
     2888
     2889        ZeroMemory(&DevModeW, sizeof(DevModeW));
     2890        DevModeW.dmSize = sizeof(DevModeW);
     2891
     2892        EnumDisplaySettingsExW(NULL, ENUM_CURRENT_SETTINGS, &DevModeW, 0);
     2893
     2894        if (pMode)
     2895        {
     2896            pMode->Width        = DevModeW.dmPelsWidth;
     2897            pMode->Height       = DevModeW.dmPelsHeight;
     2898            bpp                 = DevModeW.dmBitsPerPel;
     2899            pMode->RefreshRate  = DEFAULT_REFRESH_RATE;
     2900            if (DevModeW.dmFields&DM_DISPLAYFREQUENCY)
     2901            {
     2902                pMode->RefreshRate = DevModeW.dmDisplayFrequency;
     2903            }
     2904
     2905            pMode->Format = pixelformat_for_depth(bpp);
     2906
     2907            pMode->ScanLineOrdering = WINED3DSCANLINEORDERING_PROGRESSIVE;
     2908            if (DevModeW.dmFields&DM_DISPLAYFLAGS)
     2909            {
     2910                if (DevModeW.u2.dmDisplayFlags&DM_INTERLACED)
     2911                {
     2912                    pMode->ScanLineOrdering = WINED3DSCANLINEORDERING_INTERLACED;
     2913                }
     2914            }
     2915        }
     2916
     2917        if (pRotation)
     2918        {
     2919            *pRotation = WINED3DDISPLAYROTATION_IDENTITY;
     2920            if (DevModeW.dmFields&DM_DISPLAYORIENTATION)
     2921            {
     2922                switch (DevModeW.u.s2.dmDisplayOrientation)
     2923                {
     2924                    case DMDO_DEFAULT:
     2925                        *pRotation = WINED3DDISPLAYROTATION_IDENTITY;
     2926                        break;
     2927                    case DMDO_90:
     2928                        *pRotation = WINED3DDISPLAYROTATION_90;
     2929                        break;
     2930                    case DMDO_180:
     2931                        *pRotation = WINED3DDISPLAYROTATION_180;
     2932                        break;
     2933                    case DMDO_270:
     2934                        *pRotation = WINED3DDISPLAYROTATION_270;
     2935                        break;
     2936                    default:
     2937                        WARN("Unexpected display orientation %#x", DevModeW.u.s2.dmDisplayOrientation);
     2938                        break;
     2939                }
     2940            }
     2941        }
     2942    } else {
     2943        FIXME_(d3d_caps)("Adapter not primary display\n");
     2944    }
     2945
     2946    return WINED3D_OK;
     2947}
     2948
    28642949/* NOTE: due to structure differences between dx8 and dx9 D3DADAPTER_IDENTIFIER,
    28652950   and fields being inserted in the middle, a new structure is used in place    */
     
    54195504    IWineD3DImpl_EnumAdapterModes,
    54205505    IWineD3DImpl_GetAdapterDisplayMode,
     5506    IWineD3DImpl_GetAdapterDisplayModeEx,
    54215507    IWineD3DImpl_GetAdapterIdentifier,
    54225508    IWineD3DImpl_CheckDeviceMultiSampleType,
  • trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/glsl_shader.c

    r33656 r35713  
    37013701    wine_rb_remove(&priv->program_lookup, &key);
    37023702
     3703    TRACE("deleting program %u\n", entry->programId);
    37033704    GL_EXTCALL(glDeleteObjectARB(entry->programId));
     3705    checkGLcall("glDeleteObjectARB");
    37043706    if (entry->vshader) list_remove(&entry->vshader_entry);
    37053707    if (entry->pshader) list_remove(&entry->pshader_entry);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette