4 * COPYRIGHT: See COPYING in the top level directory
5 * PROJECT: ReactOS kernel
6 * PURPOSE: Native DirectDraw implementation
7 * FILE: subsys/win32k/ntddraw/dvd.c
8 * PROGRAMER: Magnus olsen (magnus@greatlord.com)
10 * 19/1-2006 Magnus Olsen
17 /************************************************************************/
18 /* HeapVidMemAllocAligned */
19 /************************************************************************/
22 HeapVidMemAllocAligned(LPVIDMEM lpVidMem
,
25 LPSURFACEALIGNMENT lpAlignment
,
28 PGD_HEAPVIDMEMALLOCALIGNED pfnHeapVidMemAllocAligned
= (PGD_HEAPVIDMEMALLOCALIGNED
)gpDxFuncs
[DXG_INDEX_DxDdHeapVidMemAllocAligned
].pfn
;
30 if (pfnHeapVidMemAllocAligned
== NULL
)
32 DPRINT1("Warning: no pfnHeapVidMemAllocAligned\n");
36 DPRINT1("Calling dxg.sys pfnHeapVidMemAllocAligned\n");
37 return pfnHeapVidMemAllocAligned(lpVidMem
, dwWidth
, dwHeight
, lpAlignment
, lpNewPitch
);
40 /************************************************************************/
42 /************************************************************************/
45 VidMemFree(LPVMEMHEAP pvmh
,
48 PGD_VIDMEMFREE pfnVidMemFree
= (PGD_VIDMEMFREE
)gpDxFuncs
[DXG_INDEX_DxDdHeapVidMemFree
].pfn
;
50 if (pfnVidMemFree
== NULL
)
52 DPRINT1("Warning: no pfnVidMemFree\n");
56 DPRINT1("Calling dxg.sys pfnVidMemFree\n");
57 pfnVidMemFree(pvmh
, ptr
);
61 /************************************************************************/
62 /* EngAllocPrivateUserMem */
63 /************************************************************************/
66 EngAllocPrivateUserMem(PDD_SURFACE_LOCAL psl
,
70 PGD_ENGALLOCPRIVATEUSERMEM pfnEngAllocPrivateUserMem
= (PGD_ENGALLOCPRIVATEUSERMEM
)gpDxFuncs
[DXG_INDEX_DxDdAllocPrivateUserMem
].pfn
;
72 if (pfnEngAllocPrivateUserMem
== NULL
)
74 DPRINT1("Warning: no pfnEngAllocPrivateUserMem\n");
75 return DDHAL_DRIVER_NOTHANDLED
;
78 DPRINT1("Calling dxg.sys pfnEngAllocPrivateUserMem\n");
79 return pfnEngAllocPrivateUserMem(psl
, cj
, tag
);
82 /************************************************************************/
83 /* EngFreePrivateUserMem */
84 /************************************************************************/
87 EngFreePrivateUserMem(PDD_SURFACE_LOCAL psl
,
90 PGD_ENGFREEPRIVATEUSERMEM pfnEngFreePrivateUserMem
= (PGD_ENGFREEPRIVATEUSERMEM
)gpDxFuncs
[DXG_INDEX_DxDdFreePrivateUserMem
].pfn
;
92 if (pfnEngFreePrivateUserMem
== NULL
)
94 DPRINT1("Warning: no pfnEngFreePrivateUserMem\n");
98 DPRINT1("Calling dxg.sys pfnEngFreePrivateUserMem\n");
99 pfnEngFreePrivateUserMem(psl
, pv
);
107 * The function EngDxIoctl is the ioctl call to different DirectX functions
108 * in the driver dxg.sys
110 * @param ULONG ulIoctl
111 * The ioctl code that we want call to
113 * @param PVOID pBuffer
114 * Our in or out buffer with data to the ioctl code we are using
116 * @param ULONG ulBufferSize
117 * The buffer size in bytes
120 * Always returns DDERR_UNSUPPORTED
123 * dxg.sys EngDxIoctl call is redirected to dxg.sys
124 * This function is no longer used in Windows NT 2000/XP/2003
129 EngDxIoctl(ULONG ulIoctl
,
133 PGD_ENGDXIOCTL pfnEngDxIoctl
= (PGD_ENGDXIOCTL
)gpDxFuncs
[DXG_INDEX_DxDdIoctl
].pfn
;
134 DWORD retVal
= DDERR_UNSUPPORTED
;
136 DPRINT1("Calling dxg.sys pfnEngDxIoctl\n");
138 if (pfnEngDxIoctl
!= NULL
)
140 retVal
= pfnEngDxIoctl(ulIoctl
, pBuffer
, ulBufferSize
);
147 * @name EngLockDirectDrawSurface
150 * The function EngUnlockDirectDrawSurface locks the DirectX surface.
152 * @param HANDLE hSurface
153 * The handle of a surface
156 * This return a vaild or NULL pointer to a PDD_SURFACE_LOCAL object
164 EngLockDirectDrawSurface(HANDLE hSurface
)
166 PGD_ENGLOCKDIRECTDRAWSURFACE pfnEngLockDirectDrawSurface
= (PGD_ENGLOCKDIRECTDRAWSURFACE
)gpDxFuncs
[DXG_INDEX_DxDdLockDirectDrawSurface
].pfn
;
167 PDD_SURFACE_LOCAL retVal
= NULL
;
169 DPRINT1("Calling dxg.sys pfnEngLockDirectDrawSurface\n");
171 if (pfnEngLockDirectDrawSurface
!= NULL
)
173 retVal
= pfnEngLockDirectDrawSurface(hSurface
);
181 * @name EngUnlockDirectDrawSurface
184 * The function EngUnlockDirectDrawSurface unlocks the DirectX surface
186 * @param PDD_SURFACE_LOCAL pSurface
187 * The Surface we want to unlock
190 * This return TRUE for success, FALSE for failure
198 EngUnlockDirectDrawSurface(PDD_SURFACE_LOCAL pSurface
)
200 PGD_ENGUNLOCKDIRECTDRAWSURFACE pfnEngUnlockDirectDrawSurface
= (PGD_ENGUNLOCKDIRECTDRAWSURFACE
)gpDxFuncs
[DXG_INDEX_DxDdUnlockDirectDrawSurface
].pfn
;
203 DPRINT1("Calling dxg.sys pfnEngUnlockDirectDrawSurface\n");
205 if (pfnEngUnlockDirectDrawSurface
!= NULL
)
207 retVal
= pfnEngUnlockDirectDrawSurface(pSurface
);