[WIN32K]
[reactos.git] / subsystems / win32 / win32k / objects / device.c
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: Functions for creation and destruction of DCs
5 * FILE: subsystem/win32/win32k/objects/device.c
6 * PROGRAMER: Timo Kreuzer (timo.kreuzer@rectos.org)
7 */
8
9 #include <w32k.h>
10
11 #define NDEBUG
12 #include <debug.h>
13
14 PDC defaultDCstate = NULL;
15
16 VOID FASTCALL
17 IntGdiReferencePdev(PPDEVOBJ ppdev)
18 {
19 UNIMPLEMENTED;
20 }
21
22 VOID FASTCALL
23 IntGdiUnreferencePdev(PPDEVOBJ ppdev, DWORD CleanUpType)
24 {
25 UNIMPLEMENTED;
26 }
27
28 BOOL FASTCALL
29 IntCreatePrimarySurface()
30 {
31 SIZEL SurfSize;
32 SURFOBJ *pso;
33 BOOL calledFromUser;
34
35 calledFromUser = UserIsEntered(); //fixme: possibly upgrade a shared lock
36 if (!calledFromUser)
37 {
38 UserEnterExclusive();
39 }
40
41 /* attach monitor */
42 IntAttachMonitor(gppdevPrimary, 0);
43
44 DPRINT1("IntCreatePrimarySurface, pPrimarySurface=%p, pPrimarySurface->pSurface = %p\n",
45 pPrimarySurface, pPrimarySurface->pSurface);
46
47 /* Create surface */
48 pso = &PDEVOBJ_pSurface(pPrimarySurface)->SurfObj;
49 SurfSize = pso->sizlBitmap;
50
51 /* Put the pointer in the center of the screen */
52 gpsi->ptCursor.x = pso->sizlBitmap.cx / 2;
53 gpsi->ptCursor.y = pso->sizlBitmap.cy / 2;
54
55 co_IntShowDesktop(IntGetActiveDesktop(), SurfSize.cx, SurfSize.cy);
56
57 // Init Primary Displays Device Capabilities.
58 PDEVOBJ_vGetDeviceCaps(pPrimarySurface, &GdiHandleTable->DevCaps);
59
60 if (!calledFromUser)
61 {
62 UserLeave();
63 }
64
65 return TRUE;
66 }
67
68 VOID FASTCALL
69 IntDestroyPrimarySurface()
70 {
71 UNIMPLEMENTED;
72 }
73
74 PPDEVOBJ FASTCALL
75 IntEnumHDev(VOID)
76 {
77 // I guess we will soon have more than one primary surface.
78 // This will do for now.
79 return pPrimarySurface;
80 }
81
82
83 INT
84 APIENTRY
85 NtGdiDrawEscape(
86 IN HDC hdc,
87 IN INT iEsc,
88 IN INT cjIn,
89 IN OPTIONAL LPSTR pjIn)
90 {
91 UNIMPLEMENTED;
92 return 0;
93 }
94
95