Changeset 30483 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispMp.cpp
- Timestamp:
- Jun 28, 2010 7:00:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/wddm/VBoxDispMp.cpp
r30464 r30483 56 56 static VBOXDISPMP g_VBoxDispMp; 57 57 58 HRESULT vboxDispMpEnable()58 DECLCALLBACK(HRESULT) vboxDispMpEnableEvents() 59 59 { 60 60 g_VBoxDispMp.pEscapeCmd = NULL; … … 65 65 66 66 67 HRESULT vboxDispMpDisable()67 DECLCALLBACK(HRESULT) vboxDispMpDisableEvents() 68 68 { 69 69 if (g_VBoxDispMp.pEscapeCmd) … … 76 76 #define VBOXDISPMP_BUF_MAXSIZE ((4096*4096)-96) 77 77 78 HRESULTvboxDispMpGetRegions(PVBOXDISPMP_REGIONS pRegions, DWORD dwMilliseconds)78 DECLCALLBACK(HRESULT) vboxDispMpGetRegions(PVBOXDISPMP_REGIONS pRegions, DWORD dwMilliseconds) 79 79 { 80 80 HRESULT hr = S_OK; … … 106 106 break; 107 107 } 108 else if (g_VBoxDispMp.pEscapeCmd->Hdr.cbRemainingCmds)108 else 109 109 { 110 Assert(g_VBoxDispMp.pEscapeCmd->Hdr.cbRemainingCmds); 111 Assert(g_VBoxDispMp.pEscapeCmd->Hdr.cbRemainingFirstCmd); 110 112 RTMemFree(g_VBoxDispMp.pEscapeCmd); 111 113 uint32_t newSize = RT_MAX(g_VBoxDispMp.cbEscapeCmd + VBOXDISPMP_BUF_INCREASE, g_VBoxDispMp.pEscapeCmd->Hdr.cbRemainingFirstCmd); 112 114 if (newSize < VBOXDISPMP_BUF_MAXSIZE) 113 115 newSize = RT_MAX(newSize, RT_MIN(g_VBoxDispMp.pEscapeCmd->Hdr.cbRemainingCmds, VBOXDISPMP_BUF_MAXSIZE)); 116 Assert(g_VBoxDispMp.cbEscapeCmd < newSize); 114 117 g_VBoxDispMp.pEscapeCmd = (PVBOXDISPIFESCAPE_GETVBOXVIDEOCMCMD)RTMemAlloc(newSize); 115 118 Assert(g_VBoxDispMp.pEscapeCmd); 116 119 if (g_VBoxDispMp.pEscapeCmd) 117 120 g_VBoxDispMp.cbEscapeCmd = newSize; 121 else 122 { 123 g_VBoxDispMp.pEscapeCmd = NULL; 124 g_VBoxDispMp.cbEscapeCmd = 0; 125 hr = E_OUTOFMEMORY; 126 break; 127 } 118 128 } 119 129 } … … 133 143 return hr; 134 144 } 145 146 VBOXDISPMP_DECL(HRESULT) VBoxDispMpGetCallbacks(uint32_t u32Version, PVBOXDISPMP_CALLBACKS pCallbacks) 147 { 148 Assert(u32Version == VBOXDISPMP_VERSION); 149 if (u32Version != VBOXDISPMP_VERSION) 150 return E_INVALIDARG; 151 152 pCallbacks->pfnEnableEvents = vboxDispMpEnableEvents; 153 pCallbacks->pfnDisableEvents = vboxDispMpDisableEvents; 154 pCallbacks->pfnGetRegions = vboxDispMpGetRegions; 155 return S_OK; 156 }
Note:
See TracChangeset
for help on using the changeset viewer.