Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c9962bbb
Commit
c9962bbb
authored
Jun 24, 2012
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Jun 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl32: Check for valid context in wglGetProcAddress.
parent
c754f28f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
opengl.c
dlls/opengl32/tests/opengl.c
+1
-1
wgl.c
dlls/opengl32/wgl.c
+10
-1
No files found.
dlls/opengl32/tests/opengl.c
View file @
c9962bbb
...
...
@@ -797,7 +797,7 @@ static void test_getprocaddress(HDC hdc)
/* Temporarily disable the context, so we can see that we can't retrieve functions now. */
wglMakeCurrent
(
hdc
,
NULL
);
func
=
wglGetProcAddress
(
"glActiveTextureARB"
);
todo_wine
ok
(
func
==
NULL
,
"Function lookup without a context passed, expected a failure; last error %#x
\n
"
,
GetLastError
());
ok
(
func
==
NULL
,
"Function lookup without a context passed, expected a failure; last error %#x
\n
"
,
GetLastError
());
wglMakeCurrent
(
hdc
,
ctx
);
}
...
...
dlls/opengl32/wgl.c
View file @
c9962bbb
...
...
@@ -300,9 +300,18 @@ PROC WINAPI wglGetProcAddress(LPCSTR lpszProc) {
TRACE
(
"(%s)
\n
"
,
lpszProc
);
if
(
lpszProc
==
NULL
)
if
(
lpszProc
==
NULL
)
return
NULL
;
/* Without an active context opengl32 doesn't know to what
* driver it has to dispatch wglGetProcAddress.
*/
if
(
wglGetCurrentContext
()
==
NULL
)
{
WARN
(
"No active WGL context found
\n
"
);
return
NULL
;
}
/* First, look if it's not already defined in the 'standard' OpenGL functions */
if
((
local_func
=
GetProcAddress
(
opengl32_handle
,
lpszProc
))
!=
NULL
)
{
TRACE
(
" found function in 'standard' OpenGL functions (%p)
\n
"
,
local_func
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment