- Wooops, fix dxg and dxapi build after 42346.
[reactos.git] / reactos / drivers / directx / dxg / dxg_int.h
1
2 /* DDK/NDK/SDK Headers */
3 #include <ddk/ntddk.h>
4 #include <ddk/ntddmou.h>
5 #include <ddk/ntifs.h>
6 #include <ddk/tvout.h>
7 #include <ndk/ntndk.h>
8
9 /* Win32 Headers */
10 #define WINBASEAPI
11 #define STARTF_USESIZE 2
12 #define STARTF_USEPOSITION 4
13 #define INTERNAL_CALL NTAPI
14 #define NT_BUILD_ENVIRONMENT
15
16 #include <stdarg.h>
17 #include <windef.h>
18 #include <winerror.h>
19 #include <wingdi.h>
20 #include <winddi.h>
21 #include <prntfont.h>
22 #include <dde.h>
23
24 /* DXG treats this as opaque */
25 typedef PVOID PDC;
26 typedef PVOID PW32THREAD;
27
28 typedef struct _DD_BASEOBJECT
29 {
30 HGDIOBJ hHmgr;
31 ULONG ulShareCount;
32 USHORT cExclusiveLock;
33 USHORT BaseFlags;
34 PW32THREAD Tid;
35 } DD_BASEOBJECT, *PDD_BASEOBJECT;
36
37 #include <drivers/directx/directxint.h>
38 #include <drivers/directx/dxg.h>
39 #include <drivers/directx/dxeng.h>
40
41 #include "tags.h"
42
43 #define ObjType_DDSURFACE_TYPE 2
44 #define ObjType_DDVIDEOPORT_TYPE 4
45 #define ObjType_DDMOTIONCOMP_TYPE 5
46
47 typedef struct _DD_ENTRY
48 {
49 union
50 {
51 PDD_BASEOBJECT pobj;
52 HANDLE hFree;
53 };
54 union
55 {
56 ULONG ulObj;
57 struct
58 {
59 USHORT Count;
60 USHORT Lock;
61 HANDLE Pid;
62 };
63 } ObjectOwner;
64 USHORT FullUnique;
65 UCHAR Objt;
66 UCHAR Flags;
67 PVOID pUser;
68 } DD_ENTRY, *PDD_ENTRY;
69
70 typedef struct _EDD_SURFACE_LOCAL
71 {
72 DD_BASEOBJECT Object;
73 DD_SURFACE_LOCAL Surfacelcl;
74 } EDD_SURFACE_LOCAL, *PEDD_SURFACE_LOCAL;
75
76 /* exported functions */
77 NTSTATUS NTAPI DriverEntry(IN PVOID Context1, IN PVOID Context2);
78 NTSTATUS NTAPI GsDriverEntry(IN PVOID Context1, IN PVOID Context2);
79 NTSTATUS APIENTRY DxDdCleanupDxGraphics();
80
81 /* Global pointers */
82 extern ULONG gcSizeDdHmgr;
83 extern PDD_ENTRY gpentDdHmgr;
84 extern ULONG gcMaxDdHmgr;
85 extern PDD_ENTRY gpentDdHmgrLast;
86 extern HANDLE ghFreeDdHmgr;
87 extern HSEMAPHORE ghsemHmgr;
88 extern LONG gcDummyPageRefCnt;
89 extern HSEMAPHORE ghsemDummyPage;
90 extern VOID *gpDummyPage;
91 extern PEPROCESS gpepSession;
92 extern PLARGE_INTEGER gpLockShortDelay;
93
94 /* Driver list export functions */
95 DWORD NTAPI DxDxgGenericThunk(ULONG_PTR ulIndex, ULONG_PTR ulHandle, SIZE_T *pdwSizeOfPtr1, PVOID pvPtr1, SIZE_T *pdwSizeOfPtr2, PVOID pvPtr2);
96 DWORD NTAPI DxDdIoctl(ULONG ulIoctl, PVOID pBuffer, ULONG ulBufferSize);
97 PDD_SURFACE_LOCAL NTAPI DxDdLockDirectDrawSurface(HANDLE hDdSurface);
98 BOOL NTAPI DxDdUnlockDirectDrawSurface(PDD_SURFACE_LOCAL pSurface);
99
100 /* Internal functions */
101 BOOL FASTCALL VerifyObjectOwner(PDD_ENTRY pEntry);
102 BOOL FASTCALL DdHmgCreate();
103 BOOL FASTCALL DdHmgDestroy();
104 PVOID FASTCALL DdHmgLock( HANDLE DdHandle, UCHAR ObjectType, BOOLEAN LockOwned);
105
106 /* define stuff */
107 #define drvDxEngLockDC gpEngFuncs[DXENG_INDEX_DxEngLockDC]
108 #define drvDxEngGetDCState gpEngFuncs[DXENG_INDEX_DxEngGetDCState]
109 #define drvDxEngGetHdevData gpEngFuncs[DXENG_INDEX_DxEngGetHdevData]
110 #define drvDxEngUnlockDC gpEngFuncs[DXENG_INDEX_DxEngUnlockDC]
111 #define drvDxEngUnlockHdev gpEngFuncs[DXENG_INDEX_DxEngUnlockHdev]
112 #define drvDxEngLockHdev gpEngFuncs[DXENG_INDEX_DxEngLockHdev]
113