1 /* 2 * COPYRIGHT: See COPYING in the top level directory 3 * PROJECT: ReactOS kernel 4 * PURPOSE: Native DirectDraw implementation 5 * FILE: win32ss/reactx/ntddraw/dvp.c 6 * PROGRAMER: Magnus olsen (magnus@greatlord.com) 7 * REVISION HISTORY: 8 * 19/1-2006 Magnus Olsen 9 */ 10 11 12 #include <win32k.h> 13 #include <debug.h> 14 15 /************************************************************************/ 16 /* NtGdiDvpCanCreateVideoPort */ 17 /************************************************************************/ 18 DWORD 19 APIENTRY 20 NtGdiDvpCanCreateVideoPort(HANDLE hDirectDraw, 21 PDD_CANCREATEVPORTDATA puCanCreateVPortData) 22 { 23 PGD_DVPCANCREATEVIDEOPORT pfnDvpCanCreateVideoPort = (PGD_DVPCANCREATEVIDEOPORT)gpDxFuncs[DXG_INDEX_DxDvpCanCreateVideoPort].pfn; 24 25 if (pfnDvpCanCreateVideoPort == NULL) 26 { 27 DPRINT1("Warning: no pfnDvpCanCreateVideoPort"); 28 return DDHAL_DRIVER_NOTHANDLED; 29 } 30 31 DPRINT1("Calling dxg.sys pfnDvpCanCreateVideoPort"); 32 return pfnDvpCanCreateVideoPort(hDirectDraw, puCanCreateVPortData); 33 } 34 35 /************************************************************************/ 36 /* NtGdiDvpColorControl */ 37 /************************************************************************/ 38 DWORD 39 APIENTRY 40 NtGdiDvpColorControl(HANDLE hVideoPort, 41 PDD_VPORTCOLORDATA puVPortColorData) 42 { 43 PGD_DVPCOLORCONTROL pfnDvpColorControl = (PGD_DVPCOLORCONTROL)gpDxFuncs[DXG_INDEX_DxDvpColorControl].pfn; 44 45 if (pfnDvpColorControl == NULL) 46 { 47 DPRINT1("Warning: no pfnDvpColorControl"); 48 return DDHAL_DRIVER_NOTHANDLED; 49 } 50 51 DPRINT1("Calling dxg.sys pfnDvpColorControl"); 52 return pfnDvpColorControl(hVideoPort, puVPortColorData); 53 } 54 55 /************************************************************************/ 56 /* NtGdiDvpCreateVideoPort */ 57 /************************************************************************/ 58 HANDLE 59 APIENTRY 60 NtGdiDvpCreateVideoPort(HANDLE hDirectDraw, 61 PDD_CREATEVPORTDATA puCreateVPortData) 62 { 63 PGD_DVPCREATEVIDEOPORT pfnDvpCreateVideoPort = (PGD_DVPCREATEVIDEOPORT)gpDxFuncs[DXG_INDEX_DxDvpCreateVideoPort].pfn; 64 65 if (pfnDvpCreateVideoPort == NULL) 66 { 67 DPRINT1("Warning: no pfnDvpCreateVideoPort"); 68 return DDHAL_DRIVER_NOTHANDLED; 69 } 70 71 DPRINT1("Calling dxg.sys pfnDvpCreateVideoPort"); 72 return pfnDvpCreateVideoPort(hDirectDraw, puCreateVPortData); 73 } 74 75 /************************************************************************/ 76 /* NtGdiDvpDestroyVideoPort */ 77 /************************************************************************/ 78 DWORD 79 APIENTRY 80 NtGdiDvpDestroyVideoPort(HANDLE hVideoPort, 81 PDD_DESTROYVPORTDATA puDestroyVPortData) 82 { 83 PGD_DVPDESTROYVIDEOPORT pfnDvpDestroyVideoPort = (PGD_DVPDESTROYVIDEOPORT)gpDxFuncs[DXG_INDEX_DxDvpDestroyVideoPort].pfn; 84 85 if (pfnDvpDestroyVideoPort == NULL) 86 { 87 DPRINT1("Warning: no pfnDvpDestroyVideoPort"); 88 return DDHAL_DRIVER_NOTHANDLED; 89 } 90 91 DPRINT1("Calling dxg.sys pfnDvpDestroyVideoPort"); 92 return pfnDvpDestroyVideoPort(hVideoPort, puDestroyVPortData); 93 } 94 95 /************************************************************************/ 96 /* NtGdiDvpFlipVideoPort */ 97 /************************************************************************/ 98 DWORD 99 APIENTRY 100 NtGdiDvpFlipVideoPort(HANDLE hVideoPort, 101 HANDLE hDDSurfaceCurrent, 102 HANDLE hDDSurfaceTarget, 103 PDD_FLIPVPORTDATA puFlipVPortData) 104 { 105 PGD_DVPFLIPVIDEOPORT pfnDvpFlipVideoPort = (PGD_DVPFLIPVIDEOPORT)gpDxFuncs[DXG_INDEX_DxDvpFlipVideoPort].pfn; 106 107 if (pfnDvpFlipVideoPort == NULL) 108 { 109 DPRINT1("Warning: no pfnDvpFlipVideoPort"); 110 return DDHAL_DRIVER_NOTHANDLED; 111 } 112 113 DPRINT1("Calling dxg.sys pfnDvpFlipVideoPort"); 114 return pfnDvpFlipVideoPort(hVideoPort, hDDSurfaceCurrent, hDDSurfaceTarget, puFlipVPortData); 115 } 116 117 118 /************************************************************************/ 119 /* NtGdiDvpGetVideoPortBandwidth */ 120 /************************************************************************/ 121 DWORD 122 APIENTRY 123 NtGdiDvpGetVideoPortBandwidth(HANDLE hVideoPort, 124 PDD_GETVPORTBANDWIDTHDATA puGetVPortBandwidthData) 125 { 126 PGD_DVPGETVIDEOPORTBANDWITH pfnDvpGetVideoPortBandwidth = (PGD_DVPGETVIDEOPORTBANDWITH)gpDxFuncs[DXG_INDEX_DxDvpGetVideoPortBandwidth].pfn; 127 128 if (pfnDvpGetVideoPortBandwidth == NULL) 129 { 130 DPRINT1("Warning: no pfnDvpGetVideoPortBandwidth"); 131 return DDHAL_DRIVER_NOTHANDLED; 132 } 133 134 DPRINT1("Calling dxg.sys pfnDvpGetVideoPortBandwidth"); 135 return pfnDvpGetVideoPortBandwidth(hVideoPort, puGetVPortBandwidthData); 136 } 137 138 139 /************************************************************************/ 140 /* NtGdiDvpGetVideoPortFlipStatus */ 141 /************************************************************************/ 142 DWORD 143 APIENTRY 144 NtGdiDvpGetVideoPortFlipStatus(HANDLE hDirectDraw, 145 PDD_GETVPORTFLIPSTATUSDATA puGetVPortFlipStatusData) 146 { 147 PGD_DXDVPGETVIDEOPORTFLIPSTATUS pfnDvpGetVideoPortFlipStatus = (PGD_DXDVPGETVIDEOPORTFLIPSTATUS)gpDxFuncs[DXG_INDEX_DxDvpGetVideoPortFlipStatus].pfn; 148 149 if (pfnDvpGetVideoPortFlipStatus == NULL) 150 { 151 DPRINT1("Warning: no pfnDvpGetVideoPortFlipStatus"); 152 return DDHAL_DRIVER_NOTHANDLED; 153 } 154 155 DPRINT1("Calling dxg.sys pfnDvpGetVideoPortFlipStatus"); 156 return pfnDvpGetVideoPortFlipStatus(hDirectDraw, puGetVPortFlipStatusData); 157 } 158 159 160 /************************************************************************/ 161 /* NtGdiDvpGetVideoPortInputFormats */ 162 /************************************************************************/ 163 DWORD 164 APIENTRY 165 NtGdiDvpGetVideoPortInputFormats(HANDLE hVideoPort, 166 PDD_GETVPORTINPUTFORMATDATA puGetVPortInputFormatData) 167 { 168 PGD_DXDVPGETVIDEOPORTINPUTFORMATS pfnDvpGetVideoPortInputFormats = (PGD_DXDVPGETVIDEOPORTINPUTFORMATS)gpDxFuncs[DXG_INDEX_DxDvpGetVideoPortInputFormats].pfn; 169 170 if (pfnDvpGetVideoPortInputFormats == NULL) 171 { 172 DPRINT1("Warning: no pfnDvpGetVideoPortInputFormats"); 173 return DDHAL_DRIVER_NOTHANDLED; 174 } 175 176 DPRINT1("Calling dxg.sys pfnDvpGetVideoPortInputFormats"); 177 return pfnDvpGetVideoPortInputFormats(hVideoPort, puGetVPortInputFormatData); 178 } 179 180 181 /************************************************************************/ 182 /* NtGdiDvpGetVideoPortLine */ 183 /************************************************************************/ 184 DWORD 185 APIENTRY 186 NtGdiDvpGetVideoPortLine(HANDLE hVideoPort, 187 PDD_GETVPORTLINEDATA puGetVPortLineData) 188 { 189 PGD_DXDVPGETVIDEOPORTLINE pfnDvpGetVideoPortLine = (PGD_DXDVPGETVIDEOPORTLINE)gpDxFuncs[DXG_INDEX_DxDvpGetVideoPortLine].pfn; 190 191 if (pfnDvpGetVideoPortLine == NULL) 192 { 193 DPRINT1("Warning: no pfnDvpGetVideoPortLine"); 194 return DDHAL_DRIVER_NOTHANDLED; 195 } 196 197 DPRINT1("Calling dxg.sys pfnDvpGetVideoPortLine"); 198 return pfnDvpGetVideoPortLine(hVideoPort, puGetVPortLineData); 199 } 200 201 202 /************************************************************************/ 203 /* NtGdiDvpGetVideoPortOutputFormats */ 204 /************************************************************************/ 205 DWORD 206 APIENTRY 207 NtGdiDvpGetVideoPortOutputFormats(HANDLE hVideoPort, 208 PDD_GETVPORTOUTPUTFORMATDATA puGetVPortOutputFormatData) 209 { 210 PGD_DXDVPGETVIDEOPORTOUTPUTFORMATS pfnDvpGetVideoPortOutputFormats = (PGD_DXDVPGETVIDEOPORTOUTPUTFORMATS)gpDxFuncs[DXG_INDEX_DxDvpGetVideoPortOutputFormats].pfn; 211 212 if (pfnDvpGetVideoPortOutputFormats == NULL) 213 { 214 DPRINT1("Warning: no pfnDvpGetVideoPortOutputFormats"); 215 return DDHAL_DRIVER_NOTHANDLED; 216 } 217 218 DPRINT1("Calling dxg.sys pfnDvpGetVideoPortOutputFormats"); 219 return pfnDvpGetVideoPortOutputFormats(hVideoPort, puGetVPortOutputFormatData); 220 221 } 222 223 224 /************************************************************************/ 225 /* NtGdiDvpGetVideoPortConnectInfo */ 226 /************************************************************************/ 227 DWORD 228 APIENTRY 229 NtGdiDvpGetVideoPortConnectInfo(HANDLE hDirectDraw, 230 PDD_GETVPORTCONNECTDATA puGetVPortConnectData) 231 { 232 PGD_DXDVPGETVIDEOPORTCONNECTINFO pfnDvpGetVideoPortConnectInfo = (PGD_DXDVPGETVIDEOPORTCONNECTINFO)gpDxFuncs[DXG_INDEX_DxDvpGetVideoPortConnectInfo].pfn; 233 234 if (pfnDvpGetVideoPortConnectInfo == NULL) 235 { 236 DPRINT1("Warning: no pfnDvpGetVideoPortConnectInfo"); 237 return DDHAL_DRIVER_NOTHANDLED; 238 } 239 240 DPRINT1("Calling dxg.sys pfnDvpGetVideoPortConnectInfo"); 241 return pfnDvpGetVideoPortConnectInfo(hDirectDraw, puGetVPortConnectData); 242 } 243 244 245 /************************************************************************/ 246 /* NtGdiDvpGetVideoSignalStatus */ 247 /************************************************************************/ 248 DWORD 249 APIENTRY 250 NtGdiDvpGetVideoSignalStatus(HANDLE hVideoPort, 251 PDD_GETVPORTSIGNALDATA puGetVPortSignalData) 252 { 253 PGD_DXDVPGETVIDEOSIGNALSTATUS pfnDvpGetVideoSignalStatus = (PGD_DXDVPGETVIDEOSIGNALSTATUS)gpDxFuncs[DXG_INDEX_DxDvpGetVideoSignalStatus].pfn; 254 255 if (pfnDvpGetVideoSignalStatus == NULL) 256 { 257 DPRINT1("Warning: no pfnDvpGetVideoSignalStatus"); 258 return DDHAL_DRIVER_NOTHANDLED; 259 } 260 261 DPRINT1("Calling dxg.sys pfnDvpGetVideoSignalStatus"); 262 return pfnDvpGetVideoSignalStatus(hVideoPort, puGetVPortSignalData); 263 264 } 265 266 267 /************************************************************************/ 268 /* NtGdiDvpUpdateVideoPort */ 269 /************************************************************************/ 270 DWORD 271 APIENTRY 272 NtGdiDvpUpdateVideoPort(HANDLE hVideoPort, 273 HANDLE* phSurfaceVideo, 274 HANDLE* phSurfaceVbi, 275 PDD_UPDATEVPORTDATA puUpdateVPortData) 276 { 277 PGD_DXDVPUPDATEVIDEOPORT pfnDvpUpdateVideoPort = (PGD_DXDVPUPDATEVIDEOPORT)gpDxFuncs[DXG_INDEX_DxDvpUpdateVideoPort].pfn; 278 279 if (pfnDvpUpdateVideoPort == NULL) 280 { 281 DPRINT1("Warning: no pfnDvpUpdateVideoPort"); 282 return DDHAL_DRIVER_NOTHANDLED; 283 } 284 285 DPRINT1("Calling dxg.sys pfnDvpUpdateVideoPort"); 286 return pfnDvpUpdateVideoPort(hVideoPort, phSurfaceVideo, phSurfaceVbi, puUpdateVPortData); 287 288 } 289 290 291 /************************************************************************/ 292 /* NtGdiDvpWaitForVideoPortSync */ 293 /************************************************************************/ 294 DWORD 295 APIENTRY 296 NtGdiDvpWaitForVideoPortSync(HANDLE hVideoPort, 297 PDD_WAITFORVPORTSYNCDATA puWaitForVPortSyncData) 298 { 299 PGD_DXDVPWAITFORVIDEOPORTSYNC pfnDvpWaitForVideoPortSync = (PGD_DXDVPWAITFORVIDEOPORTSYNC)gpDxFuncs[DXG_INDEX_DxDvpWaitForVideoPortSync].pfn; 300 301 if (pfnDvpWaitForVideoPortSync == NULL) 302 { 303 DPRINT1("Warning: no pfnDvpWaitForVideoPortSync"); 304 return DDHAL_DRIVER_NOTHANDLED; 305 } 306 307 DPRINT1("Calling dxg.sys pfnDvpWaitForVideoPortSync"); 308 return pfnDvpWaitForVideoPortSync(hVideoPort, puWaitForVPortSyncData); 309 } 310 311 312 /************************************************************************/ 313 /* NtGdiDvpAcquireNotification */ 314 /************************************************************************/ 315 DWORD 316 APIENTRY 317 NtGdiDvpAcquireNotification(HANDLE hVideoPort, 318 HANDLE* hEvent, 319 LPDDVIDEOPORTNOTIFY pNotify) 320 { 321 PGD_DXDVPACQUIRENOTIFICATION pfnDvpAcquireNotification = (PGD_DXDVPACQUIRENOTIFICATION)gpDxFuncs[DXG_INDEX_DxDvpAcquireNotification].pfn; 322 323 if (pfnDvpAcquireNotification == NULL) 324 { 325 DPRINT1("Warning: no pfnDvpAcquireNotification"); 326 return DDHAL_DRIVER_NOTHANDLED; 327 } 328 329 DPRINT1("Calling dxg.sys pfnDvpAcquireNotification"); 330 return pfnDvpAcquireNotification(hVideoPort, hEvent, pNotify); 331 } 332 333 334 /************************************************************************/ 335 /* NtGdiDvpReleaseNotification */ 336 /************************************************************************/ 337 DWORD 338 APIENTRY 339 NtGdiDvpReleaseNotification(HANDLE hVideoPort, 340 HANDLE hEvent) 341 { 342 PGD_DXDVPRELEASENOTIFICATION pfnDvpReleaseNotification = (PGD_DXDVPRELEASENOTIFICATION)gpDxFuncs[DXG_INDEX_DxDvpReleaseNotification].pfn; 343 344 if (pfnDvpReleaseNotification == NULL) 345 { 346 DPRINT1("Warning: no pfnDvpReleaseNotification"); 347 return DDHAL_DRIVER_NOTHANDLED; 348 } 349 350 DPRINT1("Calling dxg.sys pfnDvpReleaseNotification"); 351 return pfnDvpReleaseNotification(hVideoPort, hEvent); 352 353 } 354 355 356 /************************************************************************/ 357 /* NtGdiDvpGetVideoPortField */ 358 /************************************************************************/ 359 DWORD 360 APIENTRY 361 NtGdiDvpGetVideoPortField(HANDLE hVideoPort, 362 PDD_GETVPORTFIELDDATA puGetVPortFieldData) 363 { 364 PGD_DXDVPGETVIDEOPORTFIELD pfnDvpGetVideoPortField = (PGD_DXDVPGETVIDEOPORTFIELD)gpDxFuncs[DXG_INDEX_DxDvpGetVideoPortField].pfn; 365 366 if (pfnDvpGetVideoPortField == NULL) 367 { 368 DPRINT1("Warning: no pfnDvpGetVideoPortField"); 369 return DDHAL_DRIVER_NOTHANDLED; 370 } 371 372 DPRINT1("Calling dxg.sys pfnDvpGetVideoPortField"); 373 return pfnDvpGetVideoPortField(hVideoPort, puGetVPortFieldData); 374 375 } 376