Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
GIMP
Commits
db570de3
Commit
db570de3
authored
Dec 30, 2022
by
Luca Bacci
Committed by
Jehan
Jan 24, 2023
Browse files
Use SetDllDirectoryW ()
No need to use GetProcAddress (), SetDllDirectory () is available since XP SP1
parent
ed1e4236
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/main.c
View file @
db570de3
...
...
@@ -608,16 +608,7 @@ main (int argc,
#ifdef G_OS_WIN32
/* Reduce risks */
{
typedef
BOOL
(
WINAPI
*
t_SetDllDirectoryA
)
(
LPCSTR
lpPathName
);
t_SetDllDirectoryA
p_SetDllDirectoryA
;
p_SetDllDirectoryA
=
(
t_SetDllDirectoryA
)
GetProcAddress
(
GetModuleHandleW
(
L"kernel32.dll"
),
"SetDllDirectoryA"
);
if
(
p_SetDllDirectoryA
)
(
*
p_SetDllDirectoryA
)
(
""
);
}
SetDllDirectoryW
(
L""
);
/* On Windows, set DLL search path to $INSTALLDIR/bin so that .exe
plug-ins in the plug-ins directory can find libgimp and file
...
...
libgimp/gimp.c
View file @
db570de3
...
...
@@ -196,15 +196,7 @@ gimp_main (GType plug_in_type,
gint
i
,
j
,
k
;
/* Reduce risks */
{
typedef
BOOL
(
WINAPI
*
t_SetDllDirectoryA
)
(
LPCSTR
lpPathName
);
t_SetDllDirectoryA
p_SetDllDirectoryA
;
p_SetDllDirectoryA
=
(
t_SetDllDirectoryA
)
GetProcAddress
(
GetModuleHandleW
(
L"kernel32.dll"
),
"SetDllDirectoryA"
);
if
(
p_SetDllDirectoryA
)
(
*
p_SetDllDirectoryA
)
(
""
);
}
SetDllDirectoryW
(
L""
);
/* On Windows, set DLL search path to $INSTALLDIR/bin so that GEGL
* file operations can find their respective file library DLLs (such
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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