-/*\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Lesser General Public\r
- * License as published by the Free Software Foundation; either\r
- * version 2.1 of the License, or (at your option) any later version.\r
- *\r
- * This library is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
- * Lesser General Public License for more details.\r
- *\r
- * You should have received a copy of the GNU Lesser General Public\r
- * License along with this library; if not, write to the Free Software\r
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
- */\r
-/*\r
- * $Id:\r
- * COPYRIGHT: See COPYING in the top level directory\r
- * PROJECT: ReactOS GDI32\r
- * PURPOSE: Gdi DirectX inteface\r
- * FILE: lib/gdi32/misc/gdientry.c\r
- * PROGRAMER: Magnus Olsen (magnus@greatlord.com)\r
- * REVISION HISTORY: \r
- * NOTES: \r
- */\r
-\r
-\r
-#include "precomp.h"\r
-static LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobalInternal;\r
-\r
-\r
-/*\r
- * @implemented\r
- *\r
- * GDIEntry 1 \r
- */\r
-BOOL STDCALL DdCreateDirectDrawObject( \r
-LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal,\r
-HDC hdc)\r
-{ \r
- HDC newHdc;\r
- /* check see if HDC is NULL or not \r
- if it null we need create the DC */\r
-\r
- if (hdc != NULL) \r
- {\r
- pDirectDrawGlobal->hDD = (ULONG_PTR)NtGdiDdCreateDirectDrawObject(hdc); \r
- \r
- /* if hDD ==NULL */\r
- if (!pDirectDrawGlobal->hDD) \r
- {\r
- return FALSE;\r
- }\r
- return TRUE;\r
- }\r
-\r
- /* The hdc was not null we need check see if we alread \r
- have create a directdraw handler */\r
-\r
- /* if hDD !=NULL */\r
- if (pDirectDrawGlobalInternal->hDD)\r
- {\r
- /* we have create a directdraw handler already */\r
-\r
- pDirectDrawGlobal->hDD = pDirectDrawGlobalInternal->hDD;\r
- return TRUE;\r
- }\r
-\r
- /* Now we create the DC */\r
- newHdc = CreateDC(L"DISPLAY\0", NULL, NULL, NULL);\r
-\r
- /* we are checking if we got a hdc or not */\r
- if ((ULONG_PTR)newHdc != pDirectDrawGlobalInternal->hDD)\r
- {\r
- pDirectDrawGlobalInternal->hDD = (ULONG_PTR) NtGdiDdCreateDirectDrawObject(newHdc);\r
- NtGdiDeleteDC(newHdc);\r
- }\r
-\r
- pDirectDrawGlobal->hDD = pDirectDrawGlobalInternal->hDD;\r
-\r
- /* test see if we got a handler */\r
- if (!pDirectDrawGlobalInternal->hDD)\r
- { \r
- return FALSE;\r
- }\r
-\r
- return TRUE;\r
-}\r
-\r
-/*\r
- * @implemented\r
- *\r
- * GDIEntry 3\r
- */\r
-BOOL STDCALL DdDeleteDirectDrawObject( \r
-LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal\r
-)\r
-{\r
- /* if pDirectDrawGlobal->hDD == NULL and pDirectDrawGlobalInternal->hDD == NULL\r
- return false */\r
-\r
- if (!pDirectDrawGlobal->hDD)\r
- {\r
- if (!pDirectDrawGlobalInternal->hDD)\r
- {\r
- return FALSE;\r
- }\r
- return NtGdiDdDeleteDirectDrawObject((HANDLE)pDirectDrawGlobal->hDD); \r
- }\r
-\r
- return NtGdiDdDeleteDirectDrawObject((HANDLE)pDirectDrawGlobal->hDD); \r
-}\r
+/*
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+/*
+ * $Id:
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS GDI32
+ * PURPOSE: Gdi DirectX inteface
+ * FILE: lib/gdi32/misc/gdientry.c
+ * PROGRAMER: Magnus Olsen (magnus@greatlord.com)
+ * REVISION HISTORY:
+ * NOTES:
+ */
+
+
+#include "precomp.h"
+static LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobalInternal;
+
+
+/*
+ * @implemented
+ *
+ * GDIEntry 1
+ */
+BOOL STDCALL DdCreateDirectDrawObject(
+LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal,
+HDC hdc)
+{
+ HDC newHdc;
+ /* check see if HDC is NULL or not
+ if it null we need create the DC */
+
+ if (hdc != NULL)
+ {
+ pDirectDrawGlobal->hDD = (ULONG_PTR)NtGdiDdCreateDirectDrawObject(hdc);
+
+ /* if hDD ==NULL */
+ if (!pDirectDrawGlobal->hDD)
+ {
+ return FALSE;
+ }
+ return TRUE;
+ }
+
+ /* The hdc was not null we need check see if we alread
+ have create a directdraw handler */
+
+ /* if hDD !=NULL */
+ if (pDirectDrawGlobalInternal->hDD)
+ {
+ /* we have create a directdraw handler already */
+
+ pDirectDrawGlobal->hDD = pDirectDrawGlobalInternal->hDD;
+ return TRUE;
+ }
+
+ /* Now we create the DC */
+ newHdc = CreateDC(L"DISPLAY\0", NULL, NULL, NULL);
+
+ /* we are checking if we got a hdc or not */
+ if ((ULONG_PTR)newHdc != pDirectDrawGlobalInternal->hDD)
+ {
+ pDirectDrawGlobalInternal->hDD = (ULONG_PTR) NtGdiDdCreateDirectDrawObject(newHdc);
+ NtGdiDeleteDC(newHdc);
+ }
+
+ pDirectDrawGlobal->hDD = pDirectDrawGlobalInternal->hDD;
+
+ /* test see if we got a handler */
+ if (!pDirectDrawGlobalInternal->hDD)
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*
+ * @implemented
+ *
+ * GDIEntry 3
+ */
+BOOL STDCALL DdDeleteDirectDrawObject(
+LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal
+)
+{
+ /* if pDirectDrawGlobal->hDD == NULL and pDirectDrawGlobalInternal->hDD == NULL
+ return false */
+
+ if (!pDirectDrawGlobal->hDD)
+ {
+ if (!pDirectDrawGlobalInternal->hDD)
+ {
+ return FALSE;
+ }
+ return NtGdiDdDeleteDirectDrawObject((HANDLE)pDirectDrawGlobal->hDD);
+ }
+
+ return NtGdiDdDeleteDirectDrawObject((HANDLE)pDirectDrawGlobal->hDD);
+}