windowscodecs: Silence fixme for IID_CMetaBitmapRenderTarget.
[wine.git] / dlls / opengl32 / unix_private.h
blob7f64af3e30ffa4e53646b583854413a1ee33d233
1 /*
2 * Copyright (c) 2000 Lionel Ulmer
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 #ifndef __WINE_OPENGL32_UNIX_PRIVATE_H
19 #define __WINE_OPENGL32_UNIX_PRIVATE_H
21 #include <stdarg.h>
22 #include <stddef.h>
23 #include <stdlib.h>
25 #include "ntstatus.h"
26 #define WIN32_NO_STATUS
27 #include "windef.h"
28 #include "winbase.h"
29 #include "winternl.h"
30 #include "wingdi.h"
31 #include "ntgdi.h"
33 #include "wine/wgl.h"
34 #include "wine/wgl_driver.h"
36 struct registry_entry
38 const char *name; /* name of the extension */
39 const char *extension; /* name of the GL/WGL extension */
42 extern const struct registry_entry extension_registry[];
43 extern const int extension_registry_size;
45 extern struct opengl_funcs null_opengl_funcs;
47 static inline const struct opengl_funcs *get_dc_funcs( HDC hdc )
49 const struct opengl_funcs *funcs = __wine_get_wgl_driver( hdc, WINE_WGL_DRIVER_VERSION );
50 if (!funcs) RtlSetLastWin32Error( ERROR_INVALID_HANDLE );
51 else if (funcs == (void *)-1) funcs = &null_opengl_funcs;
52 return funcs;
55 static inline void *copy_wow64_ptr32s( UINT_PTR address, ULONG count )
57 ULONG *ptrs = (ULONG *)address;
58 void **tmp;
60 if (!ptrs || !(tmp = calloc( count, sizeof(*tmp) ))) return NULL;
61 while (count--) tmp[count] = ULongToPtr(ptrs[count]);
62 return tmp;
65 static inline TEB *get_teb64( ULONG teb32 )
67 TEB32 *teb32_ptr = ULongToPtr( teb32 );
68 return (TEB *)((char *)teb32_ptr + teb32_ptr->WowTebOffset);
71 #endif /* __WINE_OPENGL32_UNIX_PRIVATE_H */