2 * ReactOS W32 Subsystem
3 * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 NtGdiAbortDoc(HDC hDC
)
58 if (Escape
== QUERYESCSUPPORT
)
79 EngSetLastError(ERROR_INVALID_HANDLE
);
83 /* TODO FIXME - don't pass umode buffer to an Int function */
84 ret
= IntGdiEscape(dc
, Escape
, InSize
, InData
, OutData
);
100 SURFACE
*psurf
= dc
->dclevel
.pSurface
;
103 if (!dc
->ppdev
->DriverFunctions
.Escape
)
109 Result
= dc
->ppdev
->DriverFunctions
.Escape(
110 psurf
? &psurf
->SurfObj
: NULL
,
125 IN OPTIONAL PWCHAR pDriver
,
129 OPTIONAL LPSTR UnsafeInData
,
131 OPTIONAL LPSTR UnsafeOutData
)
134 LPVOID SafeInData
= NULL
;
135 LPVOID SafeOutData
= NULL
;
136 NTSTATUS Status
= STATUS_SUCCESS
;
141 hDC
= UserGetWindowDC(NULL
);
144 pDC
= DC_LockDc(hDC
);
147 EngSetLastError(ERROR_INVALID_HANDLE
);
150 if ( pDC
->dctype
== DC_TYPE_INFO
)
156 if ( InSize
&& UnsafeInData
)
160 ProbeForRead(UnsafeInData
,
164 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
166 Status
= _SEH2_GetExceptionCode();
170 if (!NT_SUCCESS(Status
))
173 SetLastNtError(Status
);
177 SafeInData
= ExAllocatePoolWithTag ( PagedPool
, InSize
, TAG_PRINT
);
181 EngSetLastError(ERROR_NOT_ENOUGH_MEMORY
);
187 /* pointers were already probed! */
188 RtlCopyMemory(SafeInData
,
192 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
194 Status
= _SEH2_GetExceptionCode();
198 if ( !NT_SUCCESS(Status
) )
200 ExFreePoolWithTag ( SafeInData
, TAG_PRINT
);
202 SetLastNtError(Status
);
207 if ( OutSize
&& UnsafeOutData
)
211 ProbeForWrite(UnsafeOutData
,
215 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
217 Status
= _SEH2_GetExceptionCode();
221 if (!NT_SUCCESS(Status
))
223 SetLastNtError(Status
);
227 SafeOutData
= ExAllocatePoolWithTag ( PagedPool
, OutSize
, TAG_PRINT
);
230 EngSetLastError(ERROR_NOT_ENOUGH_MEMORY
);
233 ExFreePoolWithTag ( SafeInData
, TAG_PRINT
);
239 Result
= IntGdiExtEscape ( pDC
, Escape
, InSize
, SafeInData
, OutSize
, SafeOutData
);
244 ExFreePoolWithTag ( SafeInData
,TAG_PRINT
);
250 /* pointers were already probed! */
251 RtlCopyMemory(UnsafeOutData
,
255 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
257 Status
= _SEH2_GetExceptionCode();
261 ExFreePoolWithTag ( SafeOutData
, TAG_PRINT
);
262 if ( !NT_SUCCESS(Status
) )
264 SetLastNtError(Status
);
286 NtGdiStartPage(HDC hDC
)