From 54992254d7a2acf2e4829c536c86dc00a4f9c5f3 Mon Sep 17 00:00:00 2001 From: Gregor Anich Date: Thu, 3 Nov 2005 00:15:39 +0000 Subject: [PATCH] Replace EXT_QUERY_OPENGLDRIVERINFO define by OPENGL_GETINFO from winddi.h Rename EXT_OPENGLDRIVERINFO struct to OPENGL_INFO and change member names a bit. svn path=/trunk/; revision=18965 --- reactos/lib/opengl32/wgl.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/reactos/lib/opengl32/wgl.c b/reactos/lib/opengl32/wgl.c index b8c2671c1cf..b96a305340f 100644 --- a/reactos/lib/opengl32/wgl.c +++ b/reactos/lib/opengl32/wgl.c @@ -11,10 +11,18 @@ #define WIN32_LEAN_AND_MEAN #define WIN32_NO_STATUS #include + +#define NTOS_MODE_USER +#include +#include +#include + #include #include #include + #include "teb.h" + #define OPENGL32_GL_FUNC_PROTOTYPES #include "opengl32.h" @@ -27,13 +35,12 @@ extern "C" { #endif -#define EXT_QUERY_OPENGLDRIVERINFO 0x1101 /*!< ExtEscape code to get driver info */ -typedef struct tagEXT_OPENGLDRIVERINFO +typedef struct _OPENGL_INFO { - DWORD version; /*!< Driver interface version */ - DWORD driver_version; /*!< Driver version */ - WCHAR driver_name[256]; /*!< Driver name */ -} EXT_OPENGLDRIVERINFO; + DWORD Version; /*!< Driver interface version */ + DWORD DriverVersion; /*!< Driver version */ + WCHAR DriverName[256]; /*!< Driver name */ +} OPENGL_INFO, *POPENGL_INFO; /*! \brief Append OpenGL Rendering Context (GLRC) to list @@ -295,7 +302,7 @@ ROSGL_ICDForHDC( HDC hdc ) if (dcdata->icd == NULL) { LPCWSTR driverName; - EXT_OPENGLDRIVERINFO info; + OPENGL_INFO info; driverName = _wgetenv( L"OPENGL32_DRIVER" ); if (driverName == NULL) @@ -304,13 +311,13 @@ ROSGL_ICDForHDC( HDC hdc ) LONG ret; /* get driver name */ - dwInput = EXT_QUERY_OPENGLDRIVERINFO; + dwInput = OPENGL_GETINFO; ret = ExtEscape( hdc, QUERYESCSUPPORT, sizeof (dwInput), (LPCSTR)&dwInput, 0, NULL ); if (ret > 0) { dwInput = 0; - ret = ExtEscape( hdc, EXT_QUERY_OPENGLDRIVERINFO, sizeof (dwInput), - (LPCSTR)&dwInput, sizeof (EXT_OPENGLDRIVERINFO), + ret = ExtEscape( hdc, OPENGL_GETINFO, sizeof (dwInput), + (LPCSTR)&dwInput, sizeof (OPENGL_INFO), (LPSTR)&info ); } if (ret <= 0) @@ -338,8 +345,8 @@ ROSGL_ICDForHDC( HDC hdc ) } /* query value */ - size = sizeof (info.driver_name); - ret = RegQueryValueExW( hKey, L"DefaultDriver", 0, &type, (LPBYTE)info.driver_name, &size ); + size = sizeof (info.DriverName); + ret = RegQueryValueExW( hKey, L"DefaultDriver", 0, &type, (LPBYTE)info.DriverName, &size ); RegCloseKey( hKey ); if (ret != ERROR_SUCCESS || type != REG_SZ) { @@ -351,10 +358,10 @@ ROSGL_ICDForHDC( HDC hdc ) } else { - wcsncpy( info.driver_name, driverName, sizeof (info.driver_name) / sizeof (info.driver_name[0]) ); + wcsncpy( info.DriverName, driverName, sizeof (info.DriverName) / sizeof (info.DriverName[0]) ); } /* load driver (or get a reference) */ - dcdata->icd = OPENGL32_LoadICD( info.driver_name ); + dcdata->icd = OPENGL32_LoadICD( info.DriverName ); if (dcdata->icd == NULL) { WCHAR Buffer[256]; @@ -363,7 +370,7 @@ ROSGL_ICDForHDC( HDC hdc ) MessageBox(WindowFromDC( hdc ), Buffer, L"OPENGL32.dll: Warning", MB_OK | MB_ICONWARNING); - } + } } return dcdata->icd;