Reactos
at master 325 lines 6.0 kB view raw
1 2/* 3 * COPYRIGHT: See COPYING in the top level directory 4 * PROJECT: ReactOS kernel 5 * PURPOSE: Native driver for dxg implementation 6 * FILE: win32ss/reactx/dxapi/main.c 7 * PROGRAMER: Magnus olsen (magnus@greatlord.com) 8 * REVISION HISTORY: 9 * 15/10-2007 Magnus Olsen 10 */ 11 12 13#include "dxapi_driver.h" 14 15#define NDEBU /* debug prints are enabled, add a G at the end to disable it ;-) */ 16#include <debug.h> 17 18NTSTATUS NTAPI 19DriverEntry(IN PVOID Context1, 20 IN PVOID Context2) 21{ 22 /* 23 * NOTE this driver will never be load, it only contain export list 24 * to win32k eng functions 25 */ 26 return STATUS_SUCCESS; 27} 28 29/*++ 30* @name DxApiGetVersion 31* @implemented 32* 33* The function DxApiGetVersion return the dsound version, and it always return 4.02 34* 35* @return 36* Always return 4.02 37* 38* @remarks. 39* none 40* 41*--*/ 42ULONG 43NTAPI 44DxApiGetVersion(VOID) 45{ 46 /* MSDN say this always return Direct Sound version 4.02 */ 47 return 0x402; 48} 49 50 51 52/*++ 53* @name DxApi 54* @implemented 55* 56* The function DxApi calls to diffent functions, follow functions 57* are supported 58* DxGetVersionNumber, DxCloseHandle, DxOpenDirectDraw, DxOpenSurface, 59* DxOpenVideoPort, DxGetKernelCaps, DxGetFieldNumber, DxSetFieldNumber, 60* DxSetSkipPattern, DxGetSurfaceState, DxSetSurfaceState, DxLock, 61* DxFlipOverlay, DxFlipVideoPort, DxGetCurrentAutoflip, DxGetPreviousAutoflip, 62* DxRegisterEvent, DxUnregisterEvent, DxGetPolarity, DxOpenVpCatureDevice, 63* DxAddVpCaptureBuffer, DxFlushVpCaptureBuffs 64* 65* See ddkmapi.h as well 66 67* 68* @param ULONG dwFunctionNum 69* The function id we want call on in the dxapi.sys see ddkmapi.h for the id 70* 71* @param PVOID lpvInBuffer 72* Our input buffer to the functions we call to, This param can be NULL 73* 74* @param ULONG cbInBuffer 75* Our size in bytes of the input buffer, rember wrong size will result in the function 76* does not being call. 77* 78* @param PVOID lpvOutBuffer 79* Our Output buffer, there the function fill in the info, this param can not 80* be null. if it null the functions we trying call on will not be call 81* 82* @param ULONG cbOutBuffer 83* Our size in bytes of the output buffer, rember wrong size will result in the function 84* does not being call. 85* 86* @return 87* Return Always 0. 88* 89* @remarks. 90* before call to any of this functions, do not forget set lpvOutBuffer->ddRVal = DDERR_GEN*, 91* if that member exists in the outbuffer ; 92* 93*--*/ 94 95DWORD 96NTAPI 97DxApi(IN DWORD dwFunctionNum, 98 IN LPVOID lpvInBuffer, 99 IN DWORD cbInBuffer, 100 OUT LPVOID lpvOutBuffer, 101 OUT DWORD cbOutBuffer) 102{ 103 104 dwFunctionNum -= DD_FIRST_DXAPI; 105 106 if ((lpvOutBuffer == NULL) || 107 /*(dwFunctionNum < (DD_FIRST_DXAPI - DD_FIRST_DXAPI)) ||*/ 108 (dwFunctionNum > (DD_DXAPI_FLUSHVPCAPTUREBUFFERS - DD_FIRST_DXAPI)) || 109 (gDxApiEntryPoint[dwFunctionNum].pfn == NULL) || 110 (cbInBuffer != tblCheckInBuffer[dwFunctionNum]) || 111 (cbOutBuffer != tblCheckOutBuffer[dwFunctionNum])) 112 113 { 114 return 0; 115 } 116 117 gDxApiEntryPoint[dwFunctionNum].pfn(lpvInBuffer, lpvOutBuffer); 118 return 0; 119} 120 121VOID 122NTAPI 123DxApiInitialize ( 124 PVOID p1, 125 PVOID p2, 126 PVOID p3, 127 PVOID p4, 128 PVOID p5, 129 PVOID p6, 130 PVOID p7, 131 PVOID p8) 132{ 133 UNIMPLEMENTED; 134} 135 136VOID 137NTAPI 138DxAutoflipUpdate ( 139 PVOID p1, 140 PVOID p2, 141 PVOID p3, 142 PVOID p4, 143 PVOID p5) 144{ 145 UNIMPLEMENTED; 146} 147 148VOID 149NTAPI 150DxEnableIRQ ( 151 PVOID p1, 152 PVOID p2) 153{ 154 UNIMPLEMENTED; 155} 156 157VOID 158NTAPI 159DxLoseObject ( 160 PVOID p1, 161 PVOID p2) 162{ 163 UNIMPLEMENTED; 164} 165 166VOID 167NTAPI 168DxUpdateCapture ( 169 PVOID p1, 170 PVOID p2, 171 PVOID p3) 172{ 173 UNIMPLEMENTED; 174} 175 176 177/*++ 178* @name DxGetVersionNumber 179* @implemented 180* 181* The function DxGetVersionNumber return dxapi interface version, that is 1.0 182* 183* @return 184* Always return 1.0 185* 186* @remarks. 187* none 188* 189*--*/ 190VOID 191DxGetVersionNumber(PVOID lpvInBuffer, LPDDGETVERSIONNUMBER lpvOutBuffer) 192{ 193 lpvOutBuffer->ddRVal = DD_OK; 194 lpvOutBuffer->dwMajorVersion = 1; 195 lpvOutBuffer->dwMinorVersion = 0; 196} 197 198VOID 199DxCloseHandle(PVOID lpvInBuffer, PVOID lpvOutBuffer) 200{ 201 /* FIXME Unimplement */ 202} 203 204VOID 205DxOpenDirectDraw(PVOID lpvInBuffer, PVOID lpvOutBuffer) 206{ 207 /* FIXME Unimplement */ 208} 209 210VOID 211DxOpenSurface(PVOID lpvInBuffer, PVOID lpvOutBuffer) 212{ 213 /* FIXME Unimplement */ 214} 215 216VOID 217DxOpenVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer) 218{ 219 /* FIXME Unimplement */ 220} 221 222VOID 223DxGetKernelCaps(PVOID lpvInBuffer, PVOID lpvOutBuffer) 224{ 225 /* FIXME Unimplement */ 226} 227 228VOID 229DxGetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer) 230{ 231 /* FIXME Unimplement */ 232} 233 234VOID 235DxSetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer) 236{ 237 /* FIXME Unimplement */ 238} 239 240VOID 241DxSetSkipPattern(PVOID lpvInBuffer, PVOID lpvOutBuffer) 242{ 243 /* FIXME Unimplement */ 244} 245 246VOID 247DxGetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer) 248{ 249 /* FIXME Unimplement */ 250} 251 252VOID 253DxSetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer) 254{ 255 /* FIXME Unimplement */ 256} 257 258VOID 259DxLock(PVOID lpvInBuffer, PVOID lpvOutBuffer) 260{ 261 /* FIXME Unimplement */ 262} 263 264VOID 265DxFlipOverlay(PVOID lpvInBuffer, PVOID lpvOutBuffer) 266{ 267 /* FIXME Unimplement */ 268} 269 270VOID 271DxFlipVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer) 272{ 273 /* FIXME Unimplement */ 274} 275 276VOID 277DxGetCurrentAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer) 278{ 279 /* FIXME Unimplement */ 280} 281 282VOID 283DxGetPreviousAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer) 284{ 285 /* FIXME Unimplement */ 286} 287 288VOID 289DxRegisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer) 290{ 291 /* FIXME Unimplement */ 292} 293 294VOID 295DxUnregisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer) 296{ 297 /* FIXME Unimplement */ 298} 299 300VOID 301DxGetPolarity(PVOID lpvInBuffer, PVOID lpvOutBuffer) 302{ 303 /* FIXME Unimplement */ 304} 305 306VOID 307DxOpenVpCatureDevice(PVOID lpvInBuffer, PVOID lpvOutBuffer) 308{ 309 /* FIXME Unimplement */ 310} 311 312VOID 313DxAddVpCaptureBuffer(PVOID lpvInBuffer, PVOID lpvOutBuffer) 314{ 315 /* FIXME Unimplement */ 316} 317 318VOID 319DxFlushVpCaptureBuffs(PVOID lpvInBuffer, PVOID lpvOutBuffer) 320{ 321 /* FIXME Unimplement */ 322} 323 324 325